Fact-checked by Grok 2 weeks ago

AWS CloudFormation

AWS CloudFormation is an (IaC) service offered by (AWS) that enables users to define, provision, and manage AWS resources and select third-party integrations through declarative templates written in or . Launched on February 25, 2011, it automates the setup and configuration of cloud infrastructure, treating related resources as a single, manageable unit called a to ensure consistency and repeatability across deployments. At its core, CloudFormation operates by allowing developers and administrators to author templates that describe the desired state of resources, such as EC2 instances, databases, or VPCs; the service then handles the orchestration of creation, updates, or deletions based on these specifications. This approach simplifies infrastructure management by reducing manual intervention, enabling version-controlled templates for tracking changes, and supporting quick replication of environments across AWS regions or accounts. Key benefits include built-in rollback capabilities to previous stable configurations during updates, integration with AWS services like for secure access, and extensibility through the CloudFormation Registry for custom resource types from AWS partners. Users interact with CloudFormation via the AWS Management Console, APIs, AWS CLI, or SDKs in multiple programming languages, making it accessible for both small-scale prototypes and large-scale enterprise deployments. Over time, the service has evolved to include advanced features like stack sets for multi-account management, drift detection to identify configuration deviations, and support for modular templates to promote reusability and reduce complexity in defining intricate architectures. These enhancements have positioned CloudFormation as a foundational tool in AWS for practices, emphasizing predictability, scalability, and compliance in cloud resource orchestration.

Overview

Definition and Purpose

AWS CloudFormation is a native AWS service launched in 2011 that provides (IaC) capabilities for modeling, provisioning, and managing AWS resources, such as EC2 instances, S3 buckets, and VPCs, through declarative templates written in or . The primary purpose of AWS CloudFormation is to enable users to define their desired infrastructure state in code, automating the creation and configuration of resources while handling dependencies and updates in a repeatable, version-controlled manner. This approach allows teams to focus more on application development rather than manual resource management, supporting scalable deployments across multiple AWS accounts and regions. At a high level, AWS CloudFormation operates by using user-provided templates to describe the desired end state of resources; it then provisions those resources in the correct dependency order through calls to AWS services, with automatic rollback to a previous stable state if any creation or update fails. Resources are grouped and managed as logical units called stacks, ensuring that all components are created, updated, or deleted together. Compared to manual provisioning via the AWS Console or CLI, CloudFormation reduces by enforcing declarative specifications, accelerates deployment times through , and promotes consistency and repeatability across development, testing, and production environments.

Benefits and Use Cases

AWS CloudFormation simplifies infrastructure by automating the provisioning and configuration of AWS resources using declarative templates, allowing users to focus on application development rather than manual setup tasks. This reduces operational overhead and minimizes in deployments, as CloudFormation handles dependencies between resources automatically during creation or updates. Additionally, it enables quick replication of infrastructure across multiple AWS regions or accounts through reusable templates, facilitating consistent environments for global applications without custom scripting. The service integrates seamlessly with version control systems, treating infrastructure templates like source code to enable auditing, change tracking, and rollback capabilities, which supports compliance requirements in regulated industries. For cost efficiency, users pay only for the resources provisioned by CloudFormation stacks, and entire environments can be easily torn down via stack deletion, avoiding lingering costs from manual deprovisioning. Change sets further enhance efficiency by previewing proposed updates before application, preventing unintended resource modifications that could incur expenses. Common use cases include setting up development, testing, and production environments, where templates automate the creation of scalable web applications with components like Auto Scaling groups and Elastic Load Balancing. It excels in deploying multi-tier applications, such as combining Amazon EC2 instances with Amazon RDS databases, ensuring orderly resource orchestration. CloudFormation also streamlines disaster recovery by replicating stacks across regions for high availability and quick failover. For serverless architectures, integration with AWS Serverless Application Model (SAM) allows simplified provisioning of AWS Lambda functions and API Gateway resources through extended YAML templates. Overall, its scalability supports complex, dependency-heavy infrastructures without requiring bespoke automation scripts.

Core Concepts

Stacks

In AWS CloudFormation, a serves as the fundamental unit for managing AWS resources, grouping them together so that they can be created, updated, or deleted as a cohesive whole based on the specifications in a CloudFormation . This approach ensures that all resources within the are treated uniformly, simplifying by abstracting the complexity of individual resource provisioning. The lifecycle of a stack encompasses creation, updates, and deletion, with CloudFormation handling dependencies to maintain order and integrity throughout. During creation, CloudFormation provisions resources according to their , automatically parallelizing independent operations while ensuring dependent resources are created only after prerequisites are met; if any resource fails, the entire stack rolls back by deleting successfully provisioned resources. Updates apply changes incrementally to only the affected resources, preserving the stack's overall state and allowing for safe modifications without full redeployment. Deletion removes all resources in the stack in a dependency-managed order—typically reverse to creation—to ensure safe teardown, though certain resources can be retained via policies if specified. CloudFormation imposes limits on stacks to maintain service reliability, including a default maximum of 500 resources per stack and up to 2,000 stacks per AWS account per Region. To exceed the resource limit, users can employ nested stacks, which allow embedding one stack within another as a resource, effectively organizing larger infrastructures while adhering to the 500-resource cap per level and a total operation limit of 2,500 resources across nested hierarchies. Stacks can be monitored through events and status indicators, providing visibility into operations for troubleshooting and auditing. Events log each action on resources, such as creation attempts or failures, and are accessible in reverse chronological order via the CloudFormation console, AWS CLI, or the ; statuses like CREATE_IN_PROGRESS, UPDATE_COMPLETE, or ROLLBACK_FAILED help track progress and detect issues like rollbacks triggered by errors. This monitoring capability ensures administrators can respond promptly to stack lifecycle events without manual intervention.

Templates

AWS CloudFormation templates are declarative text files written in either or format that define the infrastructure resources to be provisioned, along with their properties and dependencies. These templates must include a required version declaration using the AWSTemplateFormatVersion key, such as "2010-09-09", to specify the capabilities and syntax supported by CloudFormation. An optional description field provides a textual overview of the template's purpose. By describing resources like EC2 instances or S3 buckets, their configurations, and interdependencies, templates enable the automated creation of stacks, which are the runtime instances of these definitions. Templates promote reusability and portability across environments and AWS regions without requiring modifications to the core structure. They can be versioned using mechanisms like storage in repositories for change tracking. Sharing is facilitated through AWS , allowing organizations to distribute pre-approved templates as products for self-service provisioning while enforcing governance. This approach supports replication of in , testing, and environments, enhancing in multi-region deployments. To incorporate dynamic values and references within templates, CloudFormation provides intrinsic functions, such as Ref, which retrieves the physical ID or value of a resource or parameter, and Fn::GetAtt, which accesses specific attributes of a resource. These functions allow templates to adapt based on runtime context without hardcoding values, though detailed usage is covered in template anatomy sections. Before deployment, templates can be validated for syntax and basic conformance using the AWS CLI command aws cloudformation validate-template, which checks for valid or structure and reports errors. This tool helps identify issues early, preventing failed stack creations.

Change Sets

Change sets in AWS CloudFormation provide a mechanism to preview proposed updates to a before applying them, summarizing the intended actions such as additions, modifications, or deletions of resources. This feature generates a detailed report of how changes to the template or input parameters would affect the stack's resources, including property-level differences and potential replacements, without altering the live . By creating a change set, users can assess the impact on resource attributes like tags, groups, or dependencies, enabling informed decision-making prior to execution. As of November 2025, enhanced drift-aware change sets incorporate comparisons with the actual resource state to identify and manage drift during previews. The process begins with creating a change set through the AWS Management Console, AWS CLI, or by specifying the target , a unique change set name, and the updated template file (via S3 URL or direct upload) along with any new parameter values. Once submitted, CloudFormation analyzes the differences and transitions the status from CREATE_PENDING to CREATE_IN_PROGRESS, then to CREATE_COMPLETE upon successful generation. Users then review the change set, which displays categorized changes—highlighted as additions (green), modifications (blue), or removals (red)—including before-and-after values for modified properties. To apply the changes, the change set is executed, updating the and automatically deleting all associated change sets for that ; alternatively, it can be discarded or manually deleted to avoid unintended updates. If execution fails, CloudFormation the to its previous state based on the configured rollback configuration. In multi-user or compliance-driven environments, change sets facilitate team reviews by allowing stakeholders to evaluate proposed modifications for adherence to policies, potential disruptions, or permission requirements without risking production resources. This preview capability helps verify permissions needed for the changes and supports approval workflows before execution, reducing the risk of unauthorized or erroneous deployments. For instance, in nested stack scenarios, change sets can preview updates across the hierarchy, though they enable safer iterations in collaborative settings. Change sets have specific limitations, including the inability to fully resolve cross-stack references during preview calculations, where they make conservative assumptions about impacts such as resource replacements rather than dynamically evaluating dependencies across stacks. Additionally, they do not validate account quotas, unsupported resource updates, or execution permissions in advance, requiring separate checks. Change sets remain available until explicitly deleted or superseded by execution, but multiple active sets per stack are supported up to service quotas.

