# CloudFormation, CDK and Bicep

> The cloud providers' own IaC tools: AWS CloudFormation and CDK, and Azure Bicep, deeply integrated with a single cloud. Free notes, key concepts, resources and...

Canonical: https://www.internhack.in/roadmaps/tracks/devops/cloudformation-cdk
Last updated: 2026-11-28

The cloud providers' own IaC tools: AWS CloudFormation and CDK, and Azure Bicep, deeply integrated with a single cloud.

Intermediate · about 8 hours · difficulty 3/5

Learn first: [Infrastructure as Code Principles](https://www.internhack.in/roadmaps/tracks/devops/iac-concepts)

Each large cloud offers a native IaC service. They cover one provider only, but they are supported from day one for new features and need no separate state to manage.

### AWS CloudFormation

- Templates in YAML or JSON declare **resources**, **parameters** and **outputs**.
- A **stack** is a deployed template; AWS stores its state for you.
- **Change sets** preview what an update will do, like a Terraform plan.
- Failed updates **roll back** automatically.
- **StackSets** deploy the same template across many accounts and regions.
- **Drift detection** compares stacks with reality.

### AWS CDK

The **Cloud Development Kit** lets you write TypeScript, Python, Java or Go that synthesises CloudFormation. Higher-level **constructs** create sensible defaults (a load-balanced Fargate service in a few lines). `cdk diff` and `cdk deploy` wrap the change-set workflow.

### Azure Bicep

A concise language that compiles to ARM templates. Deploy with `az deployment group create`, preview with **what-if**, and share modules through registries.

### When to choose native tools

Pick them when you are all-in on one cloud and want zero extra infrastructure, or when an organisation standard requires it. Choose Terraform or Pulumi when you manage several providers (cloud plus DNS plus GitHub plus monitoring) from one codebase.

**Good enough to move on:** you can deploy and update a stack with a change set or what-if preview, explain automatic rollback, and argue native vs multi-cloud IaC for a given company.

## Key concepts

- **CloudFormation templates and stacks**
- **Change sets and rollback**
- **StackSets**
- **AWS CDK constructs**
- **Azure Bicep and what-if**
- **Native vs multi-cloud IaC**

## Other options for this step

- [Terraform and OpenTofu](https://www.internhack.in/roadmaps/tracks/devops/terraform): Provision cloud resources declaratively with HCL, providers, state and modules, using the most widely adopted IaC tool.
- [Pulumi](https://www.internhack.in/roadmaps/tracks/devops/pulumi): Infrastructure as code written in general-purpose languages like TypeScript, Python or Go, with real loops, functions and tests.

## Mini project

Build the same S3 bucket plus Lambda function twice, once as a raw CloudFormation template and once with CDK, and compare template size, readability and the change-set output for a small edit.

## Check yourself

A CloudFormation update fails halfway through. What happens to the resources it already changed?

## Free resources

- [AWS CloudFormation user guide](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/) (AWS)
- [AWS CDK developer guide](https://docs.aws.amazon.com/cdk/v2/guide/) (AWS)
- [Bicep documentation](https://learn.microsoft.com/en-us/azure/azure-resource-manager/bicep/) (Microsoft)

Previous: [Pulumi](https://www.internhack.in/roadmaps/tracks/devops/pulumi) · Next: [Configuration Management with Ansible](https://www.internhack.in/roadmaps/tracks/devops/ansible)

## More in Infrastructure as Code

- [Infrastructure as Code Principles](https://www.internhack.in/roadmaps/tracks/devops/iac-concepts)
- [Terraform and OpenTofu](https://www.internhack.in/roadmaps/tracks/devops/terraform)
- [Pulumi](https://www.internhack.in/roadmaps/tracks/devops/pulumi)
- [CloudFormation, CDK and Bicep](https://www.internhack.in/roadmaps/tracks/devops/cloudformation-cdk)
- [Configuration Management with Ansible](https://www.internhack.in/roadmaps/tracks/devops/ansible)
- [Chef, Puppet and Salt](https://www.internhack.in/roadmaps/tracks/devops/chef-puppet)

## Related

- [Roadmaps](https://www.internhack.in/roadmaps)
- [DevOps Engineer Roadmap](https://www.internhack.in/roadmaps/tracks/devops)
