Skip to content

About

Repository to learn use CDK with Python to manage AWS resources

Topics

Resources

Contributing

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

learning-cdk-python

A beginner learning path for managing AWS resources with the AWS Cloud Development Kit (CDK) v2 in Python, using uv as the package manager and floci (via docker-compose.yml, or floci-cli) as a free, local AWS emulator - 46 small, independent, deployable modules, one per AWS service, each with its own explanation and step-by-step instructions. No AWS account or cost is required to complete it.

What this is

  • 46 modules (modules/01_iam through modules/46_msk), grouped into 11 phases in docs/LEARNING-PATH.md
    • IAM, STS, VPC networking (subnets, security groups, route tables, Internet/NAT/Transit Gateway, VPC Peering), KMS, Secrets Manager, Parameter Store, ACM, S3, EC2, ECR, ECS, EKS, Lambda, RDS (MySQL, PostgreSQL, Aurora), DynamoDB, ElastiCache (Valkey or Redis OSS), OpenSearch, DocumentDB, Kinesis, Athena, SQS, SNS, EventBridge, Step Functions, MSK (Apache Kafka), ALB, NLB, CloudFront, Route 53, API Gateway, Cognito, SES, WAF, GuardDuty, CloudWatch, CloudTrail, AWS Backup, Cost Explorer, and Resource Groups & Tagging.
  • Each module is a minimal, real, deployable AWS CDK stack written in Python, plus a README explaining what it teaches, which CDK constructs it uses, and how to deploy/verify/clean it up.
  • Every resource follows one tagging policy (environment, product, Name, team-owner, pci, cell-based, cell-id) and one naming policy (hyphen-separated names) - see REQUIREMENTS.md.
  • Every stack is account/region-agnostic - no hardcoded AWS account ID, region, or Availability Zone.

Quickstart

Never used AWS CDK, Docker, or uv before? Follow REQUIREMENTS.md, section 0

  • it explains the concepts and gets you to your first cdk deploy in 9 steps. The short version, once the prerequisites in REQUIREMENTS.md, section 3 are installed:
git clone <this-repository-url> && cd learning-cdk-python
make check                            # confirms everything above is actually installed
uv sync
docker compose up -d floci
cp .env.example .env && set -a; source .env; set +a
uv run cdk list                       # see every module's stack id
uv run cdk bootstrap                  # once per floci instance (REQUIREMENTS.md section 5.7)
uv run cdk deploy IamStack --require-approval never --method=direct   # deploy the first module
uv run cdk destroy IamStack           # and clean it up when you're done

Documentation

Prerequisites, floci/uv setup, tagging and naming policy REQUIREMENTS.md
The full 46-module path, grouped into 11 phases docs/LEARNING-PATH.md
Diagrams: the CDK workflow, the floci local environment, and how AWS resources relate to each other docs/ARCHITECTURE.md
How to read the CDK API reference: L1/L2/L3 constructs, imports, parameters, default values, methods, and attributes docs/CDK-API-REFERENCE-GUIDE.md
Resource dependencies (implicit and explicit), and Python loops and conditionals to create and name resources docs/DEPENDENCIES-LOOPS-AND-CONDITIONALS.md
Stack outputs: keeping resources in variables, finding their attributes, CfnOutput, and where outputs appear (cdk deploy, a file, the AWS CLI, the console) docs/STACK-OUTPUTS.md
Sharing resources between stacks (cross-stack references) and stacks inside stacks (nested stacks) docs/CROSS-STACK-AND-NESTED-STACKS.md
Writing your own construct, packaging it as a library, and releasing/upgrading it with Semantic Versioning docs/CONSTRUCT-LIBRARIES-AND-SEMVER.md
Slide decks covering the tooling and the hands-on lab (en-US / pt-BR) docs/slides/SLIDES-en-US.md · docs/slides/SLIDES-pt-BR.md
Referencing vs. fully importing an existing (manually-created or legacy) AWS resource docs/IMPORTING-EXISTING-RESOURCES.md
A combined, SOLID/builder-pattern example app (past the 46 independent modules) examples/enterprise_stack/README.md
Conventions for anyone (human or AI assistant) extending this repository CLAUDE.md
Changelog CHANGELOG.md

Contributing

For information on how to propose a change or add a new module, see CONTRIBUTING.md.

Developers

Aécio dos Santos Pires
https://linktr.ee/aeciopires

License

GNU General Public License v3.0.

About

Repository to learn use CDK with Python to manage AWS resources

Topics

Resources

Contributing

Stars

1 star

Watchers

0 watching

Forks

Releases

Contributors

Languages