Template Anatomy

AWSTemplateFormatVersion and Description

The AWSTemplateFormatVersion is a top-level key in an AWS CloudFormation template that declares the of the AWS Serverless Application Model (SAM) or CloudFormation template format being used. This string value ensures compatibility with specific syntax, intrinsic functions, and resource types supported by CloudFormation at the time of the template's creation. The only valid and current value is "2010-09-09", which has been the standard since CloudFormation's initial release in 2011, allowing templates to remain backward compatible while incorporating new features through ongoing updates to the service. Omitting this key results in CloudFormation defaulting to the "2010-09-09" version, but explicitly including it promotes clarity and aids in template validation during . For example, a basic declaration in format appears as:
json
{
  "AWSTemplateFormatVersion": "2010-09-09"
}
In , it is written as:
yaml
AWSTemplateFormatVersion: '2010-09-09'
This version enables the full range of CloudFormation's declarative capabilities, including support for both and syntax introduced in 2016, without requiring version changes for enhancements like new pseudo parameters or resource providers. The Description is an optional top-level key that provides a human-readable string summarizing the template's purpose, key parameters, expected outcomes, or usage instructions. It serves as essential documentation, helping developers, reviewers, and teams understand the template's intent without delving into the full structure, and is particularly valuable in collaborative environments or when templates are shared via . The value should be concise yet informative, limited to a single string without additional formatting or keys. An example in JSON is:
json
{
  "Description": "Template to provision a secure VPC with public and private subnets for a web application."
}
In YAML:
yaml
Description: 'Template to provision a secure VPC with public and private subnets for a web application.'
Best practices recommend always specifying the AWSTemplateFormatVersion to explicitly indicate compatibility and avoid ambiguity in validation tools or CI/CD pipelines. Including a Description enhances maintainability, especially for complex templates, by providing context that facilitates onboarding and troubleshooting in team settings. Over time, CloudFormation's evolution has focused on expanding features—such as macro support in 2018 and module versioning in 2020—within the fixed "2010-09-09" format, ensuring existing templates do not break while enabling new intrinsics and resource types for advanced .

Parameters

In AWS CloudFormation, the Parameters section enables customization by allowing users to provide input values that make s reusable across different deployments. These parameters are declared as key-value pairs, where each parameter has a logical name (key) and associated properties, including a required Type that specifies the data format, such as for text values, Number for integers or decimals, List for arrays (e.g., List), or CommaDelimitedList for comma-separated strings. Optional properties include a Default value, which supplies a fallback if no input is provided during creation or update, and constraints to enforce valid inputs, such as AllowedValues for predefined options, AllowedPattern using regular expressions, MinLength and MaxLength for string bounds, or MinValue and MaxValue for numeric ranges. Parameters are supplied when creating or updating a via the AWS Management Console, AWS CLI, or SDKs, overriding any defaults and enabling dynamic configuration without template modifications. Within the template, parameters are referenced using intrinsic functions like !Ref, which returns the parameter's value directly, or !Sub for string substitution and concatenation, such as constructing a name from multiple inputs. For example, a parameter named InstanceType of type with AllowedValues including "t3.micro" and "t3.small" can be referenced in a as !Ref InstanceType to specify the EC2 instance size. AWS CloudFormation supports specialized parameter types prefixed with AWS::, which integrate directly with AWS services to provide validated, account-specific options, often appearing as searchable dropdowns in the console for ease of selection. Examples include for selecting an existing EC2 instance ID (format: i- followed by alphanumeric characters) or AWS::EC2::KeyPair::KeyName for SSH key pairs, ensuring inputs are restricted to valid resources in the user's region and account. These types enhance and by preventing invalid entries at runtime. Input validation extends beyond basic constraints through the Rules section, where custom logic—using functions like Fn::Equals or Fn::Or—can assert conditions on one or more parameters before stack operations proceed, such as requiring a specific value combination for production environments. This feature, evaluated early in the process, helps catch errors without provisioning resources. Templates are limited to 200 parameters to maintain manageability.

Mappings

In AWS CloudFormation, the Mappings section provides a mechanism for defining static lookup tables within a , allowing users to specify conditional values based on predefined key-value pairs, such as region-specific configuration details like (AMI) IDs. These mappings are structured as nested dictionaries in or format, where the top-level key represents a (e.g., region), the second-level key specifies a sub-category (e.g., instance type), and the value holds the corresponding data, such as a resource identifier. Keys must be literal strings, and values can be strings, numbers, or lists, but mappings cannot include parameters, pseudo parameters, or other intrinsic functions, ensuring they remain fixed at template compilation time. The syntax for declaring mappings appears under the top-level "Mappings" key in the template. For example, in :
json
"Mappings": {
  "RegionMap": {
    "us-east-1": {
      "AMI": "ami-0abcdef1234567890"
    },
    "us-west-2": {
      "AMI": "ami-0fedcba0987654321"
    }
  }
}
In , it is similarly structured but with indentation:
yaml
Mappings:
  RegionMap:
    us-east-1:
      AMI: ami-0abcdef1234567890
    us-west-2:
      AMI: ami-0fedcba0987654321
To retrieve a value from a , the Fn::FindInMap is used elsewhere in the template, such as in resource properties. The function takes three arguments: the logical name of the mapping, the top-level key, and the second-level key. For instance, in :
json
{
  "Fn::FindInMap": [
    "RegionMap",
    { "Ref": "AWS::Region" },
    "AMI"
  ]
}
This returns the appropriate AMI ID based on the stack's deployment region. A practical example involves mapping instance types by region for an EC2 launch configuration, where us-east-1 might map to t3.micro and eu-west-1 to t3a.micro, enabling portable templates across environments without hardcoding values. Mappings are inherently static and evaluated only during template processing, prohibiting any dynamic computation or runtime modifications; for user-supplied variability, they can be combined with parameters in functions like Fn::FindInMap. If a specified key does not exist in the mapping, the stack creation fails, as there are no built-in default values unless the AWS::LanguageExtensions transform is enabled for enhanced functionality, which as of supports default values and additional intrinsics in Fn::FindInMap. This design promotes reusability for common, predefined lookups while limiting complexity to maintain template predictability.

Conditions

In AWS CloudFormation, the Conditions section enables the dynamic inclusion or configuration of resources and other elements based on predefined expressions evaluated during stack creation or updates. These conditions are declared as a top-level key in the , using intrinsic functions to define logical statements that return true or false, allowing templates to adapt to varying inputs such as parameters or pseudo-parameters without requiring multiple versions. Conditions are applied by referencing their logical IDs in the Condition attribute of resources or outputs; if a condition evaluates to true, the associated entity is created or configured accordingly, while false results in its omission, and any dependent entities are also skipped to maintain stack integrity. This mechanism supports conditional logic for scenarios like environment-specific deployments, where resources such as storage volumes might only provision in production but not in development. Intrinsic functions form the core of condition definitions, with Fn::Equals comparing two values for equality (e.g., checking if a parameter matches "prod"), Fn::And requiring all specified conditions to be true, and others like Fn::Or, Fn::Not, and Fn::Or enabling complex boolean combinations. For conditional values rather than resource creation, the Fn::If intrinsic function selects between two outcomes based on a condition's result, such as assigning different EC2 instance types: {"Fn::If": [{"Equals": [{"Ref": "Environment"}, "production"]}, "m5.large", "t3.micro"]} for the InstanceType property. A practical example involves an environment parameter (e.g., "dev" or "prod") to conditionally create an EBS volume attached to an EC2 instance only in production, defined as a condition like {"IsProduction": {"Fn::Equals": [{"Ref": "Environment"}, "prod"]}} and referenced in the volume's Condition attribute, ensuring cost efficiency in non-production setups.

