Data Operations and Support

Auto Scaling EC2 workers in private subnets without internet access launch from an AMI that already includes the CloudWatch agent. They write pipeline logs to local files, and every replacement must ship them automatically with 30-day retention. Which configuration meets these requirements without stored credentials?

Show the answer

Correct answerC. Configure the agent at launch, use an instance role and a Logs interface endpoint, and define log retention in infrastructure as code.

AWhy not this: An S3 gateway endpoint does not provide connectivity to the CloudWatch Logs API.

BWhy not this: Embedded access keys violate the requirement to avoid stored credentials.

CWhy this is right: Launch-time agent configuration, role-based credentials, private Logs connectivity, and managed log-group retention meet all requirements.

DWhy not this: An S3 lifecycle rule does not control retention of events stored in a CloudWatch Logs log group.

Because the AMI already includes the agent, nothing has to be downloaded; launch automation configures it on each replacement worker, an instance role supplies temporary credentials, and a CloudWatch Logs interface endpoint provides private connectivity. An S3 gateway endpoint cannot carry CloudWatch Logs API traffic; retention must be set on the log group.