From 7189b9ea9e6a5e77e24964d1ed70f6f63aca135b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 17 Sep 2024 13:43:41 +0000 Subject: [PATCH] Bump package version --- .changeset/happy-badgers-compare.md | 43 --------------------------- CHANGELOG.md | 46 +++++++++++++++++++++++++++++ package.json | 2 +- 3 files changed, 47 insertions(+), 44 deletions(-) delete mode 100644 .changeset/happy-badgers-compare.md diff --git a/.changeset/happy-badgers-compare.md b/.changeset/happy-badgers-compare.md deleted file mode 100644 index 4596a10a93..0000000000 --- a/.changeset/happy-badgers-compare.md +++ /dev/null @@ -1,43 +0,0 @@ ---- -"@guardian/cdk": minor ---- - -feat(experimental-ec2-pattern): Pattern to deploy ASG updates w/CFN - -Included in this update is a new experimental pattern `GuEc2AppExperimental`, which can be used in place of a `GuEc2App`: - -```ts -import { GuEc2AppExperimental } from "@guardian/cdk/lib/experimental/patterns/ec2-app"; -``` - -This pattern will add an [`AutoScalingRollingUpdate` policy](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-updatepolicy.html#cfn-attributes-updatepolicy-rollingupdate) -to the autoscaling group. -This allows application updates to be performed like a standard CloudFormation update, -and using the custom logic provided by Riff-Raff's `autoscaling` deployment type is unnecessary. - -This experimental pattern has few requirements. - -## Add the build number to the application artifact -This change requires versioned artifacts. - -The easiest way to achieve this is by adding the build number to the filename of the artifact: - -```ts -import { UserData } from "aws-cdk-lib/aws-ec2"; -// Use a GitHub Actions provided environment variable -const buildNumber = process.env.GITHUB_RUN_NUMBER ?? "DEV"; - -const userData = UserData.forLinux(); -userData.addCommands(`aws s3 cp s3://dist-bucket/path/to/artifact-${buildNumber}.deb /tmp/artifact.deb`); -userData.addCommands(`dpkg -i /tmp/artifact.dep`); -``` - -## `riff-raff.yaml` -The `riff-raff.yaml` file should remove the `deploy` action of the `autoscaling` deployment type. -Though including it shouldn't break anything, it would result in a longer deployment time as instance will be rotated by both CloudFormation and Riff-Raff's custom logic. - -The `uploadArtifacts` step of the `autoscaling` deployment type should still be included, with the `cloud-formation` deployment type depending on it. -This step uploads the versioned artifact to S3. - -> [!TIP] -> An [auto-generated `riff-raff.yaml` file](https://github.com/guardian/cdk/blob/main/src/riff-raff-yaml-file/README.md) meets this requirement. diff --git a/CHANGELOG.md b/CHANGELOG.md index 9b5a593d5b..bb6f3e7175 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,51 @@ # @guardian/cdk +## 59.5.0 + +### Minor Changes + +- f4e2a7c: feat(experimental-ec2-pattern): Pattern to deploy ASG updates w/CFN + + Included in this update is a new experimental pattern `GuEc2AppExperimental`, which can be used in place of a `GuEc2App`: + + ```ts + import { GuEc2AppExperimental } from "@guardian/cdk/lib/experimental/patterns/ec2-app"; + ``` + + This pattern will add an [`AutoScalingRollingUpdate` policy](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-updatepolicy.html#cfn-attributes-updatepolicy-rollingupdate) + to the autoscaling group. + This allows application updates to be performed like a standard CloudFormation update, + and using the custom logic provided by Riff-Raff's `autoscaling` deployment type is unnecessary. + + This experimental pattern has few requirements. + + ## Add the build number to the application artifact + + This change requires versioned artifacts. + + The easiest way to achieve this is by adding the build number to the filename of the artifact: + + ```ts + import { UserData } from "aws-cdk-lib/aws-ec2"; + // Use a GitHub Actions provided environment variable + const buildNumber = process.env.GITHUB_RUN_NUMBER ?? "DEV"; + + const userData = UserData.forLinux(); + userData.addCommands(`aws s3 cp s3://dist-bucket/path/to/artifact-${buildNumber}.deb /tmp/artifact.deb`); + userData.addCommands(`dpkg -i /tmp/artifact.dep`); + ``` + + ## `riff-raff.yaml` + + The `riff-raff.yaml` file should remove the `deploy` action of the `autoscaling` deployment type. + Though including it shouldn't break anything, it would result in a longer deployment time as instance will be rotated by both CloudFormation and Riff-Raff's custom logic. + + The `uploadArtifacts` step of the `autoscaling` deployment type should still be included, with the `cloud-formation` deployment type depending on it. + This step uploads the versioned artifact to S3. + + > [!TIP] + > An [auto-generated `riff-raff.yaml` file](https://github.com/guardian/cdk/blob/main/src/riff-raff-yaml-file/README.md) meets this requirement. + ## 59.4.0 ### Minor Changes diff --git a/package.json b/package.json index 292fe93ffb..7d17ac8f15 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@guardian/cdk", "description": "Generic Guardian flavoured AWS CDK components", - "version": "59.4.0", + "version": "59.5.0", "main": "lib/index.js", "types": "lib/index.d.ts", "files": [