Resources

The Resources section is the core and required component of an AWS CloudFormation , where all AWS to be provisioned and configured within a are declared. Each is defined using a unique logical ID, which serves as an alphanumeric identifier (consisting of A-Za-z0-9 characters) for referencing within the . The logical ID distinguishes and enables CloudFormation to manage them during creation, updates, and deletion. Resource declarations specify a Type, such as AWS::EC2::Instance for an Amazon EC2 instance or AWS::S3::Bucket for an bucket, drawn from the official AWS resource types reference. These types determine the supported properties, which configure the resource's attributes—for instance, ImageId and InstanceType for an EC2 instance. Properties are type-specific and validated against the AWS CloudFormation resource specification, a schema that enforces data types (e.g., String, Number, List), required fields, and allowed values to ensure template correctness before provisioning. Dynamic values in properties can be constructed using intrinsic functions, such as Ref to retrieve a resource's physical name or Fn::GetAtt to access attributes like an EC2 instance's private , allowing resources to reference each other without hardcoding. For example, in syntax:
yaml
Resources:
  MyEC2Instance:
    Type: AWS::EC2::Instance
    Properties:
      ImageId: !Ref LatestAmiId  # Intrinsic reference to a parameter
      InstanceType: t3.micro
      SecurityGroupIds:
        - !Ref MySecurityGroup
CloudFormation supports both implicit and explicit dependencies among resources to control provisioning order. Implicit dependencies arise automatically when one resource references another via intrinsics like Ref or Fn::GetAtt, prompting CloudFormation to create the referenced resource first and resolve values during stack operations. Explicit dependencies can be declared using the DependsOn attribute, which accepts a single logical ID or a list thereof, ensuring a resource is created only after the specified dependencies—for example, an EC2 instance depending on a security group or database. CloudFormation resolves these dependencies to parallelize independent creations where possible while honoring the order, reducing deployment time; during updates or deletions, it similarly prioritizes dependents. Properties may incorporate values from parameters or conditions defined elsewhere in the template to enable customization. For modularity, resources can include nested stacks via the AWS::CloudFormation::Stack type, which embeds another template (specified by a TemplateURL property, such as an S3 URL) as a child resource within the parent stack. This allows complex infrastructures to be composed from reusable templates, with parameters passed to the nested stack and outputs referenced using intrinsics like Fn::GetAtt for attributes such as ARNs. Nested stacks appear as resources in the parent stack's console view, facilitating hierarchical management without exceeding template size limits.

Outputs

In AWS CloudFormation, the Outputs section declares values that capture and expose details from the resources provisioned in a , enabling their use in other stacks or for operational reference. This optional section is defined under the "Outputs" in the and can include up to 200 output declarations, each identified by a unique logical ID that follows alphanumeric . Each output consists of required such as Description—an optional string up to 1024 bytes for contextual explanation—and Value, which specifies the output's content using literals, references, or intrinsic functions like !Ref to reference a resource directly or !GetAtt to retrieve specific attributes of a resource. Additionally, an optional Export property allows the output to be named and shared across stacks within the same AWS account and , facilitating modular designs. Outputs become available after the stack reaches a complete , such as CREATE_COMPLETE or UPDATE_COMPLETE, and can be viewed through the AWS Management Console under the stack's Outputs tab or via the AWS CLI command aws cloudformation describe-stacks. For cross-stack usage, exported outputs are imported into another template using the Fn::ImportValue, which references the export name to retrieve the value— for instance, importing a VPC ID from one stack to configure networking in another. This mechanism supports reusable templates by decoupling resource creation from dependency resolution, though export names must remain unique per Region and account to avoid conflicts. Practical examples illustrate the versatility of outputs. Consider a template provisioning an Amazon EC2 instance; an output might use !GetAtt to return the instance's public IP address as follows in :
yaml
Outputs:
  InstanceIP:
    Description: Public IP of the EC2 instance
    Value: !GetAtt MyEC2Instance.PublicIp
    Export:
      Name: !Sub "${AWS::StackName}-InstanceIP"
This exposes the IP for external use. Similarly, for an bucket, an output could export the bucket name with !Ref MyS3Bucket, allowing other stacks to reference it for data sharing without hardcoding identifiers. Security considerations are paramount when defining outputs, as they display values in the console and CLI without redaction, potentially exposing sensitive information like access keys if not handled carefully. Best practices recommend avoiding the export of confidential data and instead using AWS Secrets Manager for secure handling, while regularly reviewing outputs to ensure compliance with organizational policies.

Metadata

The Metadata section in an AWS CloudFormation is an optional top-level key that allows users to include additional non-executable information in or format, such as custom key-value pairs for documentation purposes or predefined AWS keys for specific functionalities. This section serves to provide contextual details about the template, like ownership or team information, without influencing the provisioning process. For instance, custom might describe resource groups, as in the following YAML example:
yaml
Metadata:
  Instances:
    Description: "Information about the instances"
  Databases:
    Description: "Information about the databases"
At the template level, the section can also include the AWS::CloudFormation::Interface key to customize the presentation of parameters in the AWS Management Console, such as grouping related parameters (e.g., network configuration) and assigning user-friendly labels to them. This enhances usability during stack creation or updates by organizing inputs logically, though it has no effect when using the AWS CLI or . An example in might group EC2 and VPC parameters:
json
"Metadata": {
  "AWS::CloudFormation::Interface": {
    "ParameterGroups": [
      {
        "Label": { "default": "Network Configuration" },
        "Parameters": [ "VPCID", "SubnetId" ]
      }
    ],
    "ParameterLabels": {
      "VPCID": { "default": "Which VPC should this be deployed to?" }
    }
  }
}
In addition to top-level usage, the attribute can be attached directly to individual resources to associate structured data, enabling extensions like initialization scripts. A primary use case is the AWS::CloudFormation::Init key within a resource's , which defines configuration tasks for resources such as Amazon EC2 instances, including installing packages, writing files, running commands, managing services, and creating users or groups. These tasks are executed by the cfn-init helper script, typically invoked in the resource's user data script during instance launch. For example, in an EC2 resource's declaration:
yaml
MyEC2Instance:
  Type: AWS::EC2::Instance
  Metadata:
    AWS::CloudFormation::Init:
      configSets:
        default:
          - InstallAndRun:
              Packages:
                yum:
                  httpd: []
              Files:
                /var/www/html/index.html:
                  content: |
                    <h1>Hello World from CloudFormation!</h1>
              Services:
                sysvinit:
                  httpd:
                    enabled: true
                    ensureRunning: true
  UserData:
    Fn::Base64: !Sub |
      #!/bin/bash -xe
      /opt/aws/bin/cfn-init -v --stack ${AWS::StackName} --resource MyEC2Instance --configsets default --region ${AWS::Region}
The AWS::CloudFormation::Init structure supports configSets for sequential task execution, with components like commands for running scripts, files for (which backs up existing files as .bak on updates), and services for . , whether at the template or level, is ignored by CloudFormation during stack provisioning and updates, functioning purely as informational or for tool-specific extensions like console interfaces or initialization helpers. It cannot be updated in isolation during stack updates; changes require accompanying modifications. Sensitive information, such as passwords, should not be stored in , as it is not encrypted or redacted in logs or outputs. While intrinsic functions, parameters, and pseudo parameters can be used within values, CloudFormation performs no validation on its syntax or content.

Transform and Rules

