A Python reporting job runs unattended every night. Inside its own logic it needs to list objects in an S3 bucket, read a few of them, and write a summary object back, handling failures with the program's existing retry and logging code. What is the appropriate way for that program to call AWS?

AWS Certified Cloud Practitioner (CLF-C02), objective 3. Cloud technology and services medium

Machine-checked — no person has signed for it. This question was read against the source cited below by an automated pass, which found no contradiction. That is a weaker claim than it sounds: the same kind of process wrote the question, so it can confirm its own mistake.

Treat it as a good draft rather than as settled fact, and read the source below before you rely on it. It is not used in mock exams here — only questions a person has signed for are.

The options

Correct The AWS SDK for Python, called directly from the program

Correct. An SDK exposes the same AWS API as native calls, objects and exceptions in the language the program is already written in, so failures arrive as errors the existing handling can catch.

Not correct Shell out to the AWS CLI and parse its output

Wrong, though it does work and people do it. You end up parsing output shaped for a human, you lose typed errors, and you have added a separate binary that must be installed and kept in step. The CLI is for the shell and for scripts, not for the inside of an application.

Not correct Have an operator perform the steps in the AWS Management Console each night

Wrong. The console is for exploring, for one-off changes and for seeing what exists. A job that must run unattended every night cannot depend on a person being awake.

Not correct An AWS CloudFormation template run on a schedule

Wrong. CloudFormation provisions and updates resources. Listing and reading objects is ordinary data work against a bucket that already exists, which is not something a template expresses.

Why

There are three ways in and they all reach the same API: the console (point and click, good for exploring and for rare changes), the CLI (one command, good in a shell or a shell script), and the SDKs (good inside application code, in Java, Python, JavaScript, .NET, Go and others). The rule of thumb is where the call lives: if it lives inside a program, use the SDK.

Where this comes from

Cited
AWS exam guide task statement 3.1

Practise this

Reading one question is not practice. The trainer will draw a set from objective 3 and space the ones you get wrong.

Practise AWS Certified Cloud Practitioner (CLF-C02)

More questions on this objective

All questions on Cloud technology and services