Which solution will meet this requirement?

A company has multiple Amazon EC2 instances that run a resource-intensive application in a

development environment. A SysOps administrator is implementing a solution to stop these EC2 instances when they are not in use.

Which solution will meet this requirement?
A . Assess AWS CloudTrail logs to verify that there is no EC2 API activity. Invoke an AWS Lambda function to stop the EC2 instances.
B . Create an Amazon CloudWatch alarm to stop the EC2 instances when the average CPU utilization is lower than 5% for a 30-minute period.
C . Create an Amazon CloudWatch metric to stop the EC2 instances when the VolumeReadBytes metric is lower than 500 for a 30-minute period.
D . Use AWS Config to invoke an AWS Lambda function to stop the EC2 instances based on resource configuration changes.

Answer: C

Explanation:

To stop EC2 instances in a development environment when they are not in use, you can create a CloudWatch alarm based on CPU utilization.

Create CloudWatch Alarm:

Navigate to the CloudWatch console.

Select "Alarms" and click on "Create Alarm".

Choose the EC2 instance metric for CPU utilization.

Set the condition to trigger the alarm when the average CPU utilization is less than 5% for a continuous 30-minute period.

Reference: Creating Amazon CloudWatch Alarms

Configure Alarm Actions:

In the actions section of the alarm creation, specify the action to stop the instance.

This can be done by creating an alarm action that uses an AWS Lambda function or directly through EC2 actions.

Example using Lambda:

def lambda_handler(event, context):

ec2 = boto3.client(‘ec2’)

response = ec2.stop_instances(

InstanceIds=[

‘instance-id’

]

)

return response

Reference: Using Amazon CloudWatch Alarms

By setting up this CloudWatch alarm, the EC2 instances will automatically stop when they are not being utilized, reducing costs in the development environment.

Latest SOA-C02 Dumps Valid Version with 54 Q&As

Latest And Valid Q&A | Instant Download | Once Fail, Full Refund

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments