Module 10 cheat sheet
One-page revision summary for Infrastructure as Code: tools, .NET and Azure mapping, CLI commands, limits, decision rules, exam traps and cost traps.
Assumes: AWS CLI v2 · Amazon.CDK.Lib 2.277.0 · Cdklabs.CdkNag 3.0.2 · Terraform 1.17.2 · AWS provider 6.73.0 · .NET 10 LTS · Region us-east-1 · facts as stated in the Module 10 lessons (checked 2026-11-18). Verified against official sources on 2026-11-18.
A printable summary of Module 10. Rows link back to the lesson with the detail.
Key tools and services
| Tool or service | What it is for | Lesson |
|---|---|---|
| CloudFormation | Declarative stacks, change sets, rollback, drift detection | Fundamentals |
| StackSets | Roll one template out to many accounts and Regions | Drift and StackSets |
| AWS CDK (C#) | Real C# that synthesizes CloudFormation; L1 raw, L2 defaults, L3 patterns | First stack, Constructs |
| CDK stacks and bootstrap | Stacks by lifecycle, typed per-environment settings, deploy roles | Stacks and environments |
| xUnit + cdk-nag | Assertion tests on the synthesized template; rule packs with justified suppressions | Testing CDK |
| Terraform + AWS provider | HCL, plan/apply, one tool across providers | Fundamentals |
| Terraform state in S3 | Remote, encrypted, locked state (use_lockfile) | State |
| Terraform modules | Reusable, versioned building blocks | Modules |
| Checkov, cfn-nag, CloudFormation Guard | Policy checks on code, templates and plans | Policy-as-code |
| Control Tower, Account Factory, AFT, CfCT | Governed multi-account landing zone | Landing zones |
.NET / Azure to AWS
| Microsoft / Azure | AWS |
|---|---|
| ARM template | CloudFormation template |
| Bicep | AWS CDK in C# |
| Terraform with azurerm | Terraform with the AWS provider |
| What-if / deployment stacks | Change set / terraform plan |
| Azure Policy, template analysis | cdk-nag, Checkov, cfn-nag, CloudFormation Guard |
| Template specs | CloudFormation modules, CDK construct libraries, Terraform modules |
| Management groups + landing zone accelerator | Organizations + Control Tower + Account Factory |
| Storage account holding state | S3 bucket with KMS and use_lockfile |
Most useful commands
| Task | Command |
|---|---|
| Lint / validate a template | cfn-lint template.yaml · aws cloudformation validate-template --template-body file://template.yaml |
| Review before applying | aws cloudformation create-change-set then describe-change-set, execute-change-set |
| Recover a stuck rollback | aws cloudformation continue-update-rollback --stack-name <name> |
| Detect drift | aws cloudformation detect-stack-drift · describe-stack-drift-detection-status · describe-stack-resource-drifts |
| CDK cycle | cdk bootstrap · cdk synth · cdk diff · cdk deploy · cdk destroy |
| Terraform cycle | terraform init · plan -out · apply · destroy |
| Terraform state work | terraform state list · terraform import · terraform workspace list |
| Test without an account | dotnet test (CDK, needs Node.js) · terraform test (mock provider) |
| Find leftovers | aws resourcegroupstaggingapi get-resources --tag-filters Key=Project,Values=cea-lab |
Key limits and defaults
| Item | Value |
|---|---|
| CloudFormation template | 500 resources, 200 parameters, 200 outputs, 200 mappings |
| Template body in a request | 51,200 bytes; upload to S3 for up to 1 MB |
| Deletion policy default | Delete (a non-empty S3 bucket then fails to delete) |
UpdateReplacePolicy | Separate from DeletionPolicy; applies when an update replaces the resource |
| KMS key deletion window | Minimum 7 days |
| Drift detection | Point-in-time, manual or scheduled; needs read access to every resource type; only template properties are compared |
| StackSets quotas | 1,000 StackSets per administrator account; 100,000 stack instances per StackSet |
| Terraform locking | use_lockfile = true (S3 conditional writes); DynamoDB locking is deprecated |
| CDK dependency | Needs Node.js 22 or 24 LTS even for C# apps |
| Lab tests | 50; 22 pass and 28 skip without Node.js; CI=true makes a missing Node a failure |
Decision rules
| If you need… | Choose |
|---|---|
| AWS-only, C# team, testable infrastructure | CDK in C# |
| Several clouds or non-AWS providers | Terraform |
| Full control of the raw template, or services that deploy CloudFormation for you | CloudFormation |
| One approved pattern for many teams | CDK L3 construct or Terraform module |
| Same template in many accounts | StackSets (service-managed, with auto-deployment) |
| Bring a hand-built resource under code | CloudFormation IMPORT change set or terraform import |
| Differences between dev, test and prod | One typed settings profile over one codebase |
| Protect stateful resources | Retain or snapshot policy, deletion protection, prevent_destroy, stack policy, plan guard |
| Pipeline access | Read-only plan role plus narrow apply role via OIDC |
| New accounts on demand | Control Tower Account Factory driven from Git |
Common exam traps
- Renaming a CDK logical ID or construct ID replaces the resource: delete and create, losing data.
DeletionPolicy: Retainalone does not stop replacement during an update; pair it withUpdateReplacePolicy.ROLLBACK_COMPLETEcannot be updated: delete the stack and create it again.UPDATE_ROLLBACK_FAILEDneeds the cause fixed, thencontinue-update-rollback.- Drift detection does not alert. You must schedule it, and it ignores properties missing from the template.
- StackSets run from the administrator account; deleting an instance can delete its resources unless retained.
- A passing plan or
cdk diffis not approval. Read replace (-/+) lines. - Suppressions are risk acceptances: name the exact rule ID, the reason and an owner.
- A skipped test proves nothing: fail the build when Node.js is missing.
- Terraform state holds secrets: encrypt it and restrict who can read it.
- A policy scan is not compliance. Never claim a control equals compliance.
Cost traps
| Trap | Avoid it by |
|---|---|
| NAT Gateway in a lab VPC | Use VPC endpoints, or keep it design-only |
| Interface endpoints left running | They bill hourly; deploy, verify and destroy within the hour |
| Fargate, ALB and RDS left up | The lab environment costs about $0.20 per hour; destroy and check |
| Retained KMS key and buckets | Schedule the key for deletion (7-day minimum) and empty the buckets |
| Orphaned state bucket | Remove it last, after every stack that uses it |
| Control Tower landing zone | Design-only here; the services it enables bill |
Independent learning resource — not affiliated with, endorsed or sponsored by Amazon Web Services. AWS and related marks are trademarks of Amazon.com, Inc. or its affiliates. All banking data in examples is fictional. Sample architectures are for learning and are not automatically compliant with GDPR, PCI DSS or any banking regulation.
Landing-zone automation overview
Understand what AWS Control Tower, Account Factory, Account Factory for Terraform and Customizations for Control Tower each automate, design a Harbourline landing zone on paper, and validate account requests with a tested C# check before anything is provisioned.
Module 11: Monitoring, Logging & Troubleshooting
Make your .NET workloads observable with CloudWatch logs, metrics, alarms and dashboards, distributed tracing with X-Ray and OpenTelemetry, and CloudTrail for who-did-what. You then practise finding and fixing real production problems methodically, from thread-pool starvation to cold starts, and turn alerts into runbooks.