How CloudFormation works

How CloudFormation works

When you use CloudFormation to create your infrastructure, CloudFormation makes underlying service calls to AWS to provision and configure the resources described in the stack. For example, suppose you have a stack that describes an EC2 instance with a t2.micro instance type. When you use that stack to create an infrastructure, CloudFormation calls the Amazon EC2 create instance API and creates an EC2 instance of type t2.micro.

To create an Infrastructure

  1. Use your favorite IDE to define a stack. The stack describe the resources you want and their settings.
  2. Synthesis your stack. stack synthesis is the process of producing an AWS CloudFormation template and deployment artifacts from the stack. The template and artifacts are known as the cloud assembly. The cloud assembly is what gets deployed to provision your resources on AWS. To synthesize a stack, use the CDK4J maven plugin
  3. During deployment assets are uploaded to the bootstrapped CloudFormation S3 bucket and the template is submitted to CloudFormation to provision your AWS resources.

CloudFormation flow