Skip to content

Add CloudFormation templates for first 10 tutorials#33

Merged
mwunderl merged 10 commits intomainfrom
feature/cfn-templates
Apr 21, 2026
Merged

Add CloudFormation templates for first 10 tutorials#33
mwunderl merged 10 commits intomainfrom
feature/cfn-templates

Conversation

@mwunderl
Copy link
Copy Markdown
Contributor

@mwunderl mwunderl commented Apr 14, 2026

Summary

CloudFormation templates for the first 10 published tutorials, plus shared infrastructure and deployment scripts.

Test results (10/10 passing)

./cfn/setup-bucket.sh    # one-time: create shared bucket
python3 test-cfn.py --parallel 3
Template Validate Deploy Delete Time
001-lightsail-gs PASS PASS PASS 73s
002-vpc-gs PASS PASS PASS 121s
003-s3-gettingstarted PASS PASS PASS 27s
004-cloudmap-custom-attributes PASS PASS PASS 114s
005-cloudfront-gettingstarted PASS PASS PASS 432s
008-vpc-private-servers-gs PASS PASS PASS 263s
009-vpc-ipam-gs PASS PASS PASS 175s
010-cloudmap-service-discovery PASS PASS PASS 175s
011-getting-started-batch-fargate PASS PASS PASS 135s
012-transitgateway-gettingstarted PASS PASS PASS 361s

Bucket management

S3 buckets are managed by scripts, not CloudFormation (avoids org-level CFN hooks that block S3 bucket creation):

  • cfn/setup-bucket.sh — creates bucket via CLI, registers name in a thin CFN stack with exports
  • cfn/cleanup-bucket.sh — empties bucket (including versions), deletes bucket, deletes stack
  • Tutorial stacks import the bucket name via !ImportValue tutorial-prereqs-bucket-BucketName

Files

Test runner: test-cfn.py — validates, deploys, and deletes all templates in parallel.

Prerequisite templates (cfn/):

  • prereq-bucket.yaml — thin stack that exports a bucket name (bucket created by setup-bucket.sh)
  • prereq-vpc-public.yaml — VPC with public + private subnets, NAT gateway
  • prereq-vpc-private.yaml — VPC with private subnets only, S3 endpoint

Deployment scripts:

  • deploy.sh / cleanup.sh — universal deploy/delete for tutorial stacks
  • cfn/setup-bucket.sh / cfn/cleanup-bucket.sh — bucket lifecycle

mwunderl added 10 commits April 14, 2026 23:10
- 10 tutorial templates (cfn-*.yaml) matching CLI scripts
- 3 prerequisite templates (bucket, VPC public, VPC private)
- Universal deploy.sh and cleanup.sh scripts
- deploy.sh auto-detects prereqs and offers to create them
- cleanup.sh --prereqs empties buckets before deletion
- All templates validated with aws cloudformation validate-template
- test-cfn.py: parallel deploy/delete test runner with prereq management
- 001-lightsail: nano_3_2 -> nano_3_0 (correct bundle ID)
- 010-cloudmap: public DNS -> HTTP namespace (avoids DNS validation)
- setup-bucket.sh creates bucket via CLI, registers name in a CFN stack
- cleanup-bucket.sh empties and deletes bucket, then deletes the stack
- prereq-bucket.yaml is now a thin parameter-based template (no S3 resource)
- test-cfn.py reverted to clean prereq detection (no inline fallback)
- All 10 templates now pass deploy+delete including 003-s3
- *-cfn.sh scripts run interactive steps against CFN-created resources
- Each command shown with $ prefix and resolved variables
- READMEs now include SDK examples and CloudFormation sections
- deploy.sh: shows all stack resources and outputs after create/update
- deploy.sh: --no-fail-on-empty-changeset so re-running shows info
- cleanup.sh: when stack is gone, searches for orphaned resources by tag
  (uses resourcegroupstaggingapi to find by tutorial tag or cfn stack tag)
@mwunderl mwunderl merged commit 637ebf8 into main Apr 21, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant