8000 Organize config list (#9654) · codeperl/localstack@567b51a · GitHub
[go: up one dir, main page]

Skip to content

Commit 567b51a

Browse files
authored
Organize config list (localstack#9654)
1 parent 994350a commit 567b51a

File tree

5 files changed

+33
-41
lines changed

5 files changed

+33
-41
lines changed

doc/interaction/README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,6 @@ awslocal kinesis list-streams
4747
}
4848
```
4949

50-
**UPDATE**: Use the environment variable `$LOCALSTACK_HOSTNAME` to determine the target host inside your Lambda function. See [Configuration](#configuration) section for more details.
51-
5250
## AWS CLI v2 with Docker and LocalStack
5351

5452
By default, the container running [amazon/aws-cli](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2-docker.html) is isolated from `0.0.0.0:4566` on the host machine, that means that aws-cli cannot reach localstack through your shell.

localstack/config.py

Lines changed: 30 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -825,9 +825,7 @@ def populate_edge_configuration(
825825
os.environ.get("SQS_CLOUDWATCH_METRICS_REPORT_INTERVAL") or 60
826826
)
827827

828-
# DEPRECATED: deprecated since 2.0.0 but added back upon customer request for the new Lambda provider
829-
# Keep a bit longer until we are sure that LOCALSTACK_HOST covers the special scenario but do not advertise publicly.
830-
# Endpoint host under which LocalStack APIs are accessible from Lambda Docker containers.
828+
# PUBLIC: Endpoint host under which LocalStack APIs are accessible from Lambda Docker containers.
831829
HOSTNAME_FROM_LAMBDA = os.environ.get("HOSTNAME_FROM_LAMBDA", "").strip()
832830

833831
# PUBLIC: hot-reload (default v2), __local__ (default v1)
@@ -1046,12 +1044,13 @@ def use_custom_dns():
10461044
# if `DISABLE_BOTO_RETRIES=1` is set, all our created boto clients will have retries disabled
10471045
DISABLE_BOTO_RETRIES = is_env_true("DISABLE_BOTO_RETRIES")
10481046

1049-
# HINT: Please add deprecated environment variables to deprecations.py
1050-
10511047
# List of environment variable names used for configuration that are passed from the host into the LocalStack container.
1052-
# Make sure to keep this in sync with the above!
1053-
# Do *not* include any internal developer configurations that apply to host-mode only in this list.
1054-
# Note: do *not* include DATA_DIR in this list, as it is treated separately
1048+
# => Synchronize this list with the above and the configuration docs:
1049+
# https://docs.localstack.cloud/references/configuration/
1050+
# => Sort this list alphabetically
1051+
# => Add deprecated environment variables to deprecations.py and add a comment in this list
1052+
# => Move removed legacy variables to the section grouped by release (still relevant for deprecation warnings)
1053+
# => Do *not* include any internal developer configurations that apply to host-mode only in this list.
10551054
CONFIG_ENV_VARS = [
10561055
"ALLOW_NONSTANDARD_REGIONS",
10571056
"BOTO_WAITER_DELAY",
@@ -1064,7 +1063,6 @@ def use_custom_dns():
10641063
"CUSTOM_SSL_CERT_PATH",
10651064
"DEBUG",
10661065
"DEBUG_HANDLER_CHAIN",
1067-
"DEFAULT_REGION", # Not functional; deprecated in 0.12.7, removed in 3.0.0
10681066
"DEVELOP",
10691067
"DEVELOP_PORT",
10701068
"DISABLE_BOTO_RETRIES",
@@ -1090,24 +1088,17 @@ def use_custom_dns():
10901088
"DYNAMODB_READ_ERROR_PROBABILITY",
10911089
"DYNAMODB_WRITE_ERROR_PROBABILITY",
10921090
"EAGER_SERVICE_LOADING",
1093-
"EDGE_FORWARD_URL", # Not functional; Deprecated in 1.4.0, removed in 3.0.0
10941091
"ENABLE_CONFIG_UPDATES",
1095-
"ES_CUSTOM_BACKEND",
1096-
"ES_ENDPOINT_STRATEGY",
1097-
"ES_MULTI_CLUSTER",
10981092
"EXTRA_CORS_ALLOWED_HEADERS",
10991093
"EXTRA_CORS_ALLOWED_ORIGINS",
11001094
"EXTRA_CORS_EXPOSE_HEADERS",
11011095
"GATEWAY_LISTEN",
11021096
"HOSTNAME",
1103-
"HOSTNAME_EXTERNAL",
1104-
"HOSTNAME_FROM_LAMBDA", # deprecated since 2.0.0 but added to new Lambda provider
1097+
"HOSTNAME_FROM_LAMBDA",
11051098
"KINESIS_ERROR_PROBABILITY",
1106-
"KINESIS_INITIALIZE_STREAMS", # Not functional; Deprecated in 1.4.0, removed in 3.0.0
11071099
"KINESIS_MOCK_PERSIST_INTERVAL",
11081100
"KINESIS_MOCK_LOG_LEVEL",
11091101
"KINESIS_ON_DEMAND_STREAM_COUNT_LIMIT",
1110-
"KMS_PROVIDER", # Not functional; Deprecated in 1.4.0, removed in 3.0.0
11111102
"LAMBDA_DOCKER_DNS",
11121103
"LAMBDA_DOCKER_FLAGS",
11131104
"LAMBDA_DOCKER_NETWORK",
@@ -1121,7 +1112,6 @@ def use_custom_dns():
11211112
"LAMBDA_INIT_RELEASE_VERSION",
11221113
"LAMBDA_KEEPALIVE_MS",
11231114
"LAMBDA_RUNTIME_IMAGE_MAPPING",
1124-
"LAMBDA_JAVA_OPTS",
11251115
"LAMBDA_REMOVE_CONTAINERS",
11261116
"LAMBDA_RUNTIME_EXECUTOR",
11271117
"LAMBDA_RUNTIME_ENVIRONMENT_TIMEOUT",
@@ -1135,14 +1125,11 @@ def use_custom_dns():
11351125
"LAMBDA_LIMITS_CODE_SIZE_UNZIPPED",
11361126
"LAMBDA_LIMITS_CREATE_FUNCTION_REQUEST_SIZE",
11371127
"LAMBDA_LIMITS_MAX_FUNCTION_ENVVAR_SIZE_BYTES",
1138-
"LEGACY_DIRECTORIES",
11391128
"LEGACY_DOCKER_CLIENT",
1140-
"LEGACY_EDGE_PROXY", # Not functional; Deprecated in 1.0.0, removed in 3.0.0
11411129
"LEGACY_SNS_GCM_PUBLISHING",
11421130
"LOCALSTACK_API_KEY",
11431131
"LOCALSTACK_AUTH_TOKEN",
11441132
"LOCALSTACK_HOST",
1145-
"LOCALSTACK_HOSTNAME",
11461133
"LOG_LICENSE_ISSUES",
11471134
"LS_LOG",
11481135
"MAIN_CONTAINER_NAME",
@@ -1171,29 +1158,43 @@ def use_custom_dns():
11711158
"STRICT_SERVICE_LOADING",
11721159
"TEST_AWS_ACCOUNT_ID",
11731160
"TF_COMPAT_MODE",
1174-
"USE_SINGLE_REGION", # Not functional; deprecated in 0.12.7, removed in 3.0.0
11751161
"USE_SSL",
11761162
"WAIT_FOR_DEBUGGER",
11771163
"WINDOWS_DOCKER_MOUNT_PREFIX",
1178-
# Removed in 3.0.0
1164+
# Removed legacy variables in 2.0.0
1165+
# DATA_DIR => do *not* include in this list, as it is treated separately. # deprecated since 1.0.0
1166+
"LEGACY_DIRECTORIES", # deprecated since 1.0.0
1167+
"SYNCHRONOUS_API_GATEWAY_EVENTS", # deprecated since 1.3.0
1168+
"SYNCHRONOUS_DYNAMODB_EVENTS", # deprecated since 1.3.0
1169+
"SYNCHRONOUS_SNS_EVENTS", # deprecated since 1.3.0
1170+
"SYNCHRONOUS_SQS_EVENTS", # deprecated since 1.3.0
1171+
# Removed legacy variables in 3.0.0
1172+
"DEFAULT_REGION", # deprecated since 0.12.7
11791173
"EDGE_BIND_HOST", # deprecated since 2.0.0
1174+
"EDGE_FORWARD_URL", # deprecated since 1.4.0
11801175
"EDGE_PORT", # deprecated since 2.0.0
11811176
"EDGE_PORT_HTTP", # deprecated since 2.0.0
1177+
"ES_CUSTOM_BACKEND", # deprecated since 0.14.0
1178+
"ES_ENDPOINT_STRATEGY", # deprecated since 0.14.0
1179+
"ES_MULTI_CLUSTER", # deprecated since 0.14.0
1180+
"HOSTNAME_EXTERNAL", # deprecated since 2.0.0
1181+
"KINESIS_INITIALIZE_STREAMS", # deprecated since 1.4.0
1182+
"KINESIS_PROVIDER", # deprecated since 1.3.0
1183+
"KMS_PROVIDER", # deprecated since 1.4.0
11821184
"LAMBDA_XRAY_INIT", # deprecated since 2.0.0
11831185
"LAMBDA_CODE_EXTRACT_TIME", # deprecated since 2.0.0
11841186
"LAMBDA_CONTAINER_REGISTRY", # deprecated since 2.0.0
11851187
"LAMBDA_EXECUTOR", # deprecated since 2.0.0
11861188
"LAMBDA_FALLBACK_URL", # deprecated since 2.0.0
11871189
"LAMBDA_FORWARD_URL", # deprecated since 2.0.0
1190+
"LAMBDA_JAVA_OPTS", # currently only supported in old Lambda provider but not officially deprecated
11881191
"LAMBDA_REMOTE_DOCKER", # deprecated since 2.0.0
11891192
"LAMBDA_STAY_OPEN_MODE", # deprecated since 2.0.0
1190-
"SQS_PORT_EXTERNAL", # deprecated in docs since 2022-07-13
1193+
"LEGACY_EDGE_PROXY", # deprecated since 1.0.0
1194+
"LOCALSTACK_HOSTNAME", # deprecated since 2.0.0
1195+
"SQS_PORT_EXTERNAL", # deprecated only in docs since 2022-07-13
11911196
"SYNCHRONOUS_KINESIS_EVENTS", # deprecated since 1.3.0
1192-
"SYNCHRONOUS_SNS_EVENTS", # deprecated since 1.3.0
1193-
"SYNCHRONOUS_DYNAMODB_EVENTS", # deprecated since 1.3.0
1194-
"SYNCHRONOUS_API_GATEWAY_EVENTS", # deprecated since 1.3.0
1195-
"SYNCHRONOUS_SQS_EVENTS", # deprecated since 1.3.0
1196-
"KINESIS_PROVIDER", # deprecated since 1.3.0
1197+
"USE_SINGLE_REGION", # deprecated since 0.12.7
11971198
"MOCK_UNIMPLEMENTED", # deprecated since 1.3.0
11981199
]
11991200

localstack/deprecations.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -231,12 +231,6 @@ def is_affected(self) -> bool:
231231
"This feature is not supported in the new lambda provider "
232232
"https://docs.localstack.cloud/user-guide/aws/lambda/#migrating-to-lambda-v2",
233233
),
234-
EnvVarDeprecation(
235-
"HOSTNAME_FROM_LAMBDA",
236-
"2.0.0",
237-
"This feature is currently not supported in the new lambda provider "
238-
"https://docs.localstack.cloud/user-guide/aws/lambda/#migrating-to-lambda-v2",
239-
),
240234
EnvVarDeprecation(
241235
"LAMBDA_XRAY_INIT",
242236
"2.0.0",

localstack/testing/pytest/cloudtrail_tracking/cloudtrail_tracking/handler/index.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import boto3
77

88
S3_BUCKET = os.environ["BUCKET"]
9-
LOCALSTACK_HOST = os.getenv("LOCALSTACK_HOSTNAME")
9+
AWS_ENDPOINT_URL = os.environ.get("AWS_ENDPOINT_URL")
1010

1111

1212
class Encoder(json.JSONEncoder):
@@ -21,10 +21,10 @@ def default(self, o: Any) -> Any:
2121

2222

2323
def get_client(service: str):
24-
if LOCALSTACK_HOST is not None:
24+
if AWS_ENDPOINT_URL is not None:
2525
client = boto3.client(
2626
service,
27-
endpoint_url=f"http://{LOCALSTACK_HOST}:4566",
27+
endpoint_url=AWS_ENDPOINT_URL,
2828
region_name="us-east-1",
2929
)
3030
else:

localstack/utils/net.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,6 @@ def get_docker_host_from_container() -> str:
441441
# If we're running outside Docker (in host mode), and would like the Lambda containers to be able
442442
# to access services running on the local machine, return `host.docker.internal` accordingly
443443
result = "host.docker.internal"
444-
# update LOCALSTACK_HOSTNAME if host.docker.internal is available
445444
if config.is_in_docker:
446445
try:
447446
result = socket.gethostbyname("host.docker.internal")

0 commit comments

Comments
 (0)
0