The Transform section in an AWS CloudFormation specifies one or more macros that CloudFormation processes during template validation and stack creation, enabling custom transformations such as text replacement or structural modifications to the template content. These macros are executed in the order listed, allowing for sequential processing that can simplify complex deployments by integrating higher-level abstractions, like those provided by AWS Serverless Application Model (). For instance, the AWS::Serverless transform converts SAM-specific syntax into standard CloudFormation resources, supporting serverless application definitions without requiring manual resource expansions. The syntax for the Transform section is a YAML or JSON list under the top-level key, where each entry identifies a macro by name, such as Transform: - AWS::Serverless. AWS provides hosted transforms like AWS::Include, which inserts content from an S3 object into the at a specified location, facilitating modular composition without external dependencies during processing. User-defined s can also be specified if previously registered via the AWS CloudFormation service, but they require appropriate permissions for execution. Transforms are applied during change set creation or direct stack updates, and the resulting processed can be inspected to verify the output before provisioning resources. In contrast, the Rules section provides an optional mechanism for custom parameter validation within a CloudFormation , enforcing or dependencies that exceed basic parameter constraints like AllowedValues or MinLength. It consists of one or more named rules, each containing a RuleCondition (optional) and Assertions (required), where assertions use intrinsic functions to evaluate parameters and must resolve to true for the stack operation to proceed; failure results in a validation with a configurable . This section is particularly useful for cross-parameter checks, such as ensuring an SSL is provided only when a custom domain is specified, thereby preventing invalid configurations early in the deployment process. Rules leverage a dedicated set of intrinsic functions, including Fn::Equals for exact matches, Fn::Or and Fn::And for logical combinations, and specialized functions like Fn::ValueOfAll to retrieve attributes (e.g., tags) from all parameters of a specific AWS type. For example, a rule might assert that an InstanceType parameter is contained within an approved list using Fn::Contains, or that all VPC IDs share a common tag value via Fn::EachMemberEquals, supporting up to 10 conditions per logical operator to maintain readability. These validations occur during creation or update, prior to resource provisioning, and do not affect the runtime behavior of deployed stacks. Together, Transform and Rules enhance template flexibility and reliability: Transforms focus on preprocessing for and , while Rules emphasize input validation to align deployments with organizational policies. Both sections are optional and positioned at the template's top level, integrating seamlessly with other elements like Parameters and Resources without altering their core semantics.

Examples

Basic Template Example

A basic CloudFormation template serves as an entry point for users to understand by defining a minimal set of AWS resources in a declarative format. This example focuses on creating a simple bucket, incorporating essential sections to parameterize the bucket name and add tags for organization, while exposing the bucket's ARN as an output for further use. Such templates demonstrate how CloudFormation automates resource provisioning without manual intervention through the AWS Management Console. The following YAML template illustrates these core concepts:
yaml
AWSTemplateFormatVersion: '2010-09-09'
Description: Basic S3 bucket template with parameterized name and tags.

Parameters:
  BucketName:
    Type: String
    Description: Unique name for the S3 bucket (must be globally unique).

Resources:
  S3Bucket:
    Type: AWS::S3::Bucket
    Properties:
      BucketName: !Ref BucketName
      Tags:
        - Key: Environment
          Value: Development
        - Key: Project
          Value: Example

Outputs:
  BucketArn:
    Description: ARN of the created S3 bucket
    Value: !GetAtt S3Bucket.Arn
This template begins with the AWSTemplateFormatVersion to specify compatibility with CloudFormation's syntax, followed by a brief Description. The Parameters section defines BucketName as a string input, allowing customization during stack creation without editing the template file. In the Resources section, the S3Bucket resource uses the AWS::S3::Bucket type and references the parameter via the intrinsic function !Ref for the bucket name; it also applies two tags for metadata tracking. Finally, the Outputs section returns the bucket's ARN using !GetAtt to access its attributes post-creation. To deploy this template, save it as basic-s3-template.yaml and use the AWS CLI. First, ensure the AWS CLI is installed and configured with appropriate credentials. Run the following command to create the stack, providing a value for the parameter:
aws cloudformation create-stack --stack-name basic-s3-stack --template-body file://basic-s3-template.yaml --parameters ParameterKey=BucketName,ParameterValue=my-unique-bucket-name
This initiates the stack creation process, where CloudFormation parses the , validates inputs, and provisions the S3 bucket. The command uses --template-body for local files under 51 KB; for larger templates, upload to Amazon S3 and use --template-url instead. Monitor progress with aws cloudformation describe-stacks --stack-name basic-s3-stack, which returns the stack status (e.g., CREATE_IN_PROGRESS or CREATE_COMPLETE). Once complete, verify the bucket exists in the AWS Management Console under or via aws s3api head-bucket --bucket my-unique-bucket-name. To delete the stack, use aws cloudformation delete-stack --stack-name basic-s3-stack, noting that the bucket will be retained if objects are present unless the DeletionPolicy: Delete attribute is added to the resource. Common pitfalls in basic templates include specifying invalid parameter types, such as non-string values for BucketName, which violates S3 naming rules (3-63 characters, lowercase letters, numbers, hyphens, periods) and causes validation errors during stack creation. Another issue is missing global uniqueness for the bucket name, leading to creation failures since S3 bucket names are shared across all AWS accounts worldwide. Additionally, omitting tags or outputs does not prevent deployment but limits resource management and integration with other services. Always validate the template syntax beforehand using aws cloudformation validate-template --template-body file://basic-s3-template.yaml to catch such errors early.

Advanced Template Example

An advanced CloudFormation template illustrates real-world infrastructure provisioning by combining networking resources like a VPC and EC2 instance with serverless components via the AWS Serverless Application Model (SAM) transform. This approach allows customization through parameters for environment variations, mappings for region-specific configurations such as AMI selection, conditions to toggle resource properties based on deployment context, and outputs to expose key stack artifacts for downstream use. The example below is a JSON template that creates a VPC with a public subnet, deploys an EC2 instance sized differently for development or production environments, and provisions a basic API Gateway with an integrated Lambda function using the SAM transform. It assumes an S3 bucket for Lambda code deployment and uses intrinsic functions for cross-references between resources.
json
{
  "AWSTemplateFormatVersion": "2010-09-09",
  "Transform": "AWS::Serverless-2016-10-31",
  "Parameters": {
    "EnvType": {
      "Type": "String",
      "Default": "dev",
      "AllowedValues": ["dev", "prod"],
      "Description": "Deployment environment for resource sizing"
    }
  },
  "Mappings": {
    "RegionToAMI": {
      "us-east-1": {
        "AMI": "ami-0abcdef1234567890"
      },
      "us-west-2": {
        "AMI": "ami-0fedcba0987654321"
      }
    }
  },
  "Conditions": {
    "ProductionEnvironment": {
      "Fn::Equals": [
        {
          "Ref": "EnvType"
        },
        "prod"
      ]
    }
  },
  "Resources": {
    "MyVPC": {
      "Type": "AWS::EC2::VPC",
      "Properties": {
        "CidrBlock": "10.0.0.0/16",
        "EnableDnsHostnames": true,
        "EnableDnsSupport": true,
        "Tags": [
          {
            "Key": "Name",
            "Value": "MyVPC"
          }
        ]
      }
    },
    "MyPublicSubnet": {
      "Type": "AWS::EC2::Subnet",
      "Properties": {
        "VpcId": {
          "Ref": "MyVPC"
        },
        "CidrBlock": "10.0.1.0/24",
        "MapPublicIpOnLaunch": true,
        "AvailabilityZone": {
          "Fn::Select": [
            0,
            {
              "Fn::GetAZs": ""
            }
          ]
        },
        "Tags": [
          {
            "Key": "Name",
            "Value": "MyPublicSubnet"
          }
        ]
      }
    },
    "MyEC2Instance": {
      "Type": "AWS::EC2::Instance",
      "Properties": {
        "InstanceType": {
          "Fn::If": [
            "ProductionEnvironment",
            "t3.medium",
            "t3.micro"
          ]
        },
        "ImageId": {
          "Fn::FindInMap": [
            "RegionToAMI",
            {
              "Ref": "AWS::Region"
            },
            "AMI"
          ]
        },
        "SubnetId": {
          "Ref": "MyPublicSubnet"
        },
        "Tags": [
          {
            "Key": "Name",
            "Value": "MyEC2Instance"
          }
        ]
      }
    },
    "HelloWorldFunction": {
      "Type": "AWS::Serverless::Function",
      "Properties": {
        "CodeUri": "s3://my-lambda-bucket/hello-world.zip",
        "Handler": "index.handler",
        "Runtime": "nodejs18.x",
        "Events": {
          "ApiEvent": {
            "Type": "Api",
            "Properties": {
              "Path": "/hello",
              "Method": "get"
            }
          }
        },
        "Tags": {
          "Project": "demo"
        }
      }
    }
  },
  "Outputs": {
    "VPCId": {
      "Description": "VPC ID",
      "Value": {
        "Ref": "MyVPC"
      },
      "Export": {
        "Name": {
          "Fn::Sub": "${AWS::StackName}-VPCId"
        }
      }
    },
    "EC2InstanceId": {
      "Description": "EC2 Instance ID",
      "Value": {
        "Ref": "MyEC2Instance"
      }
    },
    "ApiEndpoint": {
      "Description": "API Gateway Endpoint URL",
      "Value": {
        "Fn::Sub": "https://${ServerlessRestApi}.execute-api.${AWS::Region}.amazonaws.com/Prod/hello"
      }
    }
  }
}
This template leverages parameters to accept the EnvType value during stack creation, enabling flexible deployments across environments. Mappings provide region-specific AMIs for the EC2 instance via Fn::FindInMap, while conditions use Fn::If to adjust instance types based on production status. The SAM transform simplifies API Gateway and declarations, automatically generating the necessary REST API . Cross-references, such as the VPC ID in the properties, establish dependencies for ordered . To deploy, upload the to an S3 and create a via the AWS Console, AWS CLI, or SDK, providing the EnvType parameter. For updates, such as changing to production sizing, create a change set by submitting the modified or parameters; review it to assess impacts like instance type replacement, then execute to apply changes without where possible. This process ensures safe handling of updates by previewing resource modifications, including additions, updates, or deletions. CloudFormation integrates seamlessly with CI/CD workflows, such as AWS CodePipeline, where a pipeline can automatically validate, package, and deploy the template from a CodeCommit repository in response to code commits, enabling automated infrastructure updates across stages like build and deploy. A frequent troubleshooting scenario involves dependency cycles, such as when a security group references an EC2 instance's network interface while the instance references the group; this error ("Circular dependency") arises during stack creation. Resolution typically involves restructuring by creating the security group first without instance-specific references, then attaching it via DependsOn or using intrinsic functions like Fn::Sub for post-creation associations, breaking the cycle while preserving functionality.

