What is the MOST operationally efficient solution that meets this requirement?
Convert the Python script to an AWS Lambda function. Use an Amazon EventBridge (Amazon CloudWatch Events) rule to invoke the function every night.
Convert the Python script to an AWS Lambda function. Use AWS CloudTrail to invoke the function every night.
Deploy the Python script to an Amazon EC2 instance. Use Amazon EventBride (Amazon CloudWatch Events) to schedule the instance to start and stop every night.
Deploy the Python script to an Amazon EC2 instance. Use AWS Systems Manager to schedule the instance to start and stop every night.
Explanations:
Converting the script to an AWS Lambda function is efficient because Lambda is serverless and can be invoked by an EventBridge rule every night without managing infrastructure.
AWS CloudTrail is not used for scheduling or invoking scripts on a time-based schedule. CloudTrail logs events and does not have scheduling capabilities.
Running the script on an EC2 instance is not operationally efficient because it requires managing the instance, and EventBridge can’t directly schedule EC2 start/stop.
Using Systems Manager to schedule an EC2 instance start/stop is cumbersome and requires managing an EC2 instance, which is less efficient than using Lambda.