Software Development
Python Cloud Automation on AWS with boto3
An AWS account grows expensive quietly: untagged volumes, forgotten snapshots, and environments nobody owns. This course teaches boto3 as an operations tool, covering sessions and credentials, paginated inventory across accounts and regions, tagging enforcement, cost and cleanup jobs, and least-privilege execution.
Overview
Practical learning for workplace transfer.
The situation this course targets is the account that has outrun its console: hundreds of resources across several regions, a tagging standard that exists on paper only, a monthly bill nobody can attribute to a team, and cleanup work everyone postpones because a wrong delete is unrecoverable. Participants learn how boto3 sessions, clients, resources, paginators, and waiters actually behave, then build inventory, tagging, cost attribution, and cleanup automation that runs with an explicitly scoped IAM role, defaults to dry-run, and reports exactly what it would change before it changes anything.
Prerequisites
Hands-on AWS experience with core services such as EC2, S3, and IAM, plus basic Python including functions, dictionaries, and error handling.
Objectives
- Configure boto3 sessions, profiles, and assumed roles across multiple AWS accounts.
- Build a complete resource inventory using paginators, filters, and multi-region loops.
- Enforce a tagging standard and report every resource that violates it.
- Attribute spend to teams and environments and automate the cleanup of idle resources.
- Write least-privilege IAM policies that match exactly what an automation script calls.
- Ship automation with dry-run defaults, idempotency, retries, and audit-quality logging.
Target audience
- Cloud engineers responsible for AWS account operations
- DevOps and platform engineers automating environment lifecycle
- System administrators moving from console clicking to scripted operations
- FinOps and cloud cost analysts building spend attribution
- Cloud security and governance staff auditing configuration drift
- IT operations managers standardizing cloud housekeeping practice
Program outline
A clear structure for the learning journey.
Program outline
Outline points are grouped in one designed block instead of being treated as separate module cards.
Module 1: Sessions, Credentials, and the boto3 Client Model
Clients versus resources, and choosing the right interface for the task
Credential chain, named profiles, instance roles, and assumed cross-account roles
Region handling, endpoints, and why a script silently misses resources
Reading botocore errors, throttling responses, and configuring retries
Module 2: Paginators, Waiters, and Large Accounts
Why a first API page is not the answer, and how paginators fix it
Server-side filters, JMESPath queries, and reducing call volume
Waiters for resource state transitions instead of sleep loops
Concurrency, throttling limits, and safe parallel scanning
Module 3: Inventory, Tagging, and Account Hygiene
Collecting EC2, EBS, S3, RDS, and Lambda inventory into one dataset
Defining a tagging standard for owner, environment, cost centre, and lifecycle
Detecting untagged and mistagged resources and applying corrections in bulk
Configuration drift reports against an agreed account baseline
Module 4: Cost Visibility and Cleanup Automation
Pulling cost and usage data and attributing spend by tag and account
Finding unattached volumes, stale snapshots, idle instances, and orphaned addresses
Scheduled start and stop of non-production environments
Lifecycle rules, retention policies, and staged deletion with a grace period
Module 5: Least-Privilege IAM and Safe Execution
Deriving the exact IAM actions a script needs and nothing more
Condition keys, resource ARNs, and separating read from destructive permissions
DryRun parameters, confirmation prompts, and protected resource allowlists
Idempotent operations and recovering from a partially completed run
Module 6: Running Automation in Production
Packaging scripts as scheduled jobs or Lambda functions with an execution role
Structured logs, run reports, and alerting when automation fails silently
Testing against a sandbox account before touching production
Workshop: building a tagged inventory and cleanup job for your own account
Materials provided
- Course workbook, annotated code samples, and reference notes
- Hands-on lab environment and starter repositories
- Exercises, checklists, and reusable code templates
- 4D Certificate of Completion
- Post-course technical guidance
Training Options
Programs can be delivered in-house, online, or in a blended format depending on your team's schedule, location, and learning objectives. When an external certificate or exam is included, certification rules and fees remain under the relevant awarding body's policies, while 4D provides the training and preparation support.
Why choose 4D
Cleanup automation is only adopted when the team trusts it not to delete the wrong thing. 4D runs this course inside a sandbox mirroring your account structure and tagging standard, and every destructive exercise is written dry-run first with a protected-resource allowlist. Participants leave with inventory, tagging, and cleanup scripts scoped to permissions their security team will sign off.
Related courses
Python Programming Fundamentals
A hands-on introduction to Python for engineers and analysts who need working code rather than tutorial fragments. Participants build fluency with data types, collections, functions, files, and error handling, then assemble a small program that reads real data and produces a usable report.
View courseIntermediate Python and Clean Code Practices
Designed for developers whose Python works but is difficult to change. The course covers dataclasses, generators, decorators, context managers, and type hints, then applies the refactoring moves that turn a nine-hundred-line module into small tested units guarded by black, ruff, and mypy.
View coursePython Automation and Scripting for Work Tasks
Aimed at teams losing hours every week to repetitive file, spreadsheet, and reporting work. Participants automate those tasks with Python: batch file handling, Excel and CSV processing, REST API calls, email alerts, and scheduled jobs that run unattended and report clearly when something fails.
View course