Advanced Features

Drift Detection

Drift detection in AWS CloudFormation is a that identifies changes made to resources outside of CloudFormation's , by comparing the actual of resources—retrieved via AWS APIs—against the expected defined in the stack's template and parameters. This process helps maintain (IaC) compliance by highlighting discrepancies in resource properties, such as deletions, modifications, or additions not reflected in the template. The drift detection process can be initiated on an entire CloudFormation stack or on individual resources within a stack, using the AWS Management Console, AWS CLI, or API calls. For stacks, the detect-stack-drift CLI command or equivalent API starts an operation that evaluates all supported resources, provided the stack status is CREATE_COMPLETE, UPDATE_COMPLETE, UPDATE_ROLLBACK_COMPLETE, or UPDATE_ROLLBACK_FAILED. Individual resource detection uses the detect-stack-resource-drift command, specifying the stack name and logical resource ID, which updates both the resource's drift status and the overall stack status. Results are available via describe-stack-drift-detection-status or console views, showing detailed property differences, such as expected versus actual values (e.g., a Lambda function's DelaySeconds property changed from 20 to 120). Not all resources support drift detection; only those with defined properties in the template are evaluated, and nested stacks require separate operations. Drift statuses fall into specific categories to indicate synchronization levels. For stacks and resources, possible statuses include IN_SYNC (no differences detected), DRIFTED (differences exist), and NOT_CHECKED (no prior detection). Resource-specific details may show DELETED (resource removed outside CloudFormation) or MODIFIED (property changes), with granular breakdowns like added (green-highlighted), deleted (red-highlighted), or changed (yellow-highlighted) properties in console outputs. Operation statuses track progress as DETECTION_IN_PROGRESS, DETECTION_COMPLETE, or DETECTION_FAILED. Common use cases for drift detection include compliance auditing to ensure resources align with organizational policies and post-manual-change recovery to restore IaC governance after direct AWS console or API modifications. It supports proactive infrastructure management by revealing unauthorized changes that could affect stack updates or deletions. Additionally, CloudFormation integrates with Amazon EventBridge to emit "Drift Detection Status Change" events upon completion of detection operations, enabling automated alerts or workflows for monitoring stack drift across environments. Remediation of detected drift typically involves updating the to align actual configurations with the , using CloudFormation's capabilities, or importing drifted resources back under CloudFormation control to resolve discrepancies without recreation. For instance, after identifying a modified property, users can adjust parameters or the and execute a to synchronize states. This ensures ongoing manageability and prevents failures due to inconsistencies. In November 2025, AWS introduced drift-aware change sets, which enhance drift management by performing a between the new template, the last deployed template, and the actual resource state during change set creation. This feature allows users to preview the impact on drifted resources and automatically revert drift by aligning resources to the template, including recreating deleted resources if needed. Available via the console by selecting the "Drift-aware" type or using the --deployment-mode REVERT_DRIFT parameter in the CLI, it helps prevent unexpected deployment behaviors and improves security and reproducibility.

StackSets

AWS CloudFormation StackSets extend the functionality of stacks by enabling the creation, update, and deletion of stack instances across multiple AWS and Regions from a single administrator . A StackSet serves as a container for these stack instances, each of which is a stack deployed in a target and Region based on the same CloudFormation , allowing for consistent provisioning at an organizational . This capability integrates with AWS Organizations for service-managed permissions or uses delegated administrators to facilitate cross-account access without manual role creation. Operations on StackSets include creating a new StackSet to automatically deploy stacks to specified target accounts and Regions, updating the StackSet to propagate changes or overrides to all instances, and deleting the StackSet to remove associated stacks while optionally retaining them for independent management. Automatic deployments are supported through service-managed permissions, where AWS automatically creates the necessary roles and extends deployments to new accounts added to AWS Organizations. These operations ensure synchronized management, with progress tracked via stack instance statuses such as CURRENT, OUTDATED, or FAILED. Drift management in StackSets involves detecting configuration differences between the expected template-defined and the actual across all stack instances, triggered by unmanaged changes outside CloudFormation. Detection is performed using the detect-stack-set-drift operation, which evaluates each instance individually and reports the overall StackSet status as DRIFTED if any instance deviates, IN_SYNC if all match, or IN_PROGRESS during evaluation. To remediate drift, administrators review detailed results for drifted and initiate updates to realign instances with the template, ensuring compliance across the organization. StackSets are particularly suited for use cases requiring centralized in enterprise environments, such as deploying baseline security stacks like policies or VPC configurations uniformly across multiple accounts to enforce compliance and reduce operational overhead. They enable organizations to provision consistent , such as networking or resources, across AWS Regions and accounts linked via AWS Organizations, supporting scalable multi-account strategies without manual intervention in each environment.

Modules and Registry

The AWS CloudFormation Registry is a centralized repository that enables the management and distribution of extensions, including types, modules, and hooks, allowing users to integrate both AWS-provided and third-party capabilities into their templates as if they were native . It serves as a catalog for discoverable extensions published by AWS, AWS Partner Network (APN) partners, and third-party developers, while also supporting private registries for organization-specific custom extensions. types in the registry consist of structured schemas defining properties, attributes, and behaviors, along with handler code that implements operations via the Cloud Control API. This extensibility expands CloudFormation beyond core AWS services, enabling provisioning of resources from services like or directly in templates. Modules represent reusable, parameterized snippets of CloudFormation code that encapsulate common patterns, such as a VPC with associated subnets, groups, and networking rules, promoting and reducing duplication across stacks. They are declared using the AWS::CloudFormation::Module resource type, which specifies the module's version, parameters for customization, and the underlying fragment containing resources, conditions, and outputs. For instance, a VPC might accept parameters for CIDR blocks and instance types, generating compliant networking while enforcing best practices like least-privilege access. Modules integrate seamlessly with the registry, where they are published, versioned using semantic versioning (e.g., MAJOR.MINOR.PATCH), and automatically updated in referencing templates upon activation of new versions. In practice, users reference registry extensions in templates by their namespace-prefixed type names, such as AWS::MyCompany::CustomResource for a third-party resource or AWS::CloudFormation::[Module](/page/Module) for a , with CloudFormation handling activation, validation against schemas, and execution through registered handlers. Private registries allow organizations to host internal extensions without public exposure, maintaining control over custom resource types and tailored to workflows. Semantic versioning ensures , as minor updates add features without breaking existing stacks, while major versions may introduce incompatible changes requiring explicit updates. The CloudFormation Registry was initially introduced in 2019 to support private resource types, with modules added in November 2020 to facilitate reusable patterns and further extend template authoring beyond native AWS resources. A public registry launched in June 2021, providing a searchable collection of over 35 extensions at launch from APN partners and AWS Quick Starts, democratizing access to vetted third-party integrations.

Hooks

