Concepts·Python Automation for IT
Python Cloud SDK Patterns with boto3
boto3 is the shape almost every cloud SDK has: a client per service, one exception class for every failure, paginators instead of page loops, and retries already built in. This guide covers where credentials come from and what happens with none, the region omission that raises against the one that silently sends you to us-east-1, and `botocore.stub.Stubber` - which lets you exercise all of it with no AWS account at all.
APIs and Cloud Guide 30 of 39 Advanced
- Python3.14.4
- Control nodeUbuntu 26.04 LTS
- Managed hostsRHEL 10.0
- requests2.34.2
- paramiko5.0.0
- pytest9.1.1
- PyYAML6.0.3
- boto3 / botocore1.43.78
- TimeAbout 20 min
- Reviewed24 August 2026
Written against the versions above. boto3 and botocore 1.43.78. The `resource` API is feature-frozen - new services and features are client-only. `retries` defaults to `mode: legacy` unless `AWS_RETRY_MODE` says otherwise.
| Server Name | IP Address | OS | Roles | CPU | RAM | HDD |
|---|---|---|---|---|---|---|
| RUNNER01 | 192.168.0.27 | Ubuntu 26.04 LTS | Control node - every script in this path runs here | 2 Core | 4 GB | 50 GB |
Before you start
- guide 25 - credentials, and where they should not live.
- guide 27 - what a paginator is doing for you.
- guide 28 - what boto3's retry config replaces.
-
The two objects boto3 gives you
-
Where credentials come from, and what happens with none
-
And with no region either
-
Testing it with no account at all
-
A stub that validates what you sent
-
An error the API returns
-
Paginators, so you never write the page loop
-
Retries and timeouts, which boto3 has built in