Skip to content

Commit a31ed23

Browse files
committed
Add second example
1 parent 6a7029a commit a31ed23

File tree

5 files changed

+53
-9
lines changed

5 files changed

+53
-9
lines changed

tests/aws/services/cloudformation/test_change_set_fn_get_attr.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -313,12 +313,13 @@ def test_immutable_property_update_causes_resource_replacement(
313313
capture_update_process(snapshot, template_1, template_2)
314314

315315
@markers.aws.validated
316-
def test_invalid_structure(self, snapshot, deploy_cfn_template, aws_client):
316+
@pytest.mark.parametrize("template_name", ["getatt_validation.yml", "getatt_validation2.yml"])
317+
def test_invalid_structure(self, snapshot, deploy_cfn_template, aws_client, template_name):
317318
cs_name = f"cs-{short_uid()}"
318319
stack_name = f"stack-{short_uid()}"
319320

320321
with open(
321-
os.path.join(os.path.dirname(__file__), "../../templates/select_issue.yml")
322+
os.path.join(os.path.dirname(__file__), f"../../templates/{template_name}")
322323
) as infile:
323324
template_body = infile.read()
324325

tests/aws/services/cloudformation/test_change_set_fn_get_attr.snapshot.json

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3017,8 +3017,24 @@
30173017
}
30183018
}
30193019
},
3020-
"tests/aws/services/cloudformation/test_change_set_fn_get_attr.py::TestChangeSetFnGetAttr::test_invalid_structure": {
3021-
"recorded-date": "08-10-2025, 12:01:24",
3020+
"tests/aws/services/cloudformation/test_change_set_fn_get_attr.py::TestChangeSetFnGetAttr::test_invalid_structure[getatt_validation.yml]": {
3021+
"recorded-date": "08-10-2025, 12:13:08",
3022+
"recorded-content": {
3023+
"error": {
3024+
"Error": {
3025+
"Code": "ValidationError",
3026+
"Message": "Template error: every Fn::GetAtt object requires two non-empty parameters, the resource name and the resource attribute",
3027+
"Type": "Sender"
3028+
},
3029+
"ResponseMetadata": {
3030+
"HTTPHeaders": {},
3031+
"HTTPStatusCode": 400
3032+
}
3033+
}
3034+
}
3035+
},
3036+
"tests/aws/services/cloudformation/test_change_set_fn_get_attr.py::TestChangeSetFnGetAttr::test_invalid_structure[getatt_validation2.yml]": {
3037+
"recorded-date": "08-10-2025, 12:13:08",
30223038
"recorded-content": {
30233039
"error": {
30243040
"Error": {

tests/aws/services/cloudformation/test_change_set_fn_get_attr.validation.json

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,22 @@
1111
"tests/aws/services/cloudformation/test_change_set_fn_get_attr.py::TestChangeSetFnGetAttr::test_immutable_property_update_causes_resource_replacement": {
1212
"last_validated_date": "2025-04-08T12:17:00+00:00"
1313
},
14-
"tests/aws/services/cloudformation/test_change_set_fn_get_attr.py::TestChangeSetFnGetAttr::test_invalid_structure": {
15-
"last_validated_date": "2025-10-08T12:01:24+00:00",
14+
"tests/aws/services/cloudformation/test_change_set_fn_get_attr.py::TestChangeSetFnGetAttr::test_invalid_structure[getatt_validation.yml]": {
15+
"last_validated_date": "2025-10-08T12:13:08+00:00",
1616
"durations_in_seconds": {
17-
"setup": 0.9,
18-
"call": 0.32,
17+
"setup": 0.96,
18+
"call": 0.31,
1919
"teardown": 0.0,
20-
"total": 1.22
20+
"total": 1.27
21+
}
22+
},
23+
"tests/aws/services/cloudformation/test_change_set_fn_get_attr.py::TestChangeSetFnGetAttr::test_invalid_structure[getatt_validation2.yml]": {
24+
"last_validated_date": "2025-10-08T12:13:08+00:00",
25+
"durations_in_seconds": {
26+
"setup": 0.0,
27+
"call": 0.15,
28+
"teardown": 0.0,
29+
"total": 0.15
2130
}
2231
},
2332
"tests/aws/services/cloudformation/test_change_set_fn_get_attr.py::TestChangeSetFnGetAttr::test_resource_addition": {
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
Parameters:
2+
MyParameterValue:
3+
Type: String
4+
5+
Resources:
6+
MyParameter1:
7+
Type: AWS::SSM::Parameter
8+
Properties:
9+
Type: String
10+
Value: foo
11+
12+
MyParameter2:
13+
Type: AWS::SSM::Parameter
14+
Properties:
15+
Type: String
16+
Value:
17+
Fn::GetAtt:
18+
- MyParameter1

0 commit comments

Comments
 (0)