AWS CloudFormation Hooks provide a mechanism to proactively validate resource configurations during stack creation, updates, and deletions to ensure compliance with organizational policies on , operations, and cost optimization. These hooks consist of custom code, typically implemented as functions, that inspect templates, resources, or change sets before provisioning occurs. By registering hooks in the AWS CloudFormation Registry, users can enforce standards such as requiring for buckets or restricting insecure group rules in Amazon EC2. Hooks operate at specific invocation points: preCreate, preUpdate, and preDelete, allowing them to evaluate configurations in advance and either issue warnings for non-compliance or fail the operation to block invalid setups. For instance, a hook targeting the AWS::S3::Bucket resource type can check for and prevent creation if it is absent, thereby enforcing data protection policies. Custom hooks are developed using the CloudFormation CLI in languages like or , with a configurable timeout of 30 seconds and up to three retries per invocation. Configuration of hooks includes specifying target types—such as resources (), stacks (), change sets (CHANGE_SET), or Cloud Control API operations (CLOUD_CONTROL)—and the actions they monitor (CREATE, , DELETE). Logging is integrated with Amazon CloudWatch Logs, where error details and invocation outputs are sent to a designated log group for and hook executions. This setup enables centralized visibility into checks across multiple accounts and regions when deployed via StackSets. Introduced in general availability in February 2022, CloudFormation Hooks have been enhanced in November 2024 to include stack and change set invocation points, simplifying authoring and integration with AWS Cloud Control API for broader proactive controls. In November 2025, Hooks added granular invocation details, providing detailed findings, severity levels, and remediation advice directly in the Hooks console, along with control-level status (passed, failed, skipped). This update, building on the September 2025 Hooks Invocation Summary, accelerates troubleshooting and compliance reporting by eliminating guesswork in identifying specific failures. Common use cases involve automating security validations, such as mandating multi-factor authentication for IAM users or ensuring automated backups for Amazon RDS instances, reducing manual oversight in infrastructure as code deployments.

Pre-deployment Validation

AWS CloudFormation introduced pre-deployment validation in November 2025 to validate templates during change set creation, catching errors before deployment. This feature operates in two modes: FAIL, which blocks change set execution for critical issues like syntax errors or naming conflicts (e.g., invalid ARNs or missing properties), and WARN, which allows creation but flags non-critical issues like attempting to delete a non-empty S3 bucket, requiring manual review. It checks resource properties, naming conflicts, and S3 bucket states, providing immediate feedback via the DescribeEvents to reduce deployment failures and rollbacks. Integrated into pipelines, it enhances efficiency by identifying issues in seconds.

Stack Refactoring

In February 2025, AWS CloudFormation launched stack refactoring, enabling users to reorganize resources across stacks without recreating them or causing downtime. This feature supports moving resources between stacks, splitting monolithic stacks into modular ones, and renaming logical IDs, with a preview capability to assess changes before execution. The atomic workflow ensures safe refactoring, making it ideal for evolving architectures, improving lifecycle management, and aligning with updated naming conventions. Users can perform refactoring by updating templates and using the AWS Management Console, CLI, or SDK.

History and Milestones

Launch and Early Development

AWS CloudFormation was announced on February 25, 2011, marking ' initial foray into (IaC) by enabling users to model, provision, and manage AWS resources through declarative templates that ensured predictable and repeatable deployments. At its launch, the service provided foundational support for core AWS offerings, including Amazon EC2 instances for compute, Amazon RDS for relational databases, and for , allowing users to define entire application stacks encompassing these resources via simple text-based templates. This capability addressed the escalating demand for automated management as AWS rapidly expanded its portfolio, helping developers and businesses avoid manual configuration errors and accelerate application deployment in a growing . The early version of CloudFormation relied exclusively on JSON-formatted templates to describe resources, parameters, and dependencies, with core operations limited to creating, updating, and deleting stacks as unified units of resources. Integration with other AWS services, such as for application orchestration, was available from the outset through dedicated resource types like AWS::ElasticBeanstalk::Environment, enabling seamless provisioning of managed environments within stacks. These features emphasized simplicity and reliability, positioning CloudFormation as a tool for IT teams to version-control alongside application , thereby reducing operational overhead amid AWS's proliferation. Subsequent enhancements in the early years solidified CloudFormation's foundational role. Early enhancements included support for nested stacks, with 2013 updates enabling parallel stack processing and simultaneous updates to top-level and nested stacks, facilitating modular and scalable designs by treating child stacks as single resources within a parent stack. By 2014, support expanded to include for data warehousing and advanced Auto Scaling features like scheduled actions, broadening the service's applicability to analytics and dynamic workloads. In 2015, key additions such as AWS Lambda-backed custom resources enabled extensibility for non-native AWS integrations, while the launch of CloudFormation Designer provided a visual interface for template authoring, further lowering barriers to adoption and enhancing usability for complex stack management up to the mid-2010s.

Major Updates and Evolutions

In , AWS CloudFormation introduced the CloudFormation Registry, enabling users to extend the service with custom resource types for modeling, provisioning, and managing third-party AWS and on-premises resources directly within templates. This update also included enhancements to macros, allowing for more flexible template transformations and reuse of common patterns across stacks. These changes addressed scalability challenges in resource coverage, laying the groundwork for broader ecosystem integration. By 2020, CloudFormation launched modules as a standardized way to package and share reusable components, simplifying the creation of complex infrastructures. Additionally, the service increased the maximum nested depth from 5 to 10 levels, enabling deeper hierarchical deployments without performance degradation. These evolutions improved modularity and reduced complexity for large-scale applications. In 2021, CloudFormation introduced Hooks, a and governance feature that allows pre- and post-deployment validations to enforce organizational policies during stack creation or updates. This addition empowered teams to integrate and checks natively, enhancing control over changes without custom scripting. From 2023 to 2024, CloudFormation added a timeline view in 2024 for visualizing deployment histories and resource changes, aiding in and auditing stack operations. Stack deployments became 40% faster on average through optimized processing and parallelization improvements. Troubleshooting was streamlined with enhanced error messaging and integrated logging, reducing resolution times for common issues like resource conflicts. In 2025, CloudFormation released stack refactoring in February, permitting the reorganization of resources across stacks without downtime or recreation, facilitating easier maintenance of evolving infrastructures. In March 2025, AWS CloudFormation Hooks expanded to support new invocation targets for stacks, change sets, and the Cloud Control API, along with managed hooks using functions and rules, now available in AWS GovCloud () Regions. In September 2025, CloudFormation Hooks introduced managed proactive controls for validating resource configurations against AWS best practices. In November 2025, Hooks added granular invocation details to provide deeper insights into control-level findings and remediation suggestions. Looking ahead, future developments in CloudFormation emphasize deeper AI integration for automated template generation from natural language descriptions or architectural diagrams, accelerating IaC adoption. Broader support for third-party and on-premises resources is anticipated through Registry expansions, enhancing integration for hybrid environments. These trends will further enable advanced features like Drift Detection and StackSets by simplifying their configuration and scaling.

