Skip to content

Commit

Permalink
IPS-1109: Canary deployments (#2520)
Browse files Browse the repository at this point in the history
  • Loading branch information
louiseli1 authored Oct 23, 2024
2 parents 7311f3a + fc8ba60 commit 4ad4e0f
Show file tree
Hide file tree
Showing 4 changed files with 855 additions and 12 deletions.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,3 +120,18 @@ sam deploy --debug --config-file ./samconfig.toml --config-env dev-{{environment
```
sam sync --watch --config-file samconfig.toml --config-env {{environment}} --stack-name core-back-dev-{{environment}} --region eu-west-2
```

## Canaries
When deploying using dev-deploy, the canary deployment strategy which will be used is set in LambdaDeploymentPreference and StepFunctionsDeploymentPreference in template.yaml file.

When deploying using the pipeline, canary deployment strategy set in the pipeline will be used and override the default set in template.yaml.

Canary deployments will cause a rollback if any canary alarms associated with a lambda or step-functions are triggered and a slack notification will be sent to #di-ipv-core-non-prod-alarms or #di-ipv-core-prod-alarms.

To skip canaries such as when releasing urgent changes to production, set the last commit message to contain either of these phrases: [skip canary], [canary skip], or [no canary] as specified in the [Canary Escape Hatch guide](https://govukverify.atlassian.net/wiki/spaces/PLAT/pages/3836051600/Rollback+Recovery+Guidance#Escape-Hatch%3A-how-to-skip-canary-deployments-when-needed).
`git commit -m "some message [skip canary]"`

Note: To update LambdaDeploymentPreference or StepFunctionsDeploymentPreference, update the LambdaCanaryDeployment or StepFunctionsDeploymentPreference pipeline parameter in the [core-common-infra repository](https://github.com/govuk-one-login/ipv-core-common-infra/tree/main/terraform/deployments). To update the LambdaDeploymentPreference or StepFunctionsDeploymentPreference for a stack in dev using sam deploy, parameter override needs to be set in [samconfig.toml](./deploy/samconfig.toml):

`--parameter-overrides LambdaDeploymentPreference=<define-strategy> \`
`--parameter-overrides StepFunctionsDeploymentPreference=<define-strategy> \`
9 changes: 9 additions & 0 deletions deploy/samconfig.toml
Original file line number Diff line number Diff line change
Expand Up @@ -171,3 +171,12 @@ region = "eu-west-2"
capabilities = "CAPABILITY_IAM"
parameter_overrides = "Environment=\"dev-martins\" VpcStackName=\"network-shared-development\""
parallel = "true"

[dev-sre.deploy.parameters]
stack_name = "core-back-dev-sre"
s3_bucket = "aws-sam-cli-managed-default-samclisourcebucket-ec647gpjuo2w"
s3_prefix = "sre-core-back-stack"
region = "eu-west-2"
capabilities = "CAPABILITY_IAM"
parameter_overrides = "Environment=\"dev-sre\" LambdaDeploymentPreference=\"AllAtOnce\" StepFunctionsDeploymentPreference=\"ALL_AT_ONCE\" VpcStackName=\"network-shared-development\""
parallel = "true"
Loading

0 comments on commit 4ad4e0f

Please sign in to comment.