3.4.5 Deploy Application Versions

Deploy an Application Version by Using Deployment Strategies

Lambda

# Publish new version
aws lambda publish-version --function-name my-func

# Update alias to new version
aws lambda update-alias --function-name my-func \
  --name prod --function-version 6

ECS

# Register new task definition
aws ecs register-task-definition --cli-input-json file://taskdef.json

# Update service
aws ecs update-service --cluster my-cluster \
  --service my-service --task-definition my-app:6

Beanstalk

# Deploy new version
eb deploy

# Deploy specific version
eb deploy --version v1.2.3

CodeDeploy Deployment

aws deploy create-deployment \
  --application-name my-app \
  --deployment-group-name prod \
  --revision revisionType=S3,s3Location={bucket=my-bucket,key=app.zip,bundleType=zip}

Exam Tip: Lambda = publish version + update alias. ECS = new task definition + update service. Beanstalk = eb deploy. CodeDeploy for managed deployments.