ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 205 - DOP-C02 discussion

Report
Export

A DevOps engineer is setting up a container-based architecture. The engineer has decided to use AWS CloudFormation to automatically provision an Amazon ECS cluster and an Amazon EC2 Auto Scaling group to launch the EC2 container instances. After successfully creating the CloudFormation stack, the engineer noticed that, even though the ECS cluster and the EC2 instances were created successfully and the stack finished the creation, the EC2 instances were associating with a different cluster.

How should the DevOps engineer update the CloudFormation template to resolve this issue?

A.
Reference the EC2 instances in the AWS: ECS: Cluster resource and reference the ECS cluster in the AWS: ECS: Service resource.
Answers
A.
Reference the EC2 instances in the AWS: ECS: Cluster resource and reference the ECS cluster in the AWS: ECS: Service resource.
B.
Reference the ECS cluster in the AWS: AutoScaling: LaunchConfiguration resource of the UserData property.
Answers
B.
Reference the ECS cluster in the AWS: AutoScaling: LaunchConfiguration resource of the UserData property.
C.
Reference the ECS cluster in the AWS:EC2: lnstance resource of the UserData property.
Answers
C.
Reference the ECS cluster in the AWS:EC2: lnstance resource of the UserData property.
D.
Reference the ECS cluster in the AWS: CloudFormation: CustomResource resource to trigger an AWS Lambda function that registers the EC2 instances with the appropriate ECS cluster.
Answers
D.
Reference the ECS cluster in the AWS: CloudFormation: CustomResource resource to trigger an AWS Lambda function that registers the EC2 instances with the appropriate ECS cluster.
Suggested answer: B

Explanation:

The UserData property of the AWS: AutoScaling: LaunchConfiguration resource can be used to specify a script that runs when the EC2 instances are launched. This script can include the ECS cluster name as an environment variable for the ECS agent running on the EC2 instances. This way, the EC2 instances will register with the correct ECS cluster. Option A is incorrect because the AWS: ECS: Cluster resource does not have a property to reference the EC2 instances. Option C is incorrect because the EC2 instances are launched by the Auto Scaling group, not by the AWS: EC2: Instance resource. Option D is incorrect because using a custom resource and a Lambda function is unnecessary and overly complex for this scenario.Reference:AWS::AutoScaling::LaunchConfiguration,Amazon ECS Container Agent Configuration

asked 16/09/2024
Tommy Svendsen
37 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first