8000 make NextGen default · localstack/localstack@87154d4 · GitHub
[go: up one dir, main page]

Skip to content

Commit 87154d4

Browse files
committed
make NextGen default
1 parent a189b57 commit 87154d4

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
@@ -1128,21 +1128,8 @@ def populate_edge_configuration(
11281128
# Whether to really publish to GCM while using SNS Platform Application (needs credentials)
11291129
LEGACY_SNS_GCM_PUBLISHING = is_env_true("LEGACY_SNS_GCM_PUBLISHING")
11301130

1131-
# TODO: remove this, replace this by setting the provider as default
1132-
# force enable the use of the new invocation logic for APIGW v1 in community
1133-
if not os.environ.get("PROVIDER_OVERRIDE_APIGATEWAY"):
1134-
os.environ["PROVIDER_OVERRIDE_APIGATEWAY"] = "next_gen"
1135-
1136-
# Whether the Next Gen APIGW invocation logic is enabled (handler chain)
1137-
APIGW_NEXT_GEN_PROVIDER = os.environ.get("PROVIDER_OVERRIDE_APIGATEWAY", "") == "next_gen"
1138-
if APIGW_NEXT_GEN_PROVIDER:
1139-
# in order to not have conflicts with different implementation registering their own router, we need to have all of
1140-
# them use the same new implementation
1141-
if not os.environ.get("PROVIDER_OVERRIDE_APIGATEWAYV2"):
1142-
os.environ["PROVIDER_OVERRIDE_APIGATEWAYV2"] = "next_gen"
1143-
1144-
if not os.environ.get("PROVIDER_OVERRIDE_APIGATEWAYMANAGEMENTAPI"):
1145-
os.environ["PROVIDER_OVERRIDE_APIGATEWAYMANAGEMENTAPI"] = "next_gen"
1131+
# Whether the Next Gen APIGW invocation logic is enabled (on by default)
1132+
APIGW_NEXT_GEN_PROVIDER = os.environ.get("PROVIDER_OVERRIDE_APIGATEWAY", "") in ("next_gen", "")
11461133

11471134
# Whether the DynamoDBStreams native provider is enabled
11481135
DDB_STREAMS_PROVIDER_V2 = os.environ.get("PROVIDER_OVERRIDE_DYNAMODBSTREAMS", "") == "v2"
@@ -1156,7 +1143,6 @@ def populate_edge_configuration(
11561143
os.environ["PROVIDER_OVERRIDE_DYNAMODBSTREAMS"] = "v2"
11571144
DDB_STREAMS_PROVIDER_V2 = True
11581145

1159-
11601146
# TODO remove fallback to LAMBDA_DOCKER_NETWORK with next minor version
11611147
MAIN_DOCKER_NETWORK = os.environ.get("MAIN_DOCKER_NETWORK", "") or LAMBDA_DOCKER_NETWORK
11621148

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)
0