Codefresh Steps: Reusable Code for Common Operations
This page provides code you can use to perform common operations in the Codefresh CI/CD platform.
ecs-bluegreen-deploy ecs-bluegreen-deploy
Updates an AWS ECS Service with a new image, and then deploys it with AWS CodeDeploy. Works with all deployment configurations, including AllAtOnce, Linear, and Canary. Authenticate with either an IAM role from your EKS cluster, or with a simple Access Key ID+Token.
arguments
deploy_to_ecs:
type: ecs-bluegreen-deploy
arguments:
AWS_DEFAULT_REGION: '${{AWS_DEFAULT_REGION}}'
AWS_ACCESS_KEY_ID: '${{AWS_ACCESS_KEY_ID}}'
AWS_SECRET_ACCESS_KEY: '${{AWS_SECRET_ACCESS_KEY}}'
CLUSTER_NAME: MY_ECS_CLUSTER
SERVICE_NAME: MY_ECS_SERVICE
IMAGE: 'IMAGE:TAG'
CODEDEPLOY_APPLICATION: 'AppECS-${CLUSTER_NAME}-${SERVICE_NAME}'
CODEDEPLOY_DEPLOYMENT_GROUP: 'DgpECS-${CLUSTER_NAME}-${SERVICE_NAME}'
MAX_WAIT_TIME: 60
deploy_to_ecs_with_role:
type: ecs-bluegreen-deploy
arguments:
AWS_DEFAULT_REGION: '${{AWS_DEFAULT_REGION}}'
AWS_ASSUME_ROLE: '${{AWS_ACCESS_ROLE_ARN}}'
CLUSTER_NAME: MY_ECS_CLUSTER
SERVICE_NAME: MY_ECS_SERVICE
IMAGE: 'IMAGE:TAG'
CODEDEPLOY_APPLICATION: 'AppECS-${CLUSTER_NAME}-${SERVICE_NAME}'
CODEDEPLOY_DEPLOYMENT_GROUP: 'DgpECS-${CLUSTER_NAME}-${SERVICE_NAME}'
MAX_WAIT_TIME: 60