From 0fce3c6734cfadba4eb219d3d264dff9a02e05ec Mon Sep 17 00:00:00 2001 From: Gavin Zhang Date: Mon, 30 Jan 2023 14:25:43 -0800 Subject: [PATCH] Revert last change and exclude location service using embedded method --- integration/combination/test_connectors.py | 9 +-------- integration/helpers/resource.py | 2 ++ .../connector_function_to_location_place_index.yaml | 4 ++-- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/integration/combination/test_connectors.py b/integration/combination/test_connectors.py index 6fc1e4cf8..47bc42a4a 100644 --- a/integration/combination/test_connectors.py +++ b/integration/combination/test_connectors.py @@ -1,13 +1,10 @@ -from unittest.case import skipIf - from time import sleep from unittest import SkipTest from parameterized import parameterized from tenacity import retry, stop_after_attempt, retry_if_exception from integration.conftest import clean_bucket from integration.helpers.base_test import S3_BUCKET_PREFIX, BaseTest -from integration.helpers.resource import generate_suffix, current_region_does_not_support -from integration.config.service_names import LOCATION +from integration.helpers.resource import generate_suffix retry_once = retry( stop=stop_after_attempt(2), @@ -16,10 +13,6 @@ ) -@skipIf( - current_region_does_not_support([LOCATION]), - "Location service is not supported in this testing region", -) class TestConnectors(BaseTest): def tearDown(self): # Some tests will create items in S3 Bucket, which result in stack DELETE_FAILED state diff --git a/integration/helpers/resource.py b/integration/helpers/resource.py index 42077063a..7abb7db0b 100644 --- a/integration/helpers/resource.py +++ b/integration/helpers/resource.py @@ -10,6 +10,7 @@ REST_API, S3_EVENTS, SQS, + LOCATION, SCHEDULE_EVENT, STATE_MACHINE_INLINE_DEFINITION, ) @@ -222,6 +223,7 @@ def _resource_using_s3_events(resource: Dict[str, Any]) -> bool: S3_EVENTS: lambda template_dict, cfn_resource_types: any( _resource_using_s3_events(resource) for resource in template_dict.get("Resources", {}).values() ), + LOCATION: lambda template_dict, cfn_resource_types: "AWS::Location::PlaceIndex" in cfn_resource_types, } diff --git a/integration/resources/templates/combination/connector_function_to_location_place_index.yaml b/integration/resources/templates/combination/connector_function_to_location_place_index.yaml index 241bfb569..abba5d9bf 100644 --- a/integration/resources/templates/combination/connector_function_to_location_place_index.yaml +++ b/integration/resources/templates/combination/connector_function_to_location_place_index.yaml @@ -35,14 +35,14 @@ Resources: ) Environment: Variables: - LOCATION_INDEX: !Sub ${AWS::StackName}-PlaceIndex + LOCATION_INDEX: !Sub ${AWS::StackName}-PI MyPlace: Type: AWS::Location::PlaceIndex Properties: DataSource: Here - IndexName: !Sub ${AWS::StackName}-PlaceIndex + IndexName: !Sub ${AWS::StackName}-PI MyConnector: Type: AWS::Serverless::Connector