AWS Certified Developer – Associate (DVA-C02)DeploymentHard
A company is using AWS CodePipeline to deploy its microservices to Amazon ECS. Each microservice has its own CodePipeline. When a new Docker image is pushed to Amazon ECR, the corresponding CodePipeline should automatically detect the new image and update the ECS service. Which action type should be used in CodePipeline to achieve this automatic update of the ECS service with the new image?
- AAWS CloudFormation action to update the ECS service task definition.
- BAWS Lambda action that triggers a custom script to update the ECS service.
- CAmazon ECS (UpdateService) action to update the service's task definition with the new image.
- DAWS CodeDeploy action to perform a blue/green deployment on ECS.
Show answer & explanationAnswer & explanation
Correct answer: C. Amazon ECS (UpdateService) action to update the service's task definition with the new image.
The native Amazon ECS (UpdateService) action in CodePipeline is specifically designed to automatically update an existing ECS service. When configured, it detects the new image URI from the pipeline's artifact (provided by the ECR source action) and updates the ECS service's task definition to use that new image, triggering a new deployment.
Why the other options are wrong
- A. While CloudFormation *can* update ECS services, it's more complex for simple image updates, and a native ECS action exists.
- B. Using a Lambda action for this common task is over-engineering, as CodePipeline provides a native action.
- D. CodeDeploy can be used for blue/green ECS deployments, but the core mechanism for just updating the image reference is the ECS action.
CodePipeline ECS Image Update
The Amazon ECS (UpdateService) action in AWS CodePipeline automates updating an ECS service's task definition with a new Docker image, facilitating continuous deployment for containerized applications.
- Native CodePipeline action for ECS service updates.
- Automatically uses new image URI from pipeline artifacts.
- Triggers a new deployment for the ECS service.
Memory trick: ECS UpdateService action is the direct switch for new images.