CloudFormation

CloudFormation

Cloud formation (CFN) is an Infrastructure as Code (IaC) service that allows you to model, provision, and manage AWS resources, such as EC2 instances or RDS databases, using YAML or JSON templates. Within the template you specify the desired state of your infrastructure, and CFN will create, update, and delete the resources accordingly. It enables repeatable, consistent, version-controlled environment setups through stacks.

To create a resource in AWS you upload the template to CFN through the CDK4J maven plugin. CFN will create the resource and save the infrastructure state for you. If you need to update or delete the resource, you can do by updating the stack and uploading it to CFN. Cloud formation will then compare the template with the current state of the infrastructure and take the necessary actions. See How CloudFormation Works for the details.