Skip to content

Commit

Permalink
Merge branch 'master' into blue-green
Browse files Browse the repository at this point in the history
  • Loading branch information
72636c committed Jan 7, 2024
2 parents cd102a5 + 269a2f3 commit c823763
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/large-singers-argue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'skuba': patch
---

template/lambda-sqs-worker-cdk: Switch to `aws-cdk-lib/assertions`
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,13 @@ exports[`returns expected CloudFormation stack for dev 1`] = `
},
},
},
"Parameters": {
"BootstrapVersion": {
"Default": "/cdk-bootstrap/hnb659fds/version",
"Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]",
"Type": "AWS::SSM::Parameter::Value<String>",
},
},
"Resources": {
"codedeployalarm9F48D05F": {
"Properties": {
Expand Down Expand Up @@ -934,6 +941,33 @@ exports[`returns expected CloudFormation stack for dev 1`] = `
"UpdateReplacePolicy": "Delete",
},
},
"Rules": {
"CheckBootstrapVersion": {
"Assertions": [
{
"Assert": {
"Fn::Not": [
{
"Fn::Contains": [
[
"1",
"2",
"3",
"4",
"5",
],
{
"Ref": "BootstrapVersion",
},
],
},
],
},
"AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI.",
},
],
},
},
}
`;

Expand Down Expand Up @@ -1048,6 +1082,13 @@ exports[`returns expected CloudFormation stack for prod 1`] = `
},
},
},
"Parameters": {
"BootstrapVersion": {
"Default": "/cdk-bootstrap/hnb659fds/version",
"Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]",
"Type": "AWS::SSM::Parameter::Value<String>",
},
},
"Resources": {
"codedeployalarm9F48D05F": {
"Properties": {
Expand Down Expand Up @@ -1871,5 +1912,32 @@ exports[`returns expected CloudFormation stack for prod 1`] = `
"UpdateReplacePolicy": "Delete",
},
},
"Rules": {
"CheckBootstrapVersion": {
"Assertions": [
{
"Assert": {
"Fn::Not": [
{
"Fn::Contains": [
[
"1",
"2",
"3",
"4",
"5",
],
{
"Ref": "BootstrapVersion",
},
],
},
],
},
"AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI.",
},
],
},
},
}
`;
6 changes: 4 additions & 2 deletions template/lambda-sqs-worker-cdk/infra/appStack.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { SynthUtils } from '@aws-cdk/assert';
import { App } from 'aws-cdk-lib';
import { Template } from 'aws-cdk-lib/assertions';

import cdkJson from '../cdk.json';

Expand Down Expand Up @@ -38,7 +38,9 @@ it.each(contexts)(

const stack = new AppStack(app, 'appStack');

const json = JSON.stringify(SynthUtils.toCloudFormation(stack)).replace(
const template = Template.fromStack(stack);

const json = JSON.stringify(template.toJSON()).replace(
/"S3Key":"([0-9a-f]+)\.zip"/g,
(_, hash) => `"S3Key":"${'x'.repeat(hash.length)}.zip"`,
);
Expand Down
1 change: 0 additions & 1 deletion template/lambda-sqs-worker-cdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
"zod": "^3.19.1"
},
"devDependencies": {
"@aws-cdk/assert": "^2.24.0",
"@types/aws-lambda": "^8.10.82",
"@types/node": "^20.9.0",
"aws-cdk": "^2.109.0",
Expand Down

0 comments on commit c823763

Please sign in to comment.