Question 228:
You are a DevOps engineer in a company whose data analysis department is planning to benefit from CloudWatch Logs to troubleshoot some business use cases by exploring the content in all container logs. How is it possible to automate a pipeline for analysis in this context?
Answer options:
A.You create an IAM policy to allow your container instances to use the CloudWatch Logs APIs, and then you must attach that policy to ecsInstanceRole. Then, you install the CloudWatch agent on your container instances. You only can use the Fargate launch type to view the logs from your containers. You only can use Amazon ECS-optimized AMI to get the Amazon ECS container agent by updating the ecs-init package. B.You create an IAM policy to allow your container instances to use the CloudWatch Logs APIs, and then you must attach that policy to ecsInstanceRole. Then, you install the CloudWatch agent on your container instances. On the Fargate launch type, you view the logs from your containers. On the EC2 launch type, you get different logs from your containers in one convenient location. If you are not using the Amazon ECS-optimized AMI, you will have to edit the /etc/ecs/ecs.config file and add ECS_AVAILABLE_LOGGING_DRIVERS=["json-file","awslogs"] to specify that the awslogs logging driver is available on the container instance. C.You create an IAM policy to allow your container instances to use the CloudWatch Logs APIs, and then you must attach that policy to ecsInstanceRole. Then, you install the CloudWatch agent on your container instances. You only can use EC2 launch type to view the logs from your containers. If you are not using the Amazon ECS-optimized AMI, you will have to edit the /etc/ecs/ecs.config file and add ECS_AVAILABLE_LOGGING_DRIVERS=["json-file","awslogs"] to specify that the awslogs logging driver is available on the container instance. D.You create an IAM policy to allow your container instances to use the CloudWatch Logs APIs, and then you must attach that policy to ecsInstanceRole. Then, you install the CloudWatch agent on your container instances. On the Fargate launch type, you view the logs from your containers. On the EC2 launch type, you get different logs from your containers in one convenient location, and it prevents your container logs from taking up disk space on your container instances. You only can use Amazon ECS-optimized AMI to get the Amazon ECS container agent by updating the ecs-init package.