4D Training & Consultancy

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.

4 daysIn-house, online, or customized deliveryCorporate teams and professional groupsLevel: Intermediate

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.

Speak to 4D

Plan the right training or consultancy path for your team.

Share a few details and 4D will help route your inquiry toward corporate training, consultancy, assessment, Phoenix-enabled support, or a tailored program.