Skip to main content

AWS Infrastructure as Code: CloudFormation and CDK

Learn AWS-native IaC with CloudFormation and CDK, choose between them and Terraform, and run multi-account environments, imports, and CI safely.

~3 hours
9 Topics
Hands-on Scenarios

What You'll Learn

Understanding Why AWS Offers Its Own IaC

A platform team in Pune renames one line in a CloudFormation template.

Writing CloudFormation Templates

CloudFormation is the lowest layer of AWS-native IaC.

Deploying Safely with Change Sets, Stack Policies, and Drift Detection

Writing a template is the easy part. The skill that prevents incidents is changing a live stack safely, and CloudFormation gives you four tools for...

Building Infrastructure with AWS CDK

CloudFormation YAML is explicit but repetitive.

Choosing Between Terraform, CloudFormation, and CDK

All three work well on AWS. The right choice depends on your team and your cloud footprint, not on which tool is "best." Comparing the three tools...

Managing Environments with Separate State and Separate AWS Accounts

Dev, staging, and production should not be able to break each other. How you isolate them matters more than which tool you use.

Skills You'll Master

CLOUDFORMATIONAWS-CDKIACTERRAFORMMULTI-ACCOUNT

Curriculum Index9 topics

Career Impact

Roles that use the skills in this module.

  • DevOps Engineer

  • Cloud Engineer

  • Platform Engineer

  • Solutions Architect

See how this is asked in interviews

Practice on the Coding Sheet

Not a software engineer sheet. Every problem comes from real DevOps, SRE, Platform and Cloud interviews, from your first script to a system you build yourself.

Open the Coding Sheet

Frequently Asked Questions

Learn the Terraform module first if your team might ever use more than one cloud, because it is the most widely used tool. Learn CloudFormation when you work in an AWS-only team, or when you need to read the templates AWS itself produces. The ideas, such as previews, state, and drift, carry over between them.

No. CDK is a way to write infrastructure in a language like Python or TypeScript, and it produces a CloudFormation template that CloudFormation then deploys. Change sets, stack events, and drift detection all still apply.

A change set is a preview of what a template update would do to a stack. It lists each resource that will be added, modified, or removed, and whether it will be replaced. It is CloudFormation's equivalent of terraform plan.

Drift is when a real resource no longer matches what your template or configuration says, usually because someone changed it by hand in the console. CloudFormation can detect drift on a stack, and Terraform shows it in the next plan. Neither one fixes it for you automatically.