From c9d614851387f03962ff1abbe56e3c8474345e03 Mon Sep 17 00:00:00 2001 From: Vichy Meas Date: Thu, 28 May 2026 20:56:20 -0700 Subject: [PATCH] fix: use REGIONAL endpoint for integration test REST APIs Switch all integration test templates that create REST APIs from the default EDGE to REGIONAL via Globals.Api.EndpointConfiguration. This avoids hitting the stricter DeleteRestApi rate limit for edge-optimized APIs (which involve CloudFront distribution teardown) and enables faster cleanup by the sweeper function. Templates that explicitly test EDGE behavior (custom domain edge tests, security policy edge tests) are left unchanged. --- .../templates/combination/api_with_authorizer_apikey.yaml | 4 ++++ .../combination/api_with_authorizer_override_api_auth.yaml | 4 ++++ .../api_with_authorizers_invokefunction_set_none.yaml | 4 ++++ .../templates/combination/api_with_authorizers_max.yaml | 4 ++++ .../combination/api_with_authorizers_max_openapi.yaml | 1 + .../templates/combination/api_with_authorizers_min.yaml | 4 ++++ .../templates/combination/api_with_binary_media_types.yaml | 4 ++++ .../api_with_binary_media_types_with_definition_body.yaml | 1 + ..._with_binary_media_types_with_definition_body_openapi.yaml | 1 + .../templates/combination/api_with_cors_and_apikey.yaml | 1 + .../combination/api_with_disable_execute_api_endpoint.yaml | 4 ++++ .../api_with_disable_execute_api_endpoint_openapi_3.yaml | 4 ++++ .../templates/combination/api_with_fail_on_warnings.yaml | 4 ++++ .../templates/combination/api_with_gateway_responses.yaml | 4 ++++ .../templates/combination/api_with_method_settings.yaml | 4 ++++ .../templates/combination/api_with_propagate_tags.yaml | 4 ++++ .../templates/combination/api_with_request_models.yaml | 4 ++++ .../combination/api_with_request_models_openapi.yaml | 4 ++++ .../combination/api_with_request_parameters_openapi.yaml | 1 + .../templates/combination/api_with_resource_policies.yaml | 1 + .../combination/api_with_resource_policies_aws_account.yaml | 4 ++++ .../templates/combination/api_with_resource_refs.yaml | 4 ++++ .../resources/templates/combination/api_with_usage_plan.yaml | 1 + .../combination/function_with_alias_and_event_sources.yaml | 4 ++++ .../templates/combination/function_with_all_event_types.yaml | 3 +++ .../function_with_all_event_types_condition_false.yaml | 4 ++++ .../resources/templates/combination/function_with_api.yaml | 4 ++++ .../function_with_implicit_api_and_conditions.yaml | 4 ++++ .../combination/function_with_implicit_api_with_timeout.yaml | 4 ++++ .../templates/combination/intrinsics_code_definition_uri.yaml | 4 ++++ .../templates/combination/intrinsics_serverless_api.yaml | 4 ++++ .../templates/combination/state_machine_with_api.yaml | 4 ++++ integration/resources/templates/single/basic_api.yaml | 4 ++++ .../resources/templates/single/basic_api_inline_openapi.yaml | 4 ++++ .../resources/templates/single/basic_api_inline_swagger.yaml | 4 ++++ .../resources/templates/single/basic_api_with_mode.yaml | 4 ++++ .../templates/single/basic_api_with_mode_update.yaml | 4 ++++ .../resources/templates/single/basic_api_with_tags.yaml | 4 ++++ 38 files changed, 130 insertions(+) diff --git a/integration/resources/templates/combination/api_with_authorizer_apikey.yaml b/integration/resources/templates/combination/api_with_authorizer_apikey.yaml index 003f68738d..862c4adecb 100644 --- a/integration/resources/templates/combination/api_with_authorizer_apikey.yaml +++ b/integration/resources/templates/combination/api_with_authorizer_apikey.yaml @@ -1,3 +1,7 @@ +Globals: + Api: + EndpointConfiguration: REGIONAL + Resources: MyApi: Type: AWS::Serverless::Api diff --git a/integration/resources/templates/combination/api_with_authorizer_override_api_auth.yaml b/integration/resources/templates/combination/api_with_authorizer_override_api_auth.yaml index ccb70abbe4..1ebd34f277 100644 --- a/integration/resources/templates/combination/api_with_authorizer_override_api_auth.yaml +++ b/integration/resources/templates/combination/api_with_authorizer_override_api_auth.yaml @@ -1,3 +1,7 @@ +Globals: + Api: + EndpointConfiguration: REGIONAL + Resources: MyApi: Type: AWS::Serverless::Api diff --git a/integration/resources/templates/combination/api_with_authorizers_invokefunction_set_none.yaml b/integration/resources/templates/combination/api_with_authorizers_invokefunction_set_none.yaml index f3c42ae149..35ec9577d1 100644 --- a/integration/resources/templates/combination/api_with_authorizers_invokefunction_set_none.yaml +++ b/integration/resources/templates/combination/api_with_authorizers_invokefunction_set_none.yaml @@ -1,3 +1,7 @@ +Globals: + Api: + EndpointConfiguration: REGIONAL + Resources: MyApiWithAwsIamAuthNoCallerCredentials: Type: AWS::Serverless::Api diff --git a/integration/resources/templates/combination/api_with_authorizers_max.yaml b/integration/resources/templates/combination/api_with_authorizers_max.yaml index 4e1062601b..c0644f5ddc 100644 --- a/integration/resources/templates/combination/api_with_authorizers_max.yaml +++ b/integration/resources/templates/combination/api_with_authorizers_max.yaml @@ -1,3 +1,7 @@ +Globals: + Api: + EndpointConfiguration: REGIONAL + Resources: MyApi: Type: AWS::Serverless::Api diff --git a/integration/resources/templates/combination/api_with_authorizers_max_openapi.yaml b/integration/resources/templates/combination/api_with_authorizers_max_openapi.yaml index 3066930c28..260d19074e 100644 --- a/integration/resources/templates/combination/api_with_authorizers_max_openapi.yaml +++ b/integration/resources/templates/combination/api_with_authorizers_max_openapi.yaml @@ -1,5 +1,6 @@ Globals: Api: + EndpointConfiguration: REGIONAL OpenApiVersion: 3.0.0 Resources: MyApi: diff --git a/integration/resources/templates/combination/api_with_authorizers_min.yaml b/integration/resources/templates/combination/api_with_authorizers_min.yaml index 124cdf6bae..3a193715e7 100644 --- a/integration/resources/templates/combination/api_with_authorizers_min.yaml +++ b/integration/resources/templates/combination/api_with_authorizers_min.yaml @@ -1,3 +1,7 @@ +Globals: + Api: + EndpointConfiguration: REGIONAL + Resources: MyApi: Type: AWS::Serverless::Api diff --git a/integration/resources/templates/combination/api_with_binary_media_types.yaml b/integration/resources/templates/combination/api_with_binary_media_types.yaml index 281133a48e..9d9dc92790 100644 --- a/integration/resources/templates/combination/api_with_binary_media_types.yaml +++ b/integration/resources/templates/combination/api_with_binary_media_types.yaml @@ -1,3 +1,7 @@ +Globals: + Api: + EndpointConfiguration: REGIONAL + Parameters: Bucket: Type: String diff --git a/integration/resources/templates/combination/api_with_binary_media_types_with_definition_body.yaml b/integration/resources/templates/combination/api_with_binary_media_types_with_definition_body.yaml index b9131b457a..2d0d36e052 100644 --- a/integration/resources/templates/combination/api_with_binary_media_types_with_definition_body.yaml +++ b/integration/resources/templates/combination/api_with_binary_media_types_with_definition_body.yaml @@ -10,6 +10,7 @@ Parameters: Default: image~1gif Globals: Api: + EndpointConfiguration: REGIONAL # Send/receive binary data through the APIs BinaryMediaTypes: # These are equivalent to image/gif and image/png when deployed diff --git a/integration/resources/templates/combination/api_with_binary_media_types_with_definition_body_openapi.yaml b/integration/resources/templates/combination/api_with_binary_media_types_with_definition_body_openapi.yaml index 22c621f485..f2c77c9389 100644 --- a/integration/resources/templates/combination/api_with_binary_media_types_with_definition_body_openapi.yaml +++ b/integration/resources/templates/combination/api_with_binary_media_types_with_definition_body_openapi.yaml @@ -12,6 +12,7 @@ Parameters: Default: image~1gif Globals: Api: + EndpointConfiguration: REGIONAL # Send/receive binary data through the APIs BinaryMediaTypes: # These are equivalent to image/gif and image/png when deployed diff --git a/integration/resources/templates/combination/api_with_cors_and_apikey.yaml b/integration/resources/templates/combination/api_with_cors_and_apikey.yaml index f891510ae4..c989da5035 100644 --- a/integration/resources/templates/combination/api_with_cors_and_apikey.yaml +++ b/integration/resources/templates/combination/api_with_cors_and_apikey.yaml @@ -5,6 +5,7 @@ Transform: Globals: Api: + EndpointConfiguration: REGIONAL Auth: ApiKeyRequired: true AddApiKeyRequiredToCorsPreflight: false diff --git a/integration/resources/templates/combination/api_with_disable_execute_api_endpoint.yaml b/integration/resources/templates/combination/api_with_disable_execute_api_endpoint.yaml index f4de3cdd44..506934eb14 100644 --- a/integration/resources/templates/combination/api_with_disable_execute_api_endpoint.yaml +++ b/integration/resources/templates/combination/api_with_disable_execute_api_endpoint.yaml @@ -1,3 +1,7 @@ +Globals: + Api: + EndpointConfiguration: REGIONAL + Parameters: DisableExecuteApiEndpointValue: Description: Variable to define if client can access default API endpoint. diff --git a/integration/resources/templates/combination/api_with_disable_execute_api_endpoint_openapi_3.yaml b/integration/resources/templates/combination/api_with_disable_execute_api_endpoint_openapi_3.yaml index 64a86bf9a8..801bea3607 100644 --- a/integration/resources/templates/combination/api_with_disable_execute_api_endpoint_openapi_3.yaml +++ b/integration/resources/templates/combination/api_with_disable_execute_api_endpoint_openapi_3.yaml @@ -1,3 +1,7 @@ +Globals: + Api: + EndpointConfiguration: REGIONAL + Parameters: DisableExecuteApiEndpointValue: Description: Variable to define if client can access default API endpoint. diff --git a/integration/resources/templates/combination/api_with_fail_on_warnings.yaml b/integration/resources/templates/combination/api_with_fail_on_warnings.yaml index 29adffb63d..40c2bc9ae0 100644 --- a/integration/resources/templates/combination/api_with_fail_on_warnings.yaml +++ b/integration/resources/templates/combination/api_with_fail_on_warnings.yaml @@ -1,3 +1,7 @@ +Globals: + Api: + EndpointConfiguration: REGIONAL + Parameters: FailOnWarningsValue: Type: String diff --git a/integration/resources/templates/combination/api_with_gateway_responses.yaml b/integration/resources/templates/combination/api_with_gateway_responses.yaml index 160d3d0e33..1ab9f4e945 100644 --- a/integration/resources/templates/combination/api_with_gateway_responses.yaml +++ b/integration/resources/templates/combination/api_with_gateway_responses.yaml @@ -1,3 +1,7 @@ +Globals: + Api: + EndpointConfiguration: REGIONAL + Resources: MyApi: Type: AWS::Serverless::Api diff --git a/integration/resources/templates/combination/api_with_method_settings.yaml b/integration/resources/templates/combination/api_with_method_settings.yaml index cb5756d405..95d72c2a6b 100644 --- a/integration/resources/templates/combination/api_with_method_settings.yaml +++ b/integration/resources/templates/combination/api_with_method_settings.yaml @@ -1,3 +1,7 @@ +Globals: + Api: + EndpointConfiguration: REGIONAL + Resources: MyApi: Type: AWS::Serverless::Api diff --git a/integration/resources/templates/combination/api_with_propagate_tags.yaml b/integration/resources/templates/combination/api_with_propagate_tags.yaml index 8bba278300..d725e002ee 100644 --- a/integration/resources/templates/combination/api_with_propagate_tags.yaml +++ b/integration/resources/templates/combination/api_with_propagate_tags.yaml @@ -1,3 +1,7 @@ +Globals: + Api: + EndpointConfiguration: REGIONAL + Resources: MyApi: Type: AWS::Serverless::Api diff --git a/integration/resources/templates/combination/api_with_request_models.yaml b/integration/resources/templates/combination/api_with_request_models.yaml index aeed1b4e4d..56fe7bfce9 100644 --- a/integration/resources/templates/combination/api_with_request_models.yaml +++ b/integration/resources/templates/combination/api_with_request_models.yaml @@ -1,3 +1,7 @@ +Globals: + Api: + EndpointConfiguration: REGIONAL + Resources: MyApi: Type: AWS::Serverless::Api diff --git a/integration/resources/templates/combination/api_with_request_models_openapi.yaml b/integration/resources/templates/combination/api_with_request_models_openapi.yaml index 806faa30db..77486926d5 100644 --- a/integration/resources/templates/combination/api_with_request_models_openapi.yaml +++ b/integration/resources/templates/combination/api_with_request_models_openapi.yaml @@ -1,3 +1,7 @@ +Globals: + Api: + EndpointConfiguration: REGIONAL + Resources: MyApi: Type: AWS::Serverless::Api diff --git a/integration/resources/templates/combination/api_with_request_parameters_openapi.yaml b/integration/resources/templates/combination/api_with_request_parameters_openapi.yaml index ebd025ff38..c69548b5ba 100644 --- a/integration/resources/templates/combination/api_with_request_parameters_openapi.yaml +++ b/integration/resources/templates/combination/api_with_request_parameters_openapi.yaml @@ -1,5 +1,6 @@ Globals: Api: + EndpointConfiguration: REGIONAL OpenApiVersion: 3.0.1 CacheClusterEnabled: true CacheClusterSize: '0.5' diff --git a/integration/resources/templates/combination/api_with_resource_policies.yaml b/integration/resources/templates/combination/api_with_resource_policies.yaml index 2639265400..b2f7e54044 100644 --- a/integration/resources/templates/combination/api_with_resource_policies.yaml +++ b/integration/resources/templates/combination/api_with_resource_policies.yaml @@ -6,6 +6,7 @@ Conditions: Globals: Api: + EndpointConfiguration: REGIONAL OpenApiVersion: 3.0.1 Auth: ResourcePolicy: diff --git a/integration/resources/templates/combination/api_with_resource_policies_aws_account.yaml b/integration/resources/templates/combination/api_with_resource_policies_aws_account.yaml index 3a6d2bb0b0..dc403ffd4d 100644 --- a/integration/resources/templates/combination/api_with_resource_policies_aws_account.yaml +++ b/integration/resources/templates/combination/api_with_resource_policies_aws_account.yaml @@ -1,3 +1,7 @@ +Globals: + Api: + EndpointConfiguration: REGIONAL + Resources: MyLambdaFunction: Type: AWS::Serverless::Function diff --git a/integration/resources/templates/combination/api_with_resource_refs.yaml b/integration/resources/templates/combination/api_with_resource_refs.yaml index 05010722f5..1dc292af5f 100644 --- a/integration/resources/templates/combination/api_with_resource_refs.yaml +++ b/integration/resources/templates/combination/api_with_resource_refs.yaml @@ -1,3 +1,7 @@ +Globals: + Api: + EndpointConfiguration: REGIONAL + # Test to verify that resource references available on the Api resource are properly resolved Resources: diff --git a/integration/resources/templates/combination/api_with_usage_plan.yaml b/integration/resources/templates/combination/api_with_usage_plan.yaml index 0447e9153f..31fd1133ab 100644 --- a/integration/resources/templates/combination/api_with_usage_plan.yaml +++ b/integration/resources/templates/combination/api_with_usage_plan.yaml @@ -4,6 +4,7 @@ Parameters: Default: PER_API Globals: Api: + EndpointConfiguration: REGIONAL OpenApiVersion: '2.0' Auth: ApiKeyRequired: true diff --git a/integration/resources/templates/combination/function_with_alias_and_event_sources.yaml b/integration/resources/templates/combination/function_with_alias_and_event_sources.yaml index d8d026cc5f..ea68464396 100644 --- a/integration/resources/templates/combination/function_with_alias_and_event_sources.yaml +++ b/integration/resources/templates/combination/function_with_alias_and_event_sources.yaml @@ -1,3 +1,7 @@ +Globals: + Api: + EndpointConfiguration: REGIONAL + # Testing Alias Invoke with ALL event sources supported by Lambda # We are looking to check if the event sources and their associated Lambda::Permission resources are # connect to the Alias and *not* the function diff --git a/integration/resources/templates/combination/function_with_all_event_types.yaml b/integration/resources/templates/combination/function_with_all_event_types.yaml index e96e081e44..523c3ba053 100644 --- a/integration/resources/templates/combination/function_with_all_event_types.yaml +++ b/integration/resources/templates/combination/function_with_all_event_types.yaml @@ -1,4 +1,7 @@ AWSTemplateFormatVersion: '2010-09-09' +Globals: + Api: + EndpointConfiguration: REGIONAL Parameters: ScheduleName: diff --git a/integration/resources/templates/combination/function_with_all_event_types_condition_false.yaml b/integration/resources/templates/combination/function_with_all_event_types_condition_false.yaml index 3fb8fa17cc..29f11f9b98 100644 --- a/integration/resources/templates/combination/function_with_all_event_types_condition_false.yaml +++ b/integration/resources/templates/combination/function_with_all_event_types_condition_false.yaml @@ -1,4 +1,8 @@ AWSTemplateFormatVersion: '2010-09-09' +Globals: + Api: + EndpointConfiguration: REGIONAL + Conditions: MyCondition: Fn::Equals: diff --git a/integration/resources/templates/combination/function_with_api.yaml b/integration/resources/templates/combination/function_with_api.yaml index d208990f97..2166721b65 100644 --- a/integration/resources/templates/combination/function_with_api.yaml +++ b/integration/resources/templates/combination/function_with_api.yaml @@ -1,3 +1,7 @@ +Globals: + Api: + EndpointConfiguration: REGIONAL + Resources: # Create one API resource. This will be referred to by the Lambda function diff --git a/integration/resources/templates/combination/function_with_implicit_api_and_conditions.yaml b/integration/resources/templates/combination/function_with_implicit_api_and_conditions.yaml index bdd5de6a3b..c12788cfb3 100644 --- a/integration/resources/templates/combination/function_with_implicit_api_and_conditions.yaml +++ b/integration/resources/templates/combination/function_with_implicit_api_and_conditions.yaml @@ -1,4 +1,8 @@ AWSTemplateFormatVersion: '2010-09-09' +Globals: + Api: + EndpointConfiguration: REGIONAL + Description: A template to test for implicit API condition handling. Conditions: MyCondition: diff --git a/integration/resources/templates/combination/function_with_implicit_api_with_timeout.yaml b/integration/resources/templates/combination/function_with_implicit_api_with_timeout.yaml index a395b38631..48041a9002 100644 --- a/integration/resources/templates/combination/function_with_implicit_api_with_timeout.yaml +++ b/integration/resources/templates/combination/function_with_implicit_api_with_timeout.yaml @@ -1,4 +1,8 @@ AWSTemplateFormatVersion: '2010-09-09' +Globals: + Api: + EndpointConfiguration: REGIONAL + Description: A template to test timeout support for implicit APIs. Resources: diff --git a/integration/resources/templates/combination/intrinsics_code_definition_uri.yaml b/integration/resources/templates/combination/intrinsics_code_definition_uri.yaml index 47c20aeac2..2ce7242263 100644 --- a/integration/resources/templates/combination/intrinsics_code_definition_uri.yaml +++ b/integration/resources/templates/combination/intrinsics_code_definition_uri.yaml @@ -1,3 +1,7 @@ +Globals: + Api: + EndpointConfiguration: REGIONAL + # Must support explicit bucket, key and version in CodeUri and DefinitionUri parameters Parameters: diff --git a/integration/resources/templates/combination/intrinsics_serverless_api.yaml b/integration/resources/templates/combination/intrinsics_serverless_api.yaml index 29dab75585..d7aa06c785 100644 --- a/integration/resources/templates/combination/intrinsics_serverless_api.yaml +++ b/integration/resources/templates/combination/intrinsics_serverless_api.yaml @@ -1,3 +1,7 @@ +Globals: + Api: + EndpointConfiguration: REGIONAL + Parameters: Bucket: Type: String diff --git a/integration/resources/templates/combination/state_machine_with_api.yaml b/integration/resources/templates/combination/state_machine_with_api.yaml index abf4c003f2..1d8beca26c 100644 --- a/integration/resources/templates/combination/state_machine_with_api.yaml +++ b/integration/resources/templates/combination/state_machine_with_api.yaml @@ -1,3 +1,7 @@ +Globals: + Api: + EndpointConfiguration: REGIONAL + Resources: # Create one API resource. This will be referred to by the State machine diff --git a/integration/resources/templates/single/basic_api.yaml b/integration/resources/templates/single/basic_api.yaml index aae58ec85f..1d726f625a 100644 --- a/integration/resources/templates/single/basic_api.yaml +++ b/integration/resources/templates/single/basic_api.yaml @@ -1,3 +1,7 @@ +Globals: + Api: + EndpointConfiguration: REGIONAL + Resources: MyApi: Type: AWS::Serverless::Api diff --git a/integration/resources/templates/single/basic_api_inline_openapi.yaml b/integration/resources/templates/single/basic_api_inline_openapi.yaml index 021a1386e0..309f01c8bf 100644 --- a/integration/resources/templates/single/basic_api_inline_openapi.yaml +++ b/integration/resources/templates/single/basic_api_inline_openapi.yaml @@ -1,3 +1,7 @@ +Globals: + Api: + EndpointConfiguration: REGIONAL + Resources: MyApi: Type: AWS::Serverless::Api diff --git a/integration/resources/templates/single/basic_api_inline_swagger.yaml b/integration/resources/templates/single/basic_api_inline_swagger.yaml index 3023c1f68c..58ca76d4fb 100644 --- a/integration/resources/templates/single/basic_api_inline_swagger.yaml +++ b/integration/resources/templates/single/basic_api_inline_swagger.yaml @@ -1,3 +1,7 @@ +Globals: + Api: + EndpointConfiguration: REGIONAL + Resources: MyApi: Type: AWS::Serverless::Api diff --git a/integration/resources/templates/single/basic_api_with_mode.yaml b/integration/resources/templates/single/basic_api_with_mode.yaml index bf0f60ee11..82a9624548 100644 --- a/integration/resources/templates/single/basic_api_with_mode.yaml +++ b/integration/resources/templates/single/basic_api_with_mode.yaml @@ -1,3 +1,7 @@ +Globals: + Api: + EndpointConfiguration: REGIONAL + Resources: MyApi: Type: AWS::Serverless::Api diff --git a/integration/resources/templates/single/basic_api_with_mode_update.yaml b/integration/resources/templates/single/basic_api_with_mode_update.yaml index 4810f25265..589fd4d1f6 100644 --- a/integration/resources/templates/single/basic_api_with_mode_update.yaml +++ b/integration/resources/templates/single/basic_api_with_mode_update.yaml @@ -1,3 +1,7 @@ +Globals: + Api: + EndpointConfiguration: REGIONAL + Resources: MyApi: Type: AWS::Serverless::Api diff --git a/integration/resources/templates/single/basic_api_with_tags.yaml b/integration/resources/templates/single/basic_api_with_tags.yaml index 32328b833c..4af4987f70 100644 --- a/integration/resources/templates/single/basic_api_with_tags.yaml +++ b/integration/resources/templates/single/basic_api_with_tags.yaml @@ -1,3 +1,7 @@ +Globals: + Api: + EndpointConfiguration: REGIONAL + Resources: MyApi: Type: AWS::Serverless::Api