CircleCI-Public / aws-ecs-orb

An orb that simplifies deployment to Amazon's Elastic Container Service (ECS). Supports both EC2 and Fargate launch types.
https://circleci.com/orbs/registry/orb/circleci/aws-ecs
MIT License
51 stars 80 forks source link

Add 'Deployment configuration' parameter for Blue/Green Deployment #159

Closed geoL86 closed 2 years ago

geoL86 commented 2 years ago

Describe Request:

Add additional optional parameter 'Deployment configuration' for 'update-service' and 'deploy-service-update' jobs.

Examples:

xxx-xxx:
    executor: aws-cli/default
    resource_class: small
    steps:
      - aws-ecs/update-service:
          family: 'xxx'
          cluster-name: 'xxx'
          service-name: 'xxx'
          codedeploy-application-name: 'xxx'
          codedeploy-deployment-group-name: 'xxx'
          deployment-controller: 'CODE_DEPLOY'
        + deployment-configuration: 'xxx'
          codedeploy-load-balanced-container-name: 'nginx'
          codedeploy-load-balanced-container-port: 80
          container-image-name-updates: 'container=xxx,tag=xxx'

Supporting Documentation Links:

https://docs.aws.amazon.com/cli/latest/reference/ecs/update-service.html

brivu commented 2 years ago

Hey @geoL86,

I've read the documentation but am still a little unclear about what you're looking to accomplish.

What would be the value of the deployment-configuration parameter and how would it tie into the aws deploy create-deployment cli command or the aws ecs update-service command?

I'm just trying to understand the goal of this parameter so I can go ahead and implement it.

Let me know! Brian

geoL86 commented 2 years ago

Hi @brivu,

Sorry for delay, deployment-configuration option allows us to select different deployment configurations for the same application. Fox example we can predefine 3 canary deployment configurations with the same traffic shifting in % but with different time options(M - minutes, P - percent): Canary10M50P, Canary30M50P, Canary60M50P

Then we creat application with deployment configuration by default - Canary10M50P. And use this Bleu/Green deployment for our development or staging environments. But when we are going to deploy our code to prod we want to test app longer than 10 minutes that's why we need to override default deployment configuration with another one: Canary60M50P

This orbs parameter can be optional - in this case new deployment will use deployment configuration by default.

AWS API and UI already support this option.

brivu commented 2 years ago

Hey @geoL86,

According to the AWS Documentation that you sent me, the --deployment-configuration can be passed in with shorthand syntax like below:

deploymentCircuitBreaker={enable=boolean,rollback=boolean},maximumPercent=integer,minimumHealthyPercent=integer

Let me know if that's what you had in mind. I'll go ahead and work on adding this parameter for an upcoming release.

Thank you! Best, Brian

brivu commented 2 years ago

Hey @geoL86,

I took a deeper look and realized that you wanted to add this parameter to Blue/Green Deployments with the update-service command. In order to do so, the command used with Blue/Green is aws deploy create-deployment but the article that you sent uses the aws ecs update-service command.

I'm assuming you'd like to use the aws deploy command with the --deployment-config-name parameter where the name of a predefined deployment configuration is passed in.

Let me know if that sounds right for you!

Best, Brian

geoL86 commented 2 years ago

Hi @brivu ,

Yes, it is exactly what I described. Is already merged ... awesome...

Thanks