Skip to content

Commit 3bf6adb

Browse files
authored
fix(cloudwatch): correct CompositeAlarm.fromCompositeAlarmName ARN format (#24604)
Fixes #24594.
1 parent 428bfc2 commit 3bf6adb

13 files changed

+287
-33
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"version": "31.0.0",
3+
"files": {
4+
"a29bbb21cb63cde6a2d31ed4212e73dab8bfd786cf26aab0156b74490595c0a6": {
5+
"source": {
6+
"path": "CompositeAlarmImportIntegrationTest.template.json",
7+
"packaging": "file"
8+
},
9+
"destinations": {
10+
"current_account-current_region": {
11+
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
12+
"objectKey": "a29bbb21cb63cde6a2d31ed4212e73dab8bfd786cf26aab0156b74490595c0a6.json",
13+
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
14+
}
15+
}
16+
}
17+
},
18+
"dockerImages": {}
19+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
{
2+
"Outputs": {
3+
"AlarmName": {
4+
"Value": "TestAlarm"
5+
},
6+
"AlarmArn": {
7+
"Value": {
8+
"Fn::Join": [
9+
"",
10+
[
11+
"arn:",
12+
{
13+
"Ref": "AWS::Partition"
14+
},
15+
":cloudwatch:",
16+
{
17+
"Ref": "AWS::Region"
18+
},
19+
":",
20+
{
21+
"Ref": "AWS::AccountId"
22+
},
23+
":alarm:TestAlarm"
24+
]
25+
]
26+
}
27+
}
28+
},
29+
"Parameters": {
30+
"BootstrapVersion": {
31+
"Type": "AWS::SSM::Parameter::Value<String>",
32+
"Default": "/cdk-bootstrap/hnb659fds/version",
33+
"Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]"
34+
}
35+
},
36+
"Rules": {
37+
"CheckBootstrapVersion": {
38+
"Assertions": [
39+
{
40+
"Assert": {
41+
"Fn::Not": [
42+
{
43+
"Fn::Contains": [
44+
[
45+
"1",
46+
"2",
47+
"3",
48+
"4",
49+
"5"
50+
],
51+
{
52+
"Ref": "BootstrapVersion"
53+
}
54+
]
55+
}
56+
]
57+
},
58+
"AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI."
59+
}
60+
]
61+
}
62+
}
63+
}

packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch/test/integ.composite-alarm.js.snapshot/CompositeAlarmIntegrationTest.assets.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "30.0.0",
2+
"version": "31.0.0",
33
"files": {
44
"de5a3d0e66f4d4eab13b64e32203fdcae3b36670c889c72a3b4b752e6a5d0fc2": {
55
"source": {
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"version":"30.0.0"}
1+
{"version":"31.0.0"}

packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch/test/integ.composite-alarm.js.snapshot/cdkintegcompositealarmDefaultTestDeployAssertF4EF969E.assets.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "30.0.0",
2+
"version": "31.0.0",
33
"files": {
44
"21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": {
55
"source": {

packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch/test/integ.composite-alarm.js.snapshot/integ.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
{
2-
"version": "30.0.0",
2+
"version": "31.0.0",
33
"testCases": {
44
"cdk-integ-composite-alarm/DefaultTest": {
55
"stacks": [
6-
"CompositeAlarmIntegrationTest"
6+
"CompositeAlarmIntegrationTest",
7+
"CompositeAlarmImportIntegrationTest"
78
],
89
"assertionStack": "cdk-integ-composite-alarm/DefaultTest/DeployAssert",
910
"assertionStackName": "cdkintegcompositealarmDefaultTestDeployAssertF4EF969E"

packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch/test/integ.composite-alarm.js.snapshot/manifest.json

+60-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "30.0.0",
2+
"version": "31.0.0",
33
"artifacts": {
44
"CompositeAlarmIntegrationTest.assets": {
55
"type": "cdk:asset-manifest",
@@ -84,6 +84,65 @@
8484
},
8585
"displayName": "CompositeAlarmIntegrationTest"
8686
},
87+
"CompositeAlarmImportIntegrationTest.assets": {
88+
"type": "cdk:asset-manifest",
89+
"properties": {
90+
"file": "CompositeAlarmImportIntegrationTest.assets.json",
91+
"requiresBootstrapStackVersion": 6,
92+
"bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version"
93+
}
94+
},
95+
"CompositeAlarmImportIntegrationTest": {
96+
"type": "aws:cloudformation:stack",
97+
"environment": "aws://unknown-account/unknown-region",
98+
"properties": {
99+
"templateFile": "CompositeAlarmImportIntegrationTest.template.json",
100+
"validateOnSynth": false,
101+
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}",
102+
"cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}",
103+
"stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/a29bbb21cb63cde6a2d31ed4212e73dab8bfd786cf26aab0156b74490595c0a6.json",
104+
"requiresBootstrapStackVersion": 6,
105+
"bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version",
106+
"additionalDependencies": [
107+
"CompositeAlarmImportIntegrationTest.assets"
108+
],
109+
"lookupRole": {
110+
"arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}",
111+
"requiresBootstrapStackVersion": 8,
112+
"bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version"
113+
}
114+
},
115+
"dependencies": [
116+
"CompositeAlarmImportIntegrationTest.assets"
117+
],
118+
"metadata": {
119+
"/CompositeAlarmImportIntegrationTest/AlarmName": [
120+
{
121+
"type": "aws:cdk:logicalId",
122+
"data": "AlarmName"
123+
}
124+
],
125+
"/CompositeAlarmImportIntegrationTest/AlarmArn": [
126+
{
127+
"type": "aws:cdk:logicalId",
128+
"data": "AlarmArn"
129+
}
130+
],
131+
"/CompositeAlarmImportIntegrationTest/BootstrapVersion": [
132+
{
133+
"type": "aws:cdk:logicalId",
134+
"data": "BootstrapVersion"
135+
}
136+
],
137+
"/CompositeAlarmImportIntegrationTest/CheckBootstrapVersion": [
138+
{
139+
"type": "aws:cdk:logicalId",
140+
"data": "CheckBootstrapVersion"
141+
}
142+
]
143+
},
144+
"displayName": "CompositeAlarmImportIntegrationTest"
145+
},
87146
"cdkintegcompositealarmDefaultTestDeployAssertF4EF969E.assets": {
88147
"type": "cdk:asset-manifest",
89148
"properties": {

0 commit comments

Comments
 (0)