Skip to content

Commit fe0708b

Browse files
feat(synthetics): browser type for canary (#35423)
### Issue # (if applicable) None ### Reason for this change AWS Synthetics now supports for specifying browser type for canary not only Google Chrome but also Mozzila Firefox. https://aws.amazon.com/jp/about-aws/whats-new/2025/09/amazon-cloudwatch-synthetics-adds-multi-browser-support/ ### Description of changes - add `BrowserType` enum - add `BrowserConfigs` prop to `CanaryProps` ### Describe any new or updated permissions being added None ### Description of how you validated changes Add both unit and integ tests ### Checklist - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent 1937ace commit fe0708b

File tree

17 files changed

+1543
-0
lines changed

17 files changed

+1543
-0
lines changed

packages/@aws-cdk-testing/framework-integ/test/aws-synthetics/test/integ.canary-browser-type.js.snapshot/SyntheticsCanaryBrowserTypeDefaultTestDeployAssertA8C77441.assets.json

Lines changed: 20 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-synthetics/test/integ.canary-browser-type.js.snapshot/SyntheticsCanaryBrowserTypeDefaultTestDeployAssertA8C77441.template.json

Lines changed: 36 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-synthetics/test/integ.canary-browser-type.js.snapshot/SyntheticsCanaryBrowserTypeStack.assets.json

Lines changed: 34 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,250 @@
1+
{
2+
"Resources": {
3+
"BrowserTypeCanaryArtifactsBucketB64A2F50": {
4+
"Type": "AWS::S3::Bucket",
5+
"Properties": {
6+
"BucketEncryption": {
7+
"ServerSideEncryptionConfiguration": [
8+
{
9+
"ServerSideEncryptionByDefault": {
10+
"SSEAlgorithm": "aws:kms"
11+
}
12+
}
13+
]
14+
}
15+
},
16+
"UpdateReplacePolicy": "Retain",
17+
"DeletionPolicy": "Retain"
18+
},
19+
"BrowserTypeCanaryArtifactsBucketPolicy99D86AC7": {
20+
"Type": "AWS::S3::BucketPolicy",
21+
"Properties": {
22+
"Bucket": {
23+
"Ref": "BrowserTypeCanaryArtifactsBucketB64A2F50"
24+
},
25+
"PolicyDocument": {
26+
"Statement": [
27+
{
28+
"Action": "s3:*",
29+
"Condition": {
30+
"Bool": {
31+
"aws:SecureTransport": "false"
32+
}
33+
},
34+
"Effect": "Deny",
35+
"Principal": {
36+
"AWS": "*"
37+
},
38+
"Resource": [
39+
{
40+
"Fn::GetAtt": [
41+
"BrowserTypeCanaryArtifactsBucketB64A2F50",
42+
"Arn"
43+
]
44+
},
45+
{
46+
"Fn::Join": [
47+
"",
48+
[
49+
{
50+
"Fn::GetAtt": [
51+
"BrowserTypeCanaryArtifactsBucketB64A2F50",
52+
"Arn"
53+
]
54+
},
55+
"/*"
56+
]
57+
]
58+
}
59+
]
60+
}
61+
],
62+
"Version": "2012-10-17"
63+
}
64+
}
65+
},
66+
"BrowserTypeCanaryServiceRole1136C6CA": {
67+
"Type": "AWS::IAM::Role",
68+
"Properties": {
69+
"AssumeRolePolicyDocument": {
70+
"Statement": [
71+
{
72+
"Action": "sts:AssumeRole",
73+
"Effect": "Allow",
74+
"Principal": {
75+
"Service": "lambda.amazonaws.com"
76+
}
77+
}
78+
],
79+
"Version": "2012-10-17"
80+
},
81+
"Policies": [
82+
{
83+
"PolicyDocument": {
84+
"Statement": [
85+
{
86+
"Action": "s3:ListAllMyBuckets",
87+
"Effect": "Allow",
88+
"Resource": "*"
89+
},
90+
{
91+
"Action": "s3:GetBucketLocation",
92+
"Effect": "Allow",
93+
"Resource": {
94+
"Fn::GetAtt": [
95+
"BrowserTypeCanaryArtifactsBucketB64A2F50",
96+
"Arn"
97+
]
98+
}
99+
},
100+
{
101+
"Action": "s3:PutObject",
102+
"Effect": "Allow",
103+
"Resource": {
104+
"Fn::Join": [
105+
"",
106+
[
107+
{
108+
"Fn::GetAtt": [
109+
"BrowserTypeCanaryArtifactsBucketB64A2F50",
110+
"Arn"
111+
]
112+
},
113+
"/*"
114+
]
115+
]
116+
}
117+
},
118+
{
119+
"Action": "cloudwatch:PutMetricData",
120+
"Condition": {
121+
"StringEquals": {
122+
"cloudwatch:namespace": "CloudWatchSynthetics"
123+
}
124+
},
125+
"Effect": "Allow",
126+
"Resource": "*"
127+
},
128+
{
129+
"Action": [
130+
"logs:CreateLogGroup",
131+
"logs:CreateLogStream",
132+
"logs:PutLogEvents"
133+
],
134+
"Effect": "Allow",
135+
"Resource": {
136+
"Fn::Join": [
137+
"",
138+
[
139+
"arn:",
140+
{
141+
"Ref": "AWS::Partition"
142+
},
143+
":logs:",
144+
{
145+
"Ref": "AWS::Region"
146+
},
147+
":",
148+
{
149+
"Ref": "AWS::AccountId"
150+
},
151+
":log-group:/aws/lambda/cwsyn-*"
152+
]
153+
]
154+
}
155+
}
156+
],
157+
"Version": "2012-10-17"
158+
},
159+
"PolicyName": "canaryPolicy"
160+
}
161+
]
162+
}
163+
},
164+
"BrowserTypeCanary592BB664": {
165+
"Type": "AWS::Synthetics::Canary",
166+
"Properties": {
167+
"ArtifactS3Location": {
168+
"Fn::Join": [
169+
"",
170+
[
171+
"s3://",
172+
{
173+
"Ref": "BrowserTypeCanaryArtifactsBucketB64A2F50"
174+
}
175+
]
176+
]
177+
},
178+
"BrowserConfigs": [
179+
{
180+
"BrowserType": "CHROME"
181+
},
182+
{
183+
"BrowserType": "FIREFOX"
184+
}
185+
],
186+
"Code": {
187+
"Handler": "canary.handler",
188+
"S3Bucket": {
189+
"Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
190+
},
191+
"S3Key": "5178413cfe8db00b2d5dcfa9be417e934c64601d0da3031d88c145c8293bc27f.zip"
192+
},
193+
"ExecutionRoleArn": {
194+
"Fn::GetAtt": [
195+
"BrowserTypeCanaryServiceRole1136C6CA",
196+
"Arn"
197+
]
198+
},
199+
"Name": "syntheticscanar716729",
200+
"RunConfig": {
201+
"MemoryInMB": 2048,
202+
"TimeoutInSeconds": 240
203+
},
204+
"RuntimeVersion": "syn-nodejs-puppeteer-11.0",
205+
"Schedule": {
206+
"DurationInSeconds": "0",
207+
"Expression": "rate(5 minutes)",
208+
"RetryConfig": {
209+
"MaxRetries": 2
210+
}
211+
},
212+
"StartCanaryAfterCreation": true
213+
}
214+
}
215+
},
216+
"Parameters": {
217+
"BootstrapVersion": {
218+
"Type": "AWS::SSM::Parameter::Value<String>",
219+
"Default": "/cdk-bootstrap/hnb659fds/version",
220+
"Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]"
221+
}
222+
},
223+
"Rules": {
224+
"CheckBootstrapVersion": {
225+
"Assertions": [
226+
{
227+
"Assert": {
228+
"Fn::Not": [
229+
{
230+
"Fn::Contains": [
231+
[
232+
"1",
233+
"2",
234+
"3",
235+
"4",
236+
"5"
237+
],
238+
{
239+
"Ref": "BootstrapVersion"
240+
}
241+
]
242+
}
243+
]
244+
},
245+
"AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI."
246+
}
247+
]
248+
}
249+
}
250+
}

0 commit comments

Comments
 (0)