QuestionQ12

Configuration Management and IaC

A DevOps engineer is configuring a container-based architecture. The engineer has chosen AWS CloudFormation to automatically provision an Amazon ECS cluster and an Amazon EC2 Auto Scaling group that launches the EC2 container instances. After the CloudFormation stack was created successfully, the engineer observed that, although the ECS cluster and EC2 instances were created and the stack completed, the EC2 instances were joining a different cluster.

How should the DevOps engineer modify the CloudFormation template to fix this issue?

Explanation

Amazon ECS container instances join the default cluster unless the ECS agent is configured with ECS_CLUSTER in /etc/ecs/ecs.config. For instances launched by an EC2 Auto Scaling group, that configuration must be supplied through the launch configuration’s UserData, referencing the intended ECS cluster. AWS documentation

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!