Choosing Between the Console, CLI, SDKs and APIs
This lesson explains the ways to work with AWS. Underneath, they all call the same AWS APIs, so the choice depends on whether you are exploring, automating or building applications.
Learning outcomes
After completing this lesson, you will be able to:
- Distinguish the AWS Management Console, the AWS CLI, the AWS SDKs and the APIs.
- Identify the credentials used for console access and for programmatic access.
- Explain when automated access is preferable to manual work in the console.
Ways to access AWS
There are several ways to work with AWS, and all of them call the same AWS APIs underneath. The AWS Management Console is a web interface for managing services visually; it suits learning, one-off tasks and viewing dashboards, and a mobile app lets you check resources and alarms. The AWS CLI runs commands in a terminal, such as aws s3 ls, which can be saved in scripts to automate repetitive tasks.
The AWS SDKs are libraries for programming languages such as Python, Java and JavaScript, which let application code call AWS, for example to upload a photo to S3. The APIs themselves are the HTTPS interface that the console, CLI and SDKs all use, and can be called directly. The following table summarises the methods.
| Method | What it is | Best for |
|---|---|---|
| AWS Management Console | Web interface for managing services visually; a mobile app lets you monitor resources and alarms | Learning, one-off tasks, dashboards |
| AWS CLI | Commands in a terminal, such as aws s3 ls, that can be saved in scripts | Automating repetitive tasks |
| AWS SDKs | Libraries for Python (Boto3), Java, JavaScript, Go, .NET and more | Calling AWS from application code, e.g. uploading photos to S3 |
| APIs | The HTTPS interface that the console, CLI and SDKs all use | Direct integration |
Console, CLI or SDK?
Credentials
How you prove your identity depends on how you use AWS. Signing in to the console uses a user name and password, protected with multi-factor authentication (MFA). Programmatic access, through the CLI, SDKs or APIs, uses access keys. Long-term access keys can leak, so the better practice is temporary credentials, obtained from an IAM role or by signing in through IAM Identity Center, which expire automatically. The following table summarises the two.
| Access | Authenticates with |
|---|---|
| Console | User name and password, with MFA |
| Programmatic (CLI, SDKs, APIs) | Access keys or, better, temporary credentials from IAM roles or IAM Identity Center |
Credentials for access
Manual versus automated
Use the console to learn and for occasional tasks. Use the CLI, SDKs or infrastructure as code for anything that must be repeated reliably, because manual clicking is slow and error-prone.
One task, three ways
A team needs to list the files in an S3 bucket. The same request can be made three ways, and they all call the same S3 API underneath:
| Method | How | When it makes sense |
|---|---|---|
| Management Console | Open S3, click the bucket | Looking once, or learning |
| AWS CLI | aws s3 ls s3://team-reports/ | Repeating the task or putting it in a script |
| SDK in application code | A few lines of Python with Boto3 | When an application needs the list |
import boto3
s3 = boto3.client("s3")
for obj in s3.list_objects_v2(Bucket="team-reports").get("Contents", []):
print(obj["Key"])If the team needed this list every morning, clicking in the console would be slow and error-prone; a short CLI script or a scheduled function does it reliably.
What is the difference between the AWS CLI and an AWS SDK?
Show answer
The AWS CLI runs AWS commands in a terminal or script. An AWS SDK is a library that lets application code, written in a language such as Python or Java, call AWS services.
Exam Tips
Remember for the exam
- Programmatic access means the CLI, the SDKs or the APIs.
- The console suits learning and one-off tasks; the CLI suits scripts.
- To call AWS from application code, use an SDK.
- Tasks that must be repeated should be scripted or automated, not done by hand.
- Prefer temporary credentials from roles to long-term access keys.