Question 415:
As a DevOps engineer, you are helping the development team to set up a CI/CD pipeline. The new application should be deployed in an ECS cluster with a CloudFormation stack. In the CloudFormation YAML file, you need to include AWS resources of an ECS Cluster, a Launch template, an Auto Scaling group and so on. The Auto Scaling group instances should be registered in the ECS Cluster.How would you configure the ASG in the CloudFormation template?
Answer options:
A.Use the ECS Fargate resource in CloudFormation to register the ASG instances automatically with the ECS Cluster.
B.In the Auto Scaling group resource, add the ECS Cluster property (ECS_CLUSTER: ${ECSCluster})to register the ASG with the ECS Cluster.
C.In the Launch template Metadata, add the ECS_CLUSTER environment parameter in the /etc/ecs/ecs.config file to register the instances.
D.In the Auto Scaling group resource, add the property of “DependsOn: ECSCluster” to associate the ASG with the ECS Cluster.