exam questions

Exam AWS Certified Solutions Architect - Professional All Questions

View all questions & answers for the AWS Certified Solutions Architect - Professional exam

Exam AWS Certified Solutions Architect - Professional topic 1 question 393 discussion

An AWS account owner has setup multiple IAM users. One of these IAM users, named John, has CloudWatch access, but no access to EC2 services. John has setup an alarm action which stops EC2 instances when their CPU utilization is below the threshold limit.
When an EC2 instance's CPU Utilization rate drops below the threshold John has set, what will happen and why?

  • A. CloudWatch will stop the instance when the action is executed
  • B. Nothing will happen. John cannot set an alarm on EC2 since he does not have the permission.
  • C. Nothing will happen. John can setup the action, but it will not be executed because he does not have EC2 access through IAM policies.
  • D. Nothing will happen because it is not possible to stop the instance using the CloudWatch alarm
Show Suggested Answer Hide Answer
Suggested Answer: C 🗳️
Amazon CloudWatch alarms watch a single metric over a time period that the user specifies and performs one or more actions based on the value of the metric relative to a given threshold over a number of time periods. The user can setup an action which stops the instances when their CPU utilization is below a certain threshold for a certain period of time. The EC2 action can either terminate or stop the instance as part of the EC2 action. If the IAM user has read/write permissions for Amazon CloudWatch but not for Amazon EC2, he can still create an alarm.
However, the stop or terminate actions will not be performed on the Amazon EC2 instance.
Reference:
http://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/UsingAlarmActions.html

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
chrisyod
Highly Voted 3 years, 6 months ago
answer is A https://aws.amazon.com/fr/about-aws/whats-new/2017/12/amazon-cloudwatch-now-supports-service-linked-roles-for-ec2-actions-in-alarms/
upvoted 13 times
...
Desailly
Highly Voted 3 years, 6 months ago
A is correct (checked directly in the AWS console) EC2 action - Terminate You will not be able to terminate this instance if termination protection is enabled. AWS will use the existing Service Linked Role (AWSServiceRoleForCloudWatchEvents) to perform this action. Show IAM policy document Linked role can do following with EC2 { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "cloudwatch:DescribeAlarms", "ec2:DescribeInstanceStatus", "ec2:DescribeInstances", "ec2:DescribeSnapshots", "ec2:DescribeVolumeStatus", "ec2:DescribeVolumes", "ec2:RebootInstances", "ec2:StopInstances", "ec2:TerminateInstances", "ec2:CreateSnapshot" ], "Resource": "*" } ] }
upvoted 7 times
nano2nd
2 years, 7 months ago
I tested it too, A is correct, if the user "john" has the "CloudWatchFullAccess" policy then they don't need the linked role either, confirmed here and in my testing: "To be able to start using service-linked role with CloudWatch Alarms, new permissions are required when calling PutMetricAlarm API. If your IAM users or roles are using CloudWatchFullAccess managed policy, no action is required at your end."
upvoted 1 times
...
...
Jayapriya
Most Recent 2 years, 6 months ago
Answer is A. The service role for CWevents is assumed and the action (terminate) is executed.
upvoted 1 times
...
Dionenonly
2 years, 6 months ago
Selected Answer: A
A is the right answer
upvoted 1 times
...
jujumomma
2 years, 7 months ago
answer is C "To set up a CloudWatch alarm action that can reboot, stop, or terminate an instance, you must use a service-linked IAM role, AWSServiceRoleForCloudWatchEvents. The AWSServiceRoleForCloudWatchEvents IAM role enables AWS to perform alarm actions on your behalf." https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/UsingAlarmActions.html
upvoted 1 times
...
rogan1821
3 years, 4 months ago
Selected Answer: A
i will go A
upvoted 1 times
...
wahlbergusa
3 years, 4 months ago
Question has too much ambiguity. From => https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/UsingAlarmActions.html "Permissions : If you are using an AWS Identity and Access Management (IAM) account to create or modify an alarm that performs EC2 actions or Systems Manager OpsItem actions, you must have the iam:CreateServiceLinkedRole permission." So we do not know if John has the following policy. If not then this cannot work and C would be the correct answer.
upvoted 6 times
...
cldy
3 years, 4 months ago
A. CloudWatch will stop the instance when the action is executed
upvoted 2 times
...
backfringe
3 years, 5 months ago
I'd go with C as the user doesn't have permissions on ec2
upvoted 2 times
...
WillCloud
3 years, 5 months ago
A. 1. https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/UsingAlarmActions.html#AddingStopActions. 2. https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/using-service-linked-roles.html Creating a service-linked role for CloudWatch You do not need to manually create any of these service-linked roles. The first time you create an alarm in the AWS Management Console, the IAM CLI, or the IAM API, CloudWatch creates AWSServiceRoleForCloudWatchEvents and AWSServiceRoleForCloudWatchAlarms_ActionSSM for you. The first time When you first enable an account to be a monitoring account for cross-account cross-Region functionality, CloudWatch creates AWSServiceRoleForCloudWatchCrossAccount for you.
upvoted 3 times
...
DerekKey
3 years, 5 months ago
A - user has already created an alarm (user has iam:CreateServiceLinkedRole permission)
upvoted 2 times
...
Shran
3 years, 6 months ago
Right answer should be C. This is tested as-well in an account.
upvoted 2 times
...
XAvenger
3 years, 6 months ago
Just tested in my account. Launced EC2 instance. Created test user with CloudWatchFullAccess policy only. Logged in using test user credentials. User is able to create the alarm with action to stop the EC2 instance by CPUUtilizationMetric. During Alarm creation you can manually enter EC2 instance id. (where we take instance is - this is another question) In 5 minutes instance is stopped. sarah_t was right: the only thing is needed is to have permission to create a service-linked role (that is included in CloudWatchFullAccess) Please try yourself who has AWS accounts. You will be surprised
upvoted 6 times
XAvenger
3 years, 6 months ago
It seems to me that "A" answer is correct
upvoted 2 times
vinodhg
3 years, 6 months ago
Nowhere in question, it is mentioned that John has Cloudwatch Full access. Since John doesn't have Cloudwatch full access the answer is C.
upvoted 1 times
...
...
...
SomboonCH
3 years, 7 months ago
Answer is C Testing in my account, the alarm can created, but Insufficient data state due to no EC2 permission.
upvoted 2 times
...
bhupesh
3 years, 7 months ago
As per this link https://aws.amazon.com/premiumsupport/knowledge-center/automatic-recovery-ec2-cloudwatch/ one cannot setup alarm if one doesn't have permission on that EC2 instance
upvoted 2 times
...
sarah_t
3 years, 7 months ago
A - john only needs to have the permission to create a service-linked role.
upvoted 4 times
...
Amitv2706
3 years, 7 months ago
answer is C Example : https://aws.amazon.com/premiumsupport/knowledge-center/automatic-recovery-ec2-cloudwatch/
upvoted 2 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago