Working with CloudFormation templates - AWS CloudFormation

Working with CloudFormation templates

To deploy a stack of resources using CloudFormation, you must first create a stack template. Templates are declarative configuration files that specify the resources you want to provision in your CloudFormation stacks. They define the resources, configurations, mappings, parameters, outputs and other settings. CloudFormation reads the template and creates the specified resources.

You can create templates using:

  • AWS Application Composer – A visual interface for designing templates.

  • AWS CloudFormation Designer – An older visual interface for template design.

  • Text Editor – Write templates directly in JSON or YAML syntax.

  • IaC generator – Generate templates from resources provisioned in your account that are not currently managed by CloudFormation. The IaC generator works with a wide range of resource types that are supported by the Cloud Control API in your Region.

The following topics show you how to use the different parts of a CloudFormation template and how they work together. You'll also learn how to use custom resources and macros to add functionality to templates and how to create modules that you can share and reuse across multiple templates. In addition, you'll find example snippets for common resource types and configurations. These can be copied and customized to speed up template development.