# CloudFormation (/integrations/cloudformation)





{/* MANUAL-CONTENT-START:intro */}

Use [AWS CloudFormation](https://aws.amazon.com/cloudformation/) to manage template-defined resource stacks. Create or update stacks, preview changes with change sets, inspect resources and events, and check drift or template validity from a workflow.

{/* MANUAL-CONTENT-END */}

## Use the block [#usage-instructions]

Create, update, and delete stacks, preview changes with change sets, describe stacks, list resources, detect drift, view stack events, and retrieve or validate templates. Requires AWS access key and secret access key.

## Actions [#actions]

### CloudFormation Describe Stacks [#cloudformation-describe-stacks]

List and describe CloudFormation stacks

<ReferenceDetails>
  #### Input [#input]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `awsRegion` | string | Yes | AWS region (e.g., us-east-1) |
  | `awsAccessKeyId` | string | Yes | AWS access key ID |
  | `awsSecretAccessKey` | string | Yes | AWS secret access key |
  | `stackName` | string | No | Stack name or ID to describe (omit to list all stacks) |

  #### Output [#output]

  | Parameter | Type | Description |
  | - | - | - |
  | `stacks` | array | List of CloudFormation stacks with status, outputs, and tags |
</ReferenceDetails>

### CloudFormation Create Stack [#cloudformation-create-stack]

Create a new CloudFormation stack from a template

<ReferenceDetails>
  #### Input [#input-1]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `awsRegion` | string | Yes | AWS region (e.g., us-east-1) |
  | `awsAccessKeyId` | string | Yes | AWS access key ID |
  | `awsSecretAccessKey` | string | Yes | AWS secret access key |
  | `stackName` | string | Yes | Name for the new stack (must be unique in the Region) |
  | `templateBody` | string | Yes | The CloudFormation template body (JSON or YAML) |
  | `parameters` | json | No | Template input parameters (e.g., \[\{"parameterKey": "InstanceType", "parameterValue": "t3.micro"}]) |
  | `capabilities` | string | No | Comma-separated capabilities to acknowledge (CAPABILITY\_IAM, CAPABILITY\_NAMED\_IAM, CAPABILITY\_AUTO\_EXPAND) required when the template creates IAM resources or uses macros |
  | `tags` | json | No | Tags to apply to the stack and its resources (e.g., \[\{"key": "env", "value": "prod"}]) |
  | `onFailure` | string | No | Action to take on creation failure: ROLLBACK (default), DELETE, or DO\_NOTHING |
  | `timeoutInMinutes` | number | No | Amount of time before the stack creation times out and rolls back |

  #### Output [#output-1]

  | Parameter | Type | Description |
  | - | - | - |
  | `stackId` | string | The unique ID of the created stack |
</ReferenceDetails>

### CloudFormation Update Stack [#cloudformation-update-stack]

Update an existing CloudFormation stack with a new or previous template

<ReferenceDetails>
  #### Input [#input-2]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `awsRegion` | string | Yes | AWS region (e.g., us-east-1) |
  | `awsAccessKeyId` | string | Yes | AWS access key ID |
  | `awsSecretAccessKey` | string | Yes | AWS secret access key |
  | `stackName` | string | Yes | Name or ID of the stack to update |
  | `templateBody` | string | No | The new CloudFormation template body (JSON or YAML). Required unless usePreviousTemplate is true |
  | `usePreviousTemplate` | boolean | No | Reuse the template currently associated with the stack instead of providing templateBody |
  | `parameters` | json | No | Template input parameters (e.g., \[\{"parameterKey": "InstanceType", "parameterValue": "t3.micro"}]) |
  | `capabilities` | string | No | Comma-separated capabilities to acknowledge (CAPABILITY\_IAM, CAPABILITY\_NAMED\_IAM, CAPABILITY\_AUTO\_EXPAND) |
  | `tags` | json | No | Tags to apply to the stack and its resources (e.g., \[\{"key": "env", "value": "prod"}]) |

  #### Output [#output-2]

  | Parameter | Type | Description |
  | - | - | - |
  | `stackId` | string | The unique ID of the updated stack |
</ReferenceDetails>

### CloudFormation Delete Stack [#cloudformation-delete-stack]

Delete a CloudFormation stack and its resources

<ReferenceDetails>
  #### Input [#input-3]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `awsRegion` | string | Yes | AWS region (e.g., us-east-1) |
  | `awsAccessKeyId` | string | Yes | AWS access key ID |
  | `awsSecretAccessKey` | string | Yes | AWS secret access key |
  | `stackName` | string | Yes | Name or ID of the stack to delete |
  | `retainResources` | string | No | Comma-separated logical resource IDs to retain instead of deleting (only applies to stacks in DELETE\_FAILED state) |

  #### Output [#output-3]

  | Parameter | Type | Description |
  | - | - | - |
  | `message` | string | Operation status message |
</ReferenceDetails>

### CloudFormation Cancel Update Stack [#cloudformation-cancel-update-stack]

Cancel an in-progress stack update and roll back to the last known stable state

<ReferenceDetails>
  #### Input [#input-4]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `awsRegion` | string | Yes | AWS region (e.g., us-east-1) |
  | `awsAccessKeyId` | string | Yes | AWS access key ID |
  | `awsSecretAccessKey` | string | Yes | AWS secret access key |
  | `stackName` | string | Yes | Name or ID of the stack whose update should be cancelled |

  #### Output [#output-4]

  | Parameter | Type | Description |
  | - | - | - |
  | `message` | string | Operation status message |
</ReferenceDetails>

### CloudFormation Create Change Set [#cloudformation-create-change-set]

Preview the changes a stack create or update would make before applying them

<ReferenceDetails>
  #### Input [#input-5]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `awsRegion` | string | Yes | AWS region (e.g., us-east-1) |
  | `awsAccessKeyId` | string | Yes | AWS access key ID |
  | `awsSecretAccessKey` | string | Yes | AWS secret access key |
  | `stackName` | string | Yes | Name of the stack to create or update (new name for CREATE type, existing name for UPDATE) |
  | `changeSetName` | string | Yes | Name for the new change set |
  | `templateBody` | string | No | The CloudFormation template body (JSON or YAML). Required unless usePreviousTemplate is true |
  | `usePreviousTemplate` | boolean | No | Reuse the template currently associated with the stack (UPDATE change sets only) |
  | `parameters` | json | No | Template input parameters (e.g., \[\{"parameterKey": "InstanceType", "parameterValue": "t3.micro"}]) |
  | `capabilities` | string | No | Comma-separated capabilities to acknowledge (CAPABILITY\_IAM, CAPABILITY\_NAMED\_IAM, CAPABILITY\_AUTO\_EXPAND) |
  | `changeSetType` | string | No | CREATE (default, new stack), UPDATE (existing stack), or IMPORT (import existing resources) |
  | `description` | string | No | Description of the change set for reference |

  #### Output [#output-5]

  | Parameter | Type | Description |
  | - | - | - |
  | `changeSetId` | string | The unique ID of the created change set |
  | `stackId` | string | The unique ID of the target stack |
</ReferenceDetails>

### CloudFormation Describe Change Set [#cloudformation-describe-change-set]

View the resource changes a change set would make and its execution status

<ReferenceDetails>
  #### Input [#input-6]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `awsRegion` | string | Yes | AWS region (e.g., us-east-1) |
  | `awsAccessKeyId` | string | Yes | AWS access key ID |
  | `awsSecretAccessKey` | string | Yes | AWS secret access key |
  | `changeSetName` | string | Yes | Name or ARN of the change set to describe |
  | `stackName` | string | No | Name or ID of the stack the change set belongs to (required if changeSetName is not an ARN) |

  #### Output [#output-6]

  | Parameter | Type | Description |
  | - | - | - |
  | `changeSetName` | string | Name of the change set |
  | `changeSetId` | string | The unique ID of the change set |
  | `stackId` | string | The unique ID of the target stack |
  | `stackName` | string | Name of the target stack |
  | `description` | string | Description of the change set |
  | `executionStatus` | string | Whether the change set can be executed (AVAILABLE, UNAVAILABLE, EXECUTE\_IN\_PROGRESS, EXECUTE\_COMPLETE, EXECUTE\_FAILED, OBSOLETE) |
  | `status` | string | Current status of the change set (CREATE\_PENDING, CREATE\_IN\_PROGRESS, CREATE\_COMPLETE, DELETE\_COMPLETE, FAILED) |
  | `statusReason` | string | Reason for the current status, particularly if failed |
  | `creationTime` | number | Timestamp the change set was created |
  | `capabilities` | array | Capabilities required to execute the change set |
  | `changes` | array | List of resource changes (action, logical/physical resource ID, resource type, replacement) |
</ReferenceDetails>

### CloudFormation Execute Change Set [#cloudformation-execute-change-set]

Apply a previously created and reviewed change set to its stack

<ReferenceDetails>
  #### Input [#input-7]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `awsRegion` | string | Yes | AWS region (e.g., us-east-1) |
  | `awsAccessKeyId` | string | Yes | AWS access key ID |
  | `awsSecretAccessKey` | string | Yes | AWS secret access key |
  | `changeSetName` | string | Yes | Name or ARN of the change set to execute |
  | `stackName` | string | No | Name or ID of the stack the change set belongs to (required if changeSetName is not an ARN) |

  #### Output [#output-7]

  | Parameter | Type | Description |
  | - | - | - |
  | `message` | string | Operation status message |
</ReferenceDetails>

### CloudFormation List Stack Resources [#cloudformation-list-stack-resources]

List all resources in a CloudFormation stack

<ReferenceDetails>
  #### Input [#input-8]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `awsRegion` | string | Yes | AWS region (e.g., us-east-1) |
  | `awsAccessKeyId` | string | Yes | AWS access key ID |
  | `awsSecretAccessKey` | string | Yes | AWS secret access key |
  | `stackName` | string | Yes | Stack name or ID |

  #### Output [#output-8]

  | Parameter | Type | Description |
  | - | - | - |
  | `resources` | array | List of stack resources with type, status, and drift information |
</ReferenceDetails>

### CloudFormation Detect Stack Drift [#cloudformation-detect-stack-drift]

Initiate drift detection on a CloudFormation stack

<ReferenceDetails>
  #### Input [#input-9]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `awsRegion` | string | Yes | AWS region (e.g., us-east-1) |
  | `awsAccessKeyId` | string | Yes | AWS access key ID |
  | `awsSecretAccessKey` | string | Yes | AWS secret access key |
  | `stackName` | string | Yes | Stack name or ID to detect drift on |

  #### Output [#output-9]

  | Parameter | Type | Description |
  | - | - | - |
  | `stackDriftDetectionId` | string | ID to use with Describe Stack Drift Detection Status to check results |
</ReferenceDetails>

### CloudFormation Describe Stack Drift Detection Status [#cloudformation-describe-stack-drift-detection-status]

Check the status of a stack drift detection operation

<ReferenceDetails>
  #### Input [#input-10]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `awsRegion` | string | Yes | AWS region (e.g., us-east-1) |
  | `awsAccessKeyId` | string | Yes | AWS access key ID |
  | `awsSecretAccessKey` | string | Yes | AWS secret access key |
  | `stackDriftDetectionId` | string | Yes | The drift detection ID returned by Detect Stack Drift |

  #### Output [#output-10]

  | Parameter | Type | Description |
  | - | - | - |
  | `stackId` | string | The stack ID |
  | `stackDriftDetectionId` | string | The drift detection ID |
  | `stackDriftStatus` | string | Drift status (DRIFTED, IN\_SYNC, NOT\_CHECKED) |
  | `detectionStatus` | string | Detection status (DETECTION\_IN\_PROGRESS, DETECTION\_COMPLETE, DETECTION\_FAILED) |
  | `detectionStatusReason` | string | Reason if detection failed |
  | `driftedStackResourceCount` | number | Number of resources that have drifted |
  | `timestamp` | number | Timestamp of the detection |
</ReferenceDetails>

### CloudFormation Describe Stack Events [#cloudformation-describe-stack-events]

Get the event history for a CloudFormation stack

<ReferenceDetails>
  #### Input [#input-11]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `awsRegion` | string | Yes | AWS region (e.g., us-east-1) |
  | `awsAccessKeyId` | string | Yes | AWS access key ID |
  | `awsSecretAccessKey` | string | Yes | AWS secret access key |
  | `stackName` | string | Yes | Stack name or ID |
  | `limit` | number | No | Maximum number of events to return (default: 50) |

  #### Output [#output-11]

  | Parameter | Type | Description |
  | - | - | - |
  | `events` | array | List of stack events with resource status and timestamps |
</ReferenceDetails>

### CloudFormation Get Template [#cloudformation-get-template]

Retrieve the template body for a CloudFormation stack

<ReferenceDetails>
  #### Input [#input-12]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `awsRegion` | string | Yes | AWS region (e.g., us-east-1) |
  | `awsAccessKeyId` | string | Yes | AWS access key ID |
  | `awsSecretAccessKey` | string | Yes | AWS secret access key |
  | `stackName` | string | Yes | Stack name or ID |
  | `templateStage` | string | No | Which template version to retrieve: Processed (default, with transforms applied) or Original (as submitted) |

  #### Output [#output-12]

  | Parameter | Type | Description |
  | - | - | - |
  | `templateBody` | string | The template body as a JSON or YAML string |
  | `stagesAvailable` | array | Available template stages |
</ReferenceDetails>

### CloudFormation Get Template Summary [#cloudformation-get-template-summary]

Get a summary of a template or deployed stack: resource types, required capabilities, and parameters, without full validation

<ReferenceDetails>
  #### Input [#input-13]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `awsRegion` | string | Yes | AWS region (e.g., us-east-1) |
  | `awsAccessKeyId` | string | Yes | AWS access key ID |
  | `awsSecretAccessKey` | string | Yes | AWS secret access key |
  | `templateBody` | string | No | The CloudFormation template body (JSON or YAML). Required if stackName is not provided |
  | `stackName` | string | No | Name or ID of a deployed stack to summarize instead of a template body |

  #### Output [#output-13]

  | Parameter | Type | Description |
  | - | - | - |
  | `description` | string | Template description |
  | `parameters` | array | Template parameters with types, defaults, and descriptions |
  | `capabilities` | array | Required capabilities (e.g., CAPABILITY\_IAM) |
  | `capabilitiesReason` | string | Reason capabilities are required |
  | `resourceTypes` | array | AWS resource types declared in the template (e.g., AWS::S3::Bucket) |
  | `version` | string | Template format version |
  | `declaredTransforms` | array | Transforms used in the template (e.g., AWS::Serverless-2016-10-31) |
</ReferenceDetails>

### CloudFormation Validate Template [#cloudformation-validate-template]

Validate a CloudFormation template for syntax and structural correctness

<ReferenceDetails>
  #### Input [#input-14]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `awsRegion` | string | Yes | AWS region (e.g., us-east-1) |
  | `awsAccessKeyId` | string | Yes | AWS access key ID |
  | `awsSecretAccessKey` | string | Yes | AWS secret access key |
  | `templateBody` | string | Yes | The CloudFormation template body (JSON or YAML) |

  #### Output [#output-14]

  | Parameter | Type | Description |
  | - | - | - |
  | `description` | string | Template description |
  | `parameters` | array | Template parameters with defaults and descriptions |
  | `capabilities` | array | Required capabilities (e.g., CAPABILITY\_IAM) |
  | `capabilitiesReason` | string | Reason capabilities are required |
  | `declaredTransforms` | array | Transforms used in the template (e.g., AWS::Serverless-2016-10-31) |
</ReferenceDetails>