References

  1. [1]
    What is AWS CloudFormation? - AWS CloudFormation
    AWS CloudFormation is a service that helps you model and set up AWS resources using templates, handling provisioning and configuration.How CloudFormation works · Creating your first stack · HealthCheckConfig
  2. [2]
    Introducing AWS CloudFormation
    Feb 25, 2011 · A new service that gives developers and businesses an easy way to create a collection of AWS resources and provision them in an orderly and predictable fashion.
  3. [3]
    How CloudFormation works - AWS Documentation
    When you use CloudFormation, you manage related resources as a single unit called a stack. You create, update, and delete a collection of resources.Key concepts · How CloudFormation works
  4. [4]
    Provision Infrastructure as Code - AWS CloudFormation
    AWS CloudFormation is an infrastructure as code (IaC) service that allows you to easily model, provision, and manage AWS and third-party resources.Getting Started · Pricing · FAQs · Features
  5. [5]
    AWS CloudFormation features
    CloudFormation allows you to model your entire cloud environment in text files. You can use open-source declarative languages, such as JSON or YAML, to describe ...Missing: cases | Show results with:cases
  6. [6]
    Managing AWS resources as a single unit with AWS ...
    A stack is a collection of AWS resources that you can manage as a single unit. In other words, you can create, update, and delete a collection of resources.Nested stacks · Examples of CloudFormation... · Update stacks directly
  7. [7]
    DependsOn attribute - AWS CloudFormation
    The DependsOn attribute specifies that a resource's creation follows another, ensuring it's created after the specified resource. It can override default ...
  8. [8]
    DeletionPolicy attribute - AWS CloudFormation
    To keep a resource when its stack is deleted, specify Retain for that resource. You can use Retain for any resource. For example, you can retain a nested stack, ...
  9. [9]
    Understand CloudFormation quotas - AWS Documentation
    For example, you can have a nested stack hierarchy with more than 2500 total resources, but you can't create, update, or delete more than 2500 of those ...
  10. [10]
    Split a template into reusable pieces using nested stacks
    This example demonstrates how you can take a single, large CloudFormation template and reorganize it into a more structured and reusable design using nested ...Missing: versioning | Show results with:versioning
  11. [11]
    DescribeStackEvents - AWS CloudFormation
    Returns all stack related events for a specified stack in reverse chronological order. For more information about a stack's event history, see Understand ...
  12. [12]
    CloudFormation template format - AWS Documentation
    CloudFormation templates can be in JSON or YAML. JSON uses braces/brackets, while YAML uses indentation. Both have different sections, and YAML allows comments.
  13. [13]
    Working with CloudFormation templates - AWS Documentation
    This section provides a comprehensive guide on how to use the different sections of a CloudFormation template and how to start creating stack templates.<|control11|><|separator|>
  14. [14]
    CloudFormation best practices - AWS Documentation
    Best practices are recommendations that can help you use CloudFormation more effectively and adopt safe practices throughout its entire workflow.
  15. [15]
    Create reusable resource configurations that can be included across ...
    CloudFormation modules package resource configurations for inclusion across templates, enabling reusable, predictable, and manageable resource configurations.
  16. [16]
    Overview of Service Catalog - AWS Documentation
    With template constraints, you reuse generic AWS CloudFormation templates for products and apply restrictions to the templates on a per-product or per ...Missing: reusability | Show results with:reusability
  17. [17]
    Intrinsic function reference - AWS CloudFormation
    CloudFormation provides several built-in functions that help you manage your stacks. Use intrinsic functions in your templates to assign values to properties ...
  18. [18]
    validate-template — AWS CLI 2.31.34 Command Reference
    Validates a specified template. CloudFormation first checks if the template is valid JSON. If it isn't, CloudFormation checks if the template is valid YAML.
  19. [19]
    Update CloudFormation stacks using change sets
    The following diagram summarizes how you use change sets to update a stack: Diagram showing four steps to update a stack using CloudFormation change sets.
  20. [20]
    Create a change set for a CloudFormation stack - AWS Documentation
    To create a change set for a running stack, submit the changes that you want to make by providing a modified template, new input parameter values, or both.
  21. [21]
    View a change set for a CloudFormation stack - AWS Documentation
    To view a change set, open the AWS CloudFormation console at https://console.aws.amazon.com/cloudformation. Choose the name of the change set that you want to ...
  22. [22]
    Execute a change set for a CloudFormation stack
    To execute a change set (AWS CLI) Run the execute-change-set command. Specify the change set ID of the change set that you want to execute.
  23. [23]
    Change sets for nested stacks - AWS CloudFormation
    Nov 18, 2020 · With change sets for nested stacks you can preview the changes to your application and infrastructure resources across the entire nested stack hierarchy.
  24. [24]
    AWS CloudFormation ChangeSets now offer enhanced change ...
    Apr 16, 2024 · ChangeSets show the resources that CloudFormation will create, update, replace, or delete in a deployment.
  25. [25]
    CloudFormation template sections - AWS Documentation
    CloudFormation templates have sections like Resources (required), Parameters, Outputs, Mappings, Metadata, Rules, Conditions, and Transform, each serving a ...
  26. [26]
    Step 1: Download the AWS CloudFormation template
    AWSTemplateFormatVersion (optional) – The version of the AWS Template Format used to create this template. The latest template format version is 2010-09-09 and ...
  27. [27]
    CloudFormation template Parameters syntax - AWS Documentation
    Customize the resources being provisioned by defining input parameters in the Parameters section of a CloudFormation template.<|control11|><|separator|>
  28. [28]
  29. [29]
    CloudFormation template Rules syntax - AWS Documentation
    This section contains rule functions that validate parameter values before CloudFormation creates or updates any resources.
  30. [30]
    CloudFormation template Mappings syntax - AWS Documentation
    The Mappings section creates key-value pairs to specify values based on conditions. Each map is a key followed by another mapping, with keys as literal strings.
  31. [31]
    Fn::FindInMap - AWS CloudFormation
    The intrinsic function Fn::FindInMap returns the value corresponding to keys in a two-level map that's declared in the Mappings section. Declaration. JSON. { " ...
  32. [32]
    CloudFormation template Conditions syntax - AWS Documentation
    You can use conditions when you want to reuse a template to create resources in different contexts, such as test versus production environments. For example, in ...<|separator|>
  33. [33]
    Condition attribute - AWS CloudFormation
    The Condition attribute in CloudFormation controls resource creation based on conditions. Resources are created only when the condition evaluates to true.
  34. [34]
  35. [35]
    CloudFormation template Resources syntax - AWS Documentation
    These functions allow you to create dependencies between resources and pass values from one resource to another.
  36. [36]
    AWS resource and property types reference - AWS CloudFormation
    This section contains reference information for all AWS resource and property types that are supported by AWS CloudFormation.
  37. [37]
    CloudFormation resource specification - AWS Documentation
    The AWS CloudFormation resource specification is a JSON-formatted text file that defines the resources and properties that CloudFormation supports.<|control11|><|separator|>
  38. [38]
    CloudFormation template Outputs syntax - AWS Documentation
    The Outputs section declares output values for a stack, used to capture resource details, and is defined with the key name 'Outputs' in the template.
  39. [39]
    Get exported outputs from a deployed CloudFormation stack - AWS CloudFormation
    ### Summary of Using Outputs for Cross-Stack References, Fn::ImportValue, Viewing Outputs, and Security in AWS CloudFormation
  40. [40]
    CloudFormation template Metadata syntax - AWS Documentation
    Metadata stores additional info using JSON or YAML, including custom key-value pairs. Custom metadata syntax is shown in JSON and YAML examples.
  41. [41]
    CloudFormation::Interface metadata - AWS Documentation
    AWS::CloudFormation::Interface is a metadata key that defines how parameters are grouped and sorted in the CloudFormation console.
  42. [42]
    Metadata attribute - AWS CloudFormation
    The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON or YAML ...
  43. [43]
    cfn-init - AWS CloudFormation
    In a CloudFormation template, you can use AWS::CloudFormation::Init within the Metadata section of an Amazon EC2 resource to define initialization tasks.
  44. [44]
    CloudFormation template Transform section - AWS Documentation
    The Transform section specifies macros that CloudFormation uses to process templates, performing tasks like text replacement or extensive transformations.  ...
  45. [45]
    Transform reference - AWS CloudFormation
    Transforms are macros hosted by CloudFormation, usable in any account without special permissions or charges. They are treated like other macros.
  46. [46]
    AWS::Include transform - AWS CloudFormation - AWS Documentation
    The AWS::Include transform inserts file content from an S3 URI into a CloudFormation template, similar to an include directive.
  47. [47]
  48. [48]
    Rule functions - AWS CloudFormation
    These functions help you validate parameter values using custom logic. All validations occur before CloudFormation creates or updates any resources. Rules are ...
  49. [49]
    AWS::S3::Bucket - AWS CloudFormation - AWS Documentation
    The Fn::GetAtt intrinsic function returns a value for a specified attribute of this type. The following are the available attributes and sample return values.LifecycleConfiguration · NotificationConfiguration · ReplicationConfiguration · Rule
  50. [50]
    create-stack — AWS CLI 2.31.34 Command Reference
    Creates a stack as specified in the template. After the call completes successfully, the stack creation starts. You can check the status of the stack through ...
  51. [51]
    Create a stack from the CloudFormation console
    You can create a stack template and then use it to create a stack using either the CloudFormation console or a command line tool.
  52. [52]
  53. [53]
    Continuous delivery with CodePipeline - AWS CloudFormation
    CodePipeline has built-in integration with CloudFormation, so you can specify CloudFormation-specific actions, such as creating, updating, or deleting a stack, ...
  54. [54]
    How do I resolve circular dependencies with AWS SAM templates in ...
    To resolve the circular dependency, replace the dynamic reference to the bucket resource. The replacement breaks the loop.
  55. [55]
    Detect unmanaged configuration changes to stacks and resources ...
    Drift detection identifies changes made outside CloudFormation, comparing expected and actual resource configurations to detect if a stack has drifted.
  56. [56]
    Detect drift on individual stack resources - AWS CloudFormation
    To detect drift on an individual resource using the AWS CLI, use the detect-stack-resource-drift command. Specify the logical ID of the resource and the stack ...
  57. [57]
    Monitoring CloudFormation and Git sync events with EventBridge
    CloudFormation sends events to EventBridge whenever a create, update, delete, or drift-detection operation is performed on a stack.
  58. [58]
    Remediate drift via resource import with AWS CloudFormation
    Mar 26, 2020 · By combining the drift detection and resource import features, we've given you the ability remediate some drift cases, in a safe and efficient way.
  59. [59]
    Managing stacks across accounts and Regions with StackSets
    AWS CloudFormation StackSets extends the capability of stacks by allowing you to create, update, or delete stacks across multiple accounts and AWS Regions ...
  60. [60]
    StackSets concepts - AWS CloudFormation
    A StackSet serves as a container for multiple stacks that are deployed across specified AWS accounts and Regions. Each stack is based on the same CloudFormation ...
  61. [61]
    Performing drift detection on CloudFormation StackSets
    Describes how to perform drift detection on StackSets. Drift detection determines if StackSet stack instances differ from their expected configuration.
  62. [62]
    Use CloudFormation StackSets to Provision Resources Across ...
    Jul 25, 2017 · Use CloudFormation StackSets to Provision Resources Across Multiple AWS Accounts and Regions · Introducing StackSet. In order to address these ...
  63. [63]
    Managing extensions with the CloudFormation registry
    The AWS CloudFormation registry serves as a centralized hub for managing extensions that can be integrated into the CloudFormation templates in your AWS ...
  64. [64]
    CloudFormation registry concepts - AWS Documentation
    This topic explains key concepts to help you understand and begin using the CloudFormation registry.
  65. [65]
    Introducing a Public Registry for AWS CloudFormation
    Jun 21, 2021 · A new public registry for CloudFormation, providing a searchable collection of extensions – resource types or modules – published by AWS, APN partners, third ...
  66. [66]
    Introducing AWS CloudFormation modules
    Nov 24, 2020 · Modules are building blocks that can be reused across multiple CloudFormation templates and is used just like a native CloudFormation resource.
  67. [67]
    Announcing a new Public Registry for AWS CloudFormation
    Jun 21, 2021 · Today, you can centrally search and use over 35 extensions published on the Public Registry by APN Partners and AWS Quick Starts.Missing: date | Show results with:date
  68. [68]
    What are AWS CloudFormation Hooks?
    AWS CloudFormation Hooks is a feature that helps ensure that your CloudFormation resources, stacks, and change sets comply with your organization's security, ...
  69. [69]
    AWS CloudFormation Hooks concepts
    A Hook contains code that is invoked immediately before CloudFormation creates, updates, or deletes stacks or specific resources.
  70. [70]
    Developing custom Hooks using the CloudFormation CLI
    Learn to initiate, model, and register your own AWS CloudFormation Hooks with Python or Java.
  71. [71]
    Creating and managing AWS CloudFormation Hooks
    AWS CloudFormation Hooks provide a mechanism to evaluate your CloudFormation resources before allowing stack creation, modification, or deletion.
  72. [72]
    AWS::CloudFormation::HookVersion LoggingConfig
    The Amazon CloudWatch Logs group to which CloudFormation sends error logging information when invoking the extension's handlers.
  73. [73]
    View logs for the Lambda Hooks in your account
    To view the Lambda Hook output log file, choose Start. The log will display in the CloudWatch Logs Live Trail window. Choose View in columns or View in plain ...
  74. [74]
    AWS Announces the General Availability of AWS CloudFormation ...
    Feb 10, 2022 · AWS announces the general availability of AWS CloudFormation Hooks, a feature that allows customers to invoke custom logic to automate actions or inspect ...
  75. [75]
    AWS CloudFormation Hooks introduces stack and change set target ...
    Nov 20, 2024 · Discover more about what's new at AWS with AWS CloudFormation Hooks introduces stack and change set target invocation points.Missing: enhancements | Show results with:enhancements
  76. [76]
    Introducing AWS CloudFormation Hooks invoked via AWS Cloud ...
    Nov 21, 2024 · In this blog post, we will explore the integration between CloudFormation Hooks and CCAPI by configuring an existing hook to work with CCAPI and then test that ...Missing: enhancements | Show results with:enhancements
  77. [77]
    Amazon adds templates for cloud app deployment - Route Fifty
    GCN. | February 25, 2011. To ease the development and deployment of apps to the cloud, Amazon Web Services has launched its CloudFormation. To ease the ...Missing: announcement | Show results with:announcement
  78. [78]
    AWS CloudFormation User Guide - Amazon S3
    May 15, 2010 · When you use AWS CloudFormation, you work with templates and stacks.You create templates to describe your AWS resources and their properties.
  79. [79]
    AWS::ElasticBeanstalk::Environment - AWS CloudFormation
    The AWS::ElasticBeanstalk::Environment resource is an AWS Elastic Beanstalk resource type that specifies an Elastic Beanstalk environment.Missing: integration | Show results with:integration
  80. [80]
    AWS CloudFormation – Create Your AWS Stack From a Recipe
    Feb 25, 2011 · Using CloudFormation, you can create an entire stack with one function call. The stack can be comprised of multiple Amazon EC2 instances.
  81. [81]
    Parallel Stack Processing and Nested Stack Updates for AWS ...
    CloudFormation now creates, updates, and deletes resources in parallel in order to improve performance of these operations.
  82. [82]
    AWS CloudFormation Adds Support for Redshift and More
    Feb 10, 2014 · Support for the following AWS features was added in early 2014: Auto Scaling scheduled actions and block device properties; DynamoDB local and ...
  83. [83]
    AWS CloudFormation Supports AWS Lambda-Backed Custom ...
    CloudFormation simplifies the provisioning of a wide range of AWS resources, and also supports 'custom resources', which is an extensibility ...
  84. [84]
    Introducing AWS CloudFormation Designer for Visually Authoring ...
    AWS CloudFormation Designer is a new visual tool that shows your CloudFormation templates as a diagram and lets you edit your templates.
  85. [85]
    Now extend AWS CloudFormation to model, provision, and manage ...
    Discover more about what's new at AWS with Now extend AWS CloudFormation to model, provision, and manage third party resources.<|separator|>
  86. [86]
    The history and future roadmap of the AWS CloudFormation Registry
    May 4, 2023 · The CloudFormation service was first announced in February of 2011, with sample templates that showed how to deploy common applications like ...
  87. [87]
    2020 in Review for AWS CloudFormation
    Mar 11, 2021 · As we move into 2021, we would like to provide a recap of how AWS CloudFormation coverage changed in 2020 and offer you a look at new features.2020 In Review For Aws... · Resource Coverage · New CapabilitiesMissing: date | Show results with:date
  88. [88]
    AWS Infrastructure as Code Updates
    Nov 22, 2024 · AWS Infrastructure as Code: 2023 Review and 2024 Outlook - New Features for CloudFormation, CDK and More. Nov 22, 2024. Amazon Web Services. AWS ...
  89. [89]
    AWS CloudFormation: 2024 Year in Review
    Feb 17, 2025 · AWS CloudFormation enables you to model and provision your cloud application infrastructure as code-base templates.<|control11|><|separator|>
  90. [90]
    Reshape your AWS CloudFormation stacks seamlessly with stack ...
    Feb 6, 2025 · AWS CloudFormation introduces a new capability called stack refactoring that makes it easy to reorganize cloud resources across your ...
  91. [91]
    AWS CloudFormation Hooks' new invocation targets and managed ...
    Mar 12, 2025 · AWS CloudFormation Hooks now supports three new invocation points for stacks, change sets, and AWS Cloud Control API (CCAPI) in the AWS GovCloud (US) Regions.
  92. [92]
    Architecture to AWS CloudFormation code using Anthropic's Claude ...
    Sep 27, 2024 · In this post, we explore some ways you can use Anthropic's Claude 3 Sonnet's vision capabilities to accelerate the process of moving from architecture to the ...Architecture To Aws... · Solution Overview · PrerequisitesMissing: future | Show results with:future