8000 cfn: fix mappings in mapping-ref-map-key template to support MA/MR · localstack/localstack@680cc01 · GitHub
[go: up one dir, main page]

Skip to content

Commit 680cc01

Browse files
committed
cfn: fix mappings in mapping-ref-map-key template to support MA/MR
1 parent ed6f7ec commit 680cc01

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

tests/aws/services/cloudformation/engine/test_mappings.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import pytest
44

5+
from localstack.constants import AWS_REGION_US_EAST_1
56
from localstack.testing.pytest import markers
67
from localstack.utils.files import load_file
78
from localstack.utils.strings import short_uid
@@ -173,6 +174,7 @@ def test_mapping_ref_map_key(self, deploy_cfn_template, aws_client, map_key, sho
173174
"MapName": "MyMap",
174175
"MapKey": map_key,
175176
"TopicName": topic_name,
177+
"Region": AWS_REGION_US_EAST_1,
176178
},
177179
)
178180

tests/aws/templates/mappings/mapping-ref-map-key.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@ Mappings:
33
us-east-1:
44
A: "true"
55
B: "false"
6+
67
Conditions:
78
MyCondition: !Equals
8-
- !FindInMap [ !Ref MapName, !Ref AWS::Region, !Ref MapKey]
9+
- !FindInMap [ !Ref MapName, !Ref Region, !Ref MapKey]
910
- "true"
1011

1112
Parameters:
@@ -18,6 +19,9 @@ Parameters:
1819
TopicName:
1920
Type: String
2021

22+
Region:
23+
Type: String
24+
2125
Resources:
2226
MyTopic:
2327
Type: AWS::SNS::Topic
@@ -32,4 +36,3 @@ Outputs:
3236
TopicArn:
3337
Value: !Ref MyTopic
3438
Condition: MyCondition
35-

0 commit comments

Comments
 (0)
0