Skip to content

Commit 3c5b6d9

Browse files
nicoalonsopcplee
andauthored
fix(deps): migrate to stable synthetics (#279)
* fix(deps): upgrade dependencies * fix: Add snapshots --------- Co-authored-by: Casey Lee <[email protected]>
1 parent 8bf6c18 commit 3c5b6d9

20 files changed

+432
-440
lines changed

.projen/deps.json

+3-13
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.projen/tasks.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.projenrc.ts

+3-5
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export class WorkflowDotNetVersionPatch {
2323
);
2424
}
2525
}
26-
const cdkVersion = '2.84.0';
26+
const cdkVersion = '2.99.0';
2727
const project = new CdklabsConstructLibrary({
2828
setNodeEngineVersion: false,
2929
private: false,
@@ -90,9 +90,7 @@ const project = new CdklabsConstructLibrary({
9090
'jmespath',
9191
],
9292
deps: [],
93-
peerDeps: [
94-
`@aws-cdk/aws-synthetics-alpha@^${cdkVersion}-alpha.0`,
95-
],
93+
peerDeps: [],
9694
keywords: [
9795
'aws',
9896
'cdk',
@@ -111,4 +109,4 @@ project.upgradeWorkflow?.postUpgradeTask.spawn(
111109
new WorkflowDotNetVersionPatch(project, { workflow: 'build', jobName: 'package-dotnet', dotNetVersion: '6.x' });
112110
new WorkflowDotNetVersionPatch(project, { workflow: 'release', jobName: 'release_nuget', dotNetVersion: '6.x' });
113111

114-
project.synth();
112+
project.synth();

API.md

+4-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

API.md.md

+4-9
Original file line numberDiff line numberDiff line change
@@ -832,12 +832,12 @@ const apiCanaryProps: ApiCanaryProps = { ... }
832832
| **Name** | **Type** | **Description** |
833833
| --- | --- | --- |
834834
| <code><a href="#@cdklabs/cdk-ecs-codedeploy.ApiCanaryProps.property.baseUrl">baseUrl</a></code> | <code>string</code> | The base URL to use for tests. |
835-
| <code><a href="#@cdklabs/cdk-ecs-codedeploy.ApiCanaryProps.property.artifactsBucketLocation">artifactsBucketLocation</a></code> | <code>@aws-cdk/aws-synthetics-alpha.ArtifactsBucketLocation</code> | The s3 location that stores the data of the canary runs. |
835+
| <code><a href="#@cdklabs/cdk-ecs-codedeploy.ApiCanaryProps.property.artifactsBucketLocation">artifactsBucketLocation</a></code> | <code>aws-cdk-lib.aws-synthetics.ArtifactsBucketLocation</code> | The s3 location that stores the data of the canary runs. |
836836
| <code><a href="#@cdklabs/cdk-ecs-codedeploy.ApiCanaryProps.property.canaryName">canaryName</a></code> | <code>string</code> | The name of the canary. |
837837
| <code><a href="#@cdklabs/cdk-ecs-codedeploy.ApiCanaryProps.property.durationAlarmThreshold">durationAlarmThreshold</a></code> | <code>aws-cdk-lib.Duration</code> | The threshold for triggering an alarm on the test duration. |
838838
| <code><a href="#@cdklabs/cdk-ecs-codedeploy.ApiCanaryProps.property.failureRetentionPeriod">failureRetentionPeriod</a></code> | <code>aws-cdk-lib.Duration</code> | How many days should failed runs be retained. |
839839
| <code><a href="#@cdklabs/cdk-ecs-codedeploy.ApiCanaryProps.property.role">role</a></code> | <code>aws-cdk-lib.aws_iam.IRole</code> | Canary execution role. |
840-
| <code><a href="#@cdklabs/cdk-ecs-codedeploy.ApiCanaryProps.property.schedule">schedule</a></code> | <code>@aws-cdk/aws-synthetics-alpha.Schedule</code> | Specify the schedule for how often the canary runs. |
840+
| <code><a href="#@cdklabs/cdk-ecs-codedeploy.ApiCanaryProps.property.schedule">schedule</a></code> | <code>aws-cdk-lib.aws-synthetics.Schedule</code> | Specify the schedule for how often the canary runs. |
841841
| <code><a href="#@cdklabs/cdk-ecs-codedeploy.ApiCanaryProps.property.securityGroups">securityGroups</a></code> | <code>aws-cdk-lib.aws_ec2.ISecurityGroup[]</code> | The list of security groups to associate with the canary's network interfaces. |
842842
| <code><a href="#@cdklabs/cdk-ecs-codedeploy.ApiCanaryProps.property.startAfterCreation">startAfterCreation</a></code> | <code>boolean</code> | Whether or not the canary should start after creation. |
843843
| <code><a href="#@cdklabs/cdk-ecs-codedeploy.ApiCanaryProps.property.steps">steps</a></code> | <code><a href="#@cdklabs/cdk-ecs-codedeploy.ApiTestStep">ApiTestStep</a>[]</code> | The steps to perform in the synthetic test. |
@@ -867,7 +867,7 @@ The base URL to use for tests.
867867
public readonly artifactsBucketLocation: ArtifactsBucketLocation;
868868
```
869869

870-
- *Type:* @aws-cdk/aws-synthetics-alpha.ArtifactsBucketLocation
870+
- *Type:* aws-cdk-lib.aws-synthetics.ArtifactsBucketLocation
871871
- *Default:* A new s3 bucket will be created without a prefix.
872872

873873
The s3 location that stores the data of the canary runs.
@@ -949,7 +949,7 @@ If you provide a Role, you must add the required permissions.
949949
public readonly schedule: Schedule;
950950
```
951951

952-
- *Type:* @aws-cdk/aws-synthetics-alpha.Schedule
952+
- *Type:* aws-cdk-lib.aws-synthetics.Schedule
953953
- *Default:* 'rate(5 minutes)'
954954

955955
Specify the schedule for how often the canary runs.
@@ -2294,8 +2294,3 @@ public toString(): string
22942294
```
22952295

22962296
Render JSON string for this AppSpec to be used.
2297-
2298-
2299-
2300-
2301-

package.json

+2-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/api-canary/index.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import * as path from 'path';
2-
import { Canary, ArtifactsBucketLocation, Schedule, Test, Code, Runtime } from '@aws-cdk/aws-synthetics-alpha';
32
import { Duration, DockerImage, Lazy } from 'aws-cdk-lib';
43
import { Alarm, ComparisonOperator } from 'aws-cdk-lib/aws-cloudwatch';
54
import { IVpc, SubnetSelection, ISecurityGroup } from 'aws-cdk-lib/aws-ec2';
65
import { IRole } from 'aws-cdk-lib/aws-iam';
76
import { BlockPublicAccess, Bucket, BucketEncryption } from 'aws-cdk-lib/aws-s3';
87
import { Asset } from 'aws-cdk-lib/aws-s3-assets';
8+
import { Canary, ArtifactsBucketLocation, Schedule, Test, Code, Runtime } from 'aws-cdk-lib/aws-synthetics';
99
import { Construct } from 'constructs';
1010
import { CanaryCodeBundler } from './code-bundling';
1111

@@ -263,4 +263,4 @@ export class ApiCanary extends Canary {
263263
addTestStep(step: ApiTestStep) {
264264
this._steps.push(step);
265265
}
266-
}
266+
}

src/ecs-patterns/application-load-balanced-codedeployed-fargate-service.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import { Schedule } from '@aws-cdk/aws-synthetics-alpha';
21
import { Duration } from 'aws-cdk-lib';
32
import { Alarm, AlarmRule, ComparisonOperator, CompositeAlarm, IAlarm } from 'aws-cdk-lib/aws-cloudwatch';
43
import { EcsApplication, EcsDeploymentConfig, EcsDeploymentGroup, IEcsDeploymentConfig } from 'aws-cdk-lib/aws-codedeploy';
54
import { BaseService, DeploymentControllerType } from 'aws-cdk-lib/aws-ecs';
65
import { ApplicationLoadBalancedFargateService, ApplicationLoadBalancedFargateServiceProps } from 'aws-cdk-lib/aws-ecs-patterns';
76
import { ApplicationListener, ApplicationProtocol, ApplicationTargetGroup, HealthCheck, TargetType } from 'aws-cdk-lib/aws-elasticloadbalancingv2';
87
import { BlockPublicAccess, Bucket, BucketEncryption, IBucket } from 'aws-cdk-lib/aws-s3';
8+
import { Schedule } from 'aws-cdk-lib/aws-synthetics';
99
import { Construct } from 'constructs';
1010
import { ApiTestStep, ApiCanary } from '../api-canary';
1111
import { AppSpecHooks } from '../ecs-appspec';

test/api-canary.integ.snapshot/TestStack.assets.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "32.0.0",
2+
"version": "34.0.0",
33
"files": {
44
"93db9dcabf8af9cc80ac1a58b535f16939207937839bf12b4db178e54a4bb659": {
55
"source": {
@@ -14,15 +14,15 @@
1414
}
1515
}
1616
},
17-
"c6e791c2d86fda8742bba34c487f10342147c3562dd4f75a4f498a799ba87f69": {
17+
"d428f5016b7e6efee91ad9984c36717dc703b4b47ff3843a0b4b2a800ec16e01": {
1818
"source": {
1919
"path": "TestStack.template.json",
2020
"packaging": "file"
2121
},
2222
"destinations": {
2323
"current_account-current_region": {
2424
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
25-
"objectKey": "c6e791c2d86fda8742bba34c487f10342147c3562dd4f75a4f498a799ba87f69.json",
25+
"objectKey": "d428f5016b7e6efee91ad9984c36717dc703b4b47ff3843a0b4b2a800ec16e01.json",
2626
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
2727
}
2828
}

test/api-canary.integ.snapshot/TestStack.template.json

+7-7
Original file line numberDiff line numberDiff line change
@@ -222,26 +222,25 @@
222222
]
223223
},
224224
"Name": "teststacksynthe589c28",
225-
"RuntimeVersion": "syn-nodejs-puppeteer-4.0",
226-
"Schedule": {
227-
"DurationInSeconds": "0",
228-
"Expression": "rate(5 minutes)"
229-
},
230225
"RunConfig": {
231226
"EnvironmentVariables": {
232227
"baseUrl": "https://xkcd.com",
233228
"threadCount": "5",
234229
"testSteps": "[{\"name\":\"info\",\"path\":\"/614/info.0.json\",\"jmesPath\":\"safe_title\",\"expectedValue\":\"Woodpecker\"}]"
235230
}
236231
},
232+
"RuntimeVersion": "syn-nodejs-puppeteer-4.0",
233+
"Schedule": {
234+
"DurationInSeconds": "0",
235+
"Expression": "rate(5 minutes)"
236+
},
237237
"StartCanaryAfterCreation": true
238238
}
239239
},
240240
"SyntheticTestSuccessAlarm4480389E": {
241241
"Type": "AWS::CloudWatch::Alarm",
242242
"Properties": {
243243
"ComparisonOperator": "LessThanThreshold",
244-
"EvaluationPeriods": 2,
245244
"Dimensions": [
246245
{
247246
"Name": "CanaryName",
@@ -250,6 +249,7 @@
250249
}
251250
}
252251
],
252+
"EvaluationPeriods": 2,
253253
"MetricName": "SuccessPercent",
254254
"Namespace": "CloudWatchSynthetics",
255255
"Period": 300,
@@ -261,7 +261,6 @@
261261
"Type": "AWS::CloudWatch::Alarm",
262262
"Properties": {
263263
"ComparisonOperator": "GreaterThanThreshold",
264-
"EvaluationPeriods": 2,
265264
"Dimensions": [
266265
{
267266
"Name": "CanaryName",
@@ -270,6 +269,7 @@
270269
}
271270
}
272271
],
272+
"EvaluationPeriods": 2,
273273
"MetricName": "Duration",
274274
"Namespace": "CloudWatchSynthetics",
275275
"Period": 300,

0 commit comments

Comments
 (0)