SOA-C02 exam dumps

SOA-C02 practice question 161 of 341

AWS Certified SysOps Administrator - Associate. Associate level, Amazon Web Services. Free question with the correct answer and a full explanation.

SOA-C02 Question 161

Select 3

You are managing an AWS environment and need to automate the process of stopping EC2 instances that have been running for more than 7 days. You want to implement this solution using AWS native services while ensuring it runs on a daily schedule. Which combination of steps will achieve this?

  1. A

    Create an Amazon EventBridge rule with a cron expression to trigger daily.

  2. B

    Create an AWS Lambda function that identifies EC2 instances running for more than 7 days and stops them.

  3. C

    Use AWS Config to create a custom rule that stops EC2 instances older than 7 days.

  4. D

    Attach the Lambda function to the EventBridge rule as the target.

  5. E

    Use AWS Systems Manager to define a maintenance window that stops EC2 instances older than 7 days.

Show answer and explanation

Correct answers: A, B, D

Explanation

To automate the stopping of EC2 instances running for more than 7 days, you can use Amazon EventBridge to schedule a daily trigger and a Lambda function to perform the logic of identifying and stopping the instances. The EventBridge rule must be configured to invoke the Lambda function as its target. This approach provides a simple and effective solution using AWS native services while adhering to best practices for task scheduling and automation.

  • A. Correct.

    Correct: EventBridge can be used to create rules with cron expressions for scheduled tasks, such as triggering a Lambda function daily.

  • B. Correct.

    Correct: AWS Lambda can execute the logic to identify and stop EC2 instances running for more than 7 days.

  • C. Incorrect.

    Incorrect: AWS Config monitors resource compliance but does not natively stop EC2 instances. It is not suitable for this use case.

  • D. Correct.

    Correct: The Lambda function must be set as the target of the EventBridge rule to execute the stop operation when the rule is triggered.

  • E. Incorrect.

    Incorrect: AWS Systems Manager maintenance windows are for scheduling operational tasks but are not directly linked to this specific automation scenario.

Timed practice exam

Take a SOA-C02 practice test under exam conditions

65 questions in 130 minutes, drawn from this bank, with a score report and a per-question review when you finish.

Start timed exam