Open3

CodeDeploy で Lambda の Progressive Delivery

Shunsuke SuzukiShunsuke Suzuki

https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/codedeploy_app

  • Application
  • Deployment Config: デプロイのルール、成功条件、失敗条件
  • Deployment Group
    • 個々のインスタンスのセットです。デプロイグループには、個別にタグ付けされたインスタンス、Amazon EC2 Auto Scaling グループ内の Amazon EC2 インスタンス、またはその両方が含まれます
    • Lambda の場合はないのか?

  • AppSpec
  • Deploy

AppSpec

https://docs.aws.amazon.com/codedeploy/latest/userguide/reference-appspec-file.html
https://docs.aws.amazon.com/ja_jp/codedeploy/latest/userguide/application-specification-files.html

Deploy

https://docs.aws.amazon.com/ja_jp/codedeploy/latest/userguide/deployments-create-lambda-cli.html

https://docs.aws.amazon.com/cli/latest/reference/deploy/create-deployment.html

$ aws deploy create-deployment
Shunsuke SuzukiShunsuke Suzuki

AppSpec

resources:
  - foo:
      type: "AWS::Lambda::Function"
      properties:
        name: foo
        alias: production
        currentversion: 6
        targetversion: 7

The deployment failed because either the target Lambda function foo does not exist or the specified function version or alias cannot be found

alias が存在しないと失敗する