In this workshop series, we will introduce the basic concepts and benefits of IaC (Infrastructure as Code), compare different IaC frameworks, and walk through the steps to get started with IaC.
IaC is a method of managing infrastructure in which the deployment and management of infrastructure is done through source code. One of the biggest benefits of IaC is increased productivity.
Some of the benefits of IaC include simpler infrastructure management, reusable code, and tracking of infrastructure changes. For example, instead of manually creating, configuring, and connecting services in your infrastructure, you can use a CloudFormation template to create and connect these services automatically. When you no longer need them, you simply delete the corresponding stack in CloudFormation. You can also use the same template to deploy services in multiple regions and multiple accounts, and track infrastructure changes from CloudFormation.
In addition, IaC brings other benefits such as security. For example, instead of writing IAM policies yourself to allow a Lambda function to read data from an S3 bucket, when using CDK (Cloud Development Kit), you can simply write bucket.grantReadOnly(lambdaFunction). CDK automatically creates the policy following best practices.
Another important aspect of IaC is its role in CI/CD and DevOps. IaC is an important requirement in DevOps-related work, where automating infrastructure deployment and testing becomes difficult without IaC.
Since 2011, many different IaC frameworks have been released, including CloudFormation, AWS SAM, CDK, and CDK8S, which are developed and supported by AWS. These frameworks share common features such as declaring infrastructure as code and tracking infrastructure changes. However, they differ in their deployment tools and in how deeply they integrate with AWS. CloudFormation, SAM, and CDK all deploy infrastructure through the CloudFormation service. Terraform, Pulumi, and Serverless have their own deployment tools and do not use CloudFormation.

To get started with IaC, you can familiarize yourself with CloudFormation templates by declaring infrastructure, parameters (Parameters), and mappings (Mappings). You can also manage configuration changes and create updates through CloudFormation. In addition, you can deploy the same stack to multiple accounts and regions using StackSets.
To get started with CDK, you need to understand abstract concepts such as Construct, Stack, Props, Interface, Type, and ID. You need to understand and control the dependencies between Stacks and manage infrastructure changes when updating Stacks. You can also divide an architecture into smaller Stacks and deploy multiple Stacks in parallel.
Finally, you can build and integrate IaC into your CI/CD process.