Skip to content

Commit 3fc1684

Browse files
committed
make NextGen default
1 parent 0cf1a54 commit 3fc1684

File tree

2 files changed

+14
-19
lines changed

2 files changed

+14
-19
lines changed

localstack-core/localstack/config.py

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1066,21 +1066,8 @@ def populate_edge_configuration(
10661066
# Whether to really publish to GCM while using SNS Platform Application (needs credentials)
10671067
LEGACY_SNS_GCM_PUBLISHING = is_env_true("LEGACY_SNS_GCM_PUBLISHING")
10681068

1069-
# TODO: remove this, replace this by setting the provider as default
1070-
# force enable the use of the new invocation logic for APIGW v1 in community
1071-
if not os.environ.get("PROVIDER_OVERRIDE_APIGATEWAY"):
1072-
os.environ["PROVIDER_OVERRIDE_APIGATEWAY"] = "next_gen"
1073-
1074-
# Whether the Next Gen APIGW invocation logic is enabled (handler chain)
1075-
APIGW_NEXT_GEN_PROVIDER = os.environ.get("PROVIDER_OVERRIDE_APIGATEWAY", "") == "next_gen"
1076-
if APIGW_NEXT_GEN_PROVIDER:
1077-
# in order to not have conflicts with different implementation registering their own router, we need to have all of
1078-
# them use the same new implementation
1079-
if not os.environ.get("PROVIDER_OVERRIDE_APIGATEWAYV2"):
1080-
os.environ["PROVIDER_OVERRIDE_APIGATEWAYV2"] = "next_gen"
1081-
1082-
if not os.environ.get("PROVIDER_OVERRIDE_APIGATEWAYMANAGEMENTAPI"):
1083-
os.environ["PROVIDER_OVERRIDE_APIGATEWAYMANAGEMENTAPI"] = "next_gen"
1069+
# Whether the Next Gen APIGW invocation logic is enabled (on by default)
1070+
APIGW_NEXT_GEN_PROVIDER = os.environ.get("PROVIDER_OVERRIDE_APIGATEWAY", "") in ("next_gen", "")
10841071

10851072
# Whether the DynamoDBStreams native provider is enabled
10861073
DDB_STREAMS_PROVIDER_V2 = os.environ.get("PROVIDER_OVERRIDE_DYNAMODBSTREAMS", "") == "v2"
@@ -1094,7 +1081,6 @@ def populate_edge_configuration(
10941081
os.environ["PROVIDER_OVERRIDE_DYNAMODBSTREAMS"] = "v2"
10951082
DDB_STREAMS_PROVIDER_V2 = True
10961083

1097-
10981084
# TODO remove fallback to LAMBDA_DOCKER_NETWORK with next minor version
10991085
MAIN_DOCKER_NETWORK = os.environ.get("MAIN_DOCKER_NETWORK", "") or LAMBDA_DOCKER_NETWORK
11001086

localstack-core/localstack/services/providers.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ def acm():
1414
return Service.for_provider(provider, dispatch_table_factory=MotoFallbackDispatcher)
1515

1616

17-
@aws_provider(api="apigateway")
17+
@aws_provider()
1818
def apigateway():
19-
from localstack.services.apigateway.legacy.provider import ApigatewayProvider
19+
from localstack.services.apigateway.next_gen.provider import ApigatewayNextGenProvider
2020
from localstack.services.moto import MotoFallbackDispatcher
2121

22-
provider = ApigatewayProvider()
22+
provider = ApigatewayNextGenProvider()
2323
return Service.for_provider(provider, dispatch_table_factory=MotoFallbackDispatcher)
2424

2525

@@ -32,6 +32,15 @@ def apigateway_next_gen():
3232
return Service.for_provider(provider, dispatch_table_factory=MotoFallbackDispatcher)
3333

3434

35+
@aws_provider(api="apigateway", name="legacy")
36+
def apigateway_legacy():
37+
from localstack.services.apigateway.legacy.provider import ApigatewayProvider
38+
from localstack.services.moto import MotoFallbackDispatcher
39+
40+
provider = ApigatewayProvider()
41+
return Service.for_provider(provider, dispatch_table_factory=MotoFallbackDispatcher)
42+
43+
3544
@aws_provider()
3645
def cloudformation():
3746
from localstack.services.cloudformation.provider import CloudformationProvider

0 commit comments

Comments
 (0)