Question #815
A developer is migrating an application to AWS Fargate. The developer containerizes the application and stores the image in Amazon Elastic Container Registry (ECR). As part of updating the application to use a new configuration, the developer modifies environment variables in the task definition to point to a new backend service. The developer builds a new Docker image with the updated configuration, tags it as 'v2', and pushes it to ECR. The CI/CD pipeline executes successfully, but the application continues to use the old backend service.
What is the most likely reason the application is not using the new configuration?
The developer did not push the new Docker image to Amazon ECR.
The developer did not update the task definition to use the new Docker image tag.
The developer used an incorrect IAM role for the Fargate service.
The developer did not create a new Fargate service.
Explanation
The correct answer is B. AWS Fargate uses the task definition to specify which Docker image (including its tag) to deploy. Even though the developer pushed the 'v2' image to ECR, Fargate will continue using the old image unless the task definition is explicitly updated to reference the new tag. The CI/CD pipeline might have updated the image but failed to update the task definition's image URI/tag, causing Fargate to reuse the previous configuration.
Why other options are incorrect:
- A: The CI/CD pipeline executed successfully, implying the image was pushed to ECR.
- C: An incorrect IAM role would cause permission errors, not configuration mismatches.
- D: A new Fargate service isn't required; updating the existing service's task definition suffices.
Key Takeaway: Always update the task definition's image reference when deploying new container versions in Fargate.
Answer
The correct answer is: B