A SysOps Administrator is tasked with enabling Amazon CloudWatch Container Insights for an existing Amazon ECS cluster that runs tasks on both Amazon EC2 and AWS Fargate. The Administrator must also ensure that any new ECS clusters created in the account in the future will automatically have Container Insights enabled.
Which of the following actions should the Administrator take to meet these requirements? (Select TWO.)
- Run the aws ecs update-cluster-settings command, specifying the cluster name and setting containerInsights to enabled.Answer
- Run the aws ecs put-account-setting-default command, setting the name parameter to containerInsights and the value to enabled.Answer
- CDeploy the Amazon CloudWatch agent as an Amazon ECS daemon service on the EC2 instances in the cluster.
- DConfigure the Amazon ECS container agent on the EC2 instances by setting the ECS_ENABLE_CONTAINER_METRICS environment variable to true in the ecs.config file.
- EUpdate the task definitions of the services to include the containerInsights parameter set to true within the container definitions.
Answer
Run the aws ecs update-cluster-settings command to enable Container Insights on the existing cluster, and run the aws ecs put-account-setting-default command to enable it by default for any new clusters.
To enable Container Insights on an existing cluster, the update-cluster-settings command with the containerInsights setting set to enabled must be executed. To ensure that newly created clusters inherit this setting automatically, the put-account-setting-default command should be used with the containerInsights setting set to enabled.
Step-by-Step Solution
Key Concept
Configuring Container Insights for Amazon ECS at both the cluster-specific and account-default levels.