A CloudWatch agent on EC2 must use temporary credentials to create streams and publish events in an existing same-account log group, without permission to create groups. Which configurations establish the required access using a new IAM role? (Choose three.)
Choose 3 answers
Show the answer
Correct answersA. Allow logs:CreateLogStream and logs:PutLogEvents on streams in the designated group.B. Attach the role through an instance profile associated with the EC2 instance.D. Allow ec2.amazonaws.com to perform sts:AssumeRole in the role's trust policy.
AWhy this is right: These actions permit stream creation and event ingestion without granting permission to create log groups.
BWhy this is right: An instance profile associates the role with EC2 so the agent can obtain temporary credentials.
CWhy not this: PutMetricData authorizes metric publication, not log-stream creation or log-event ingestion.
DWhy this is right: The EC2 service must be trusted to assume the instance role and provide temporary credentials to the instance.
EWhy not this: The agent signs requests with its instance-role credentials, not as the EC2 service principal.
FWhy not this: The agent runs on EC2; trusting CloudWatch Logs does not establish the required EC2 role assumption.
The EC2 trust relationship and instance profile provide temporary role credentials, while the scoped Logs permissions authorize stream creation and event ingestion. Trusting the CloudWatch Logs service does not let the EC2 instance obtain the role's credentials.