Skip to content

Commit b4bc7a9

Browse files
authored
fix: Shorten Location IndexName property (#3065)
1 parent b8f57ac commit b4bc7a9

File tree

2 files changed

+31
-3
lines changed

2 files changed

+31
-3
lines changed

integration/combination/test_connectors.py

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ def tearDown(self):
5050
("combination/connector_event_rule_to_eb_custom_write",),
5151
("combination/connector_event_rule_to_lambda_write",),
5252
("combination/connector_event_rule_to_lambda_write_multiple",),
53-
("combination/connector_function_to_location_place_index",),
5453
("combination/connector_mix_destination",),
5554
("combination/connector_sqs_to_function",),
5655
("combination/connector_sns_to_function_write",),
@@ -75,6 +74,30 @@ def test_connector_by_invoking_a_function(self, template_file_path):
7574
self.assertEqual(response.get("StatusCode"), 200)
7675
self.assertEqual(response.get("FunctionError"), None)
7776

77+
@parameterized.expand(
78+
[
79+
("combination/connector_function_to_location_place_index",),
80+
]
81+
)
82+
@retry_once
83+
def test_connector_by_invoking_a_function_with_parameters(self, template_file_path):
84+
parameters = []
85+
parameters.append(self.generate_parameter("IndexName", f"PlaceIndex-{generate_suffix()}"))
86+
self.skip_using_service_detector(template_file_path)
87+
self.create_and_verify_stack(template_file_path, parameters)
88+
89+
lambda_function_name = self.get_physical_id_by_logical_id("TriggerFunction")
90+
lambda_client = self.client_provider.lambda_client
91+
92+
request_params = {
93+
"FunctionName": lambda_function_name,
94+
"InvocationType": "RequestResponse",
95+
"Payload": "{}",
96+
}
97+
response = lambda_client.invoke(**request_params)
98+
self.assertEqual(response.get("StatusCode"), 200)
99+
self.assertEqual(response.get("FunctionError"), None)
100+
78101
@parameterized.expand(
79102
[
80103
("combination/connector_sfn_to_function_without_policy",),

integration/resources/templates/combination/connector_function_to_location_place_index.yaml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
Transform: AWS::Serverless-2016-10-31-test
22

3+
Parameters:
4+
IndexName:
5+
Type: String
6+
Default: PlaceIndex
7+
38
Resources:
49
TriggerFunction:
510
Type: AWS::Serverless::Function
@@ -35,14 +40,14 @@ Resources:
3540
)
3641
Environment:
3742
Variables:
38-
LOCATION_INDEX: !Sub ${AWS::StackName}-PI
43+
LOCATION_INDEX: !Ref IndexName
3944

4045

4146
MyPlace:
4247
Type: AWS::Location::PlaceIndex
4348
Properties:
4449
DataSource: Here
45-
IndexName: !Sub ${AWS::StackName}-PI
50+
IndexName: !Ref IndexName
4651

4752
MyConnector:
4853
Type: AWS::Serverless::Connector

0 commit comments

Comments
 (0)