Soru

Zorluk: ZorMethods of Deploying and Operating in AWS

A DevOps team wants to write a shell script to automate the daily starting and stopping of Amazon EC2 instances based on a schedule. The script must parse output in JSON format and run from an administrative machine without requiring a full programming language runtime. Additionally, the team needs to audit who initiated these start/stop actions. Which combination of AWS tool and service best meets these requirements?

  1. A
    AWS Management Console to execute the start/stop actions, and Amazon GuardDuty to audit the API calls
  2. AWS CLI to script the start/stop actions, and AWS CloudTrail to audit the API callsCevap
  3. C
    AWS SDK to script the actions, and Amazon CloudWatch to audit the API calls
  4. D
    AWS Elastic Beanstalk to script the actions, and AWS Systems Manager to audit the API calls

Cevap

AWS CLI to script the start/stop actions, and AWS CloudTrail to audit the API calls
The AWS CLI is the optimal tool for executing administrative commands and shell scripts on AWS resources without the overhead of a full programming language runtime. It native-formats command outputs in JSON, which makes parsing straightforward. AWS CloudTrail is the designated AWS service to monitor, log, and audit account API activity, ensuring the team has visibility into who triggered the start and stop API operations.

Adım Adım Çözüm

1
Determine the interface method that supports shell scripting, outputs JSON, and does not require a programming language runtime.
The AWS Command Line Interface (CLI) is selected because it is executed directly from a terminal/shell script and outputs data in JSON format.
This rules out the AWS Management Console (which is a manual graphical interface) and the AWS SDK (which requires installing and configuring programming runtimes like Python or Node.js).
2
Identify the AWS service responsible for capturing and auditing API calls, specifically to track who initiated the start and stop actions.
AWS CloudTrail is chosen because it records all API calls made in the AWS account, including the user, time, and IP address.
This rules out Amazon CloudWatch (which is for monitoring performance metrics and log aggregation) and Amazon GuardDuty (which is for threat detection).

Anahtar Kavram

Selecting the appropriate AWS interface tool (CLI vs. SDK vs. Console) based on execution requirements, and identifying the correct operational monitoring and auditing service (CloudTrail vs. CloudWatch).

Alternatif Yöntem

While a Python script using the AWS SDK (Boto3) could perform this automation, the team specifically required a solution without a programming language runtime environment. Thus, utilizing the AWS CLI within a shell script is the most direct and lightweight path.
Tahmini Süre:2m 0s
Bu soruyu puanla