Skip to main content

stacks

Creates, updates, deletes or gets a stack resource or lists stacks in a region

Overview

Namestacks
TypeResource
DescriptionThe AWS::CloudFormation::Stack resource nests a stack as a resource in a top-level template.
Idaws.cloudformation.stacks

Fields

NameDatatypeDescription
capabilitiesarray
role_arnstring
outputsarray
descriptionstring
disable_rollbackboolean
enable_termination_protectionboolean
notification_arnsarray
parametersobject
parent_idstring
root_idstring
change_set_idstring
stack_namestring
stack_idstring
stack_policy_bodyobject
stack_policy_urlstring
stack_statusstring
stack_status_reasonstring
tagsarray
template_bodyobject
template_urlstring
timeout_in_minutesinteger
last_update_timestring
creation_timestring
regionstringAWS region.

Methods

NameAccessible byRequired Params
create_resourceINSERTStackName, region
delete_resourceDELETEdata__Identifier, region
update_resourceUPDATEdata__Identifier, data__PatchDocument, region
list_resourcesSELECTregion
get_resourceSELECTdata__Identifier, region

SELECT examples

Gets all stacks in a region.

SELECT
region,
capabilities,
role_arn,
outputs,
description,
disable_rollback,
enable_termination_protection,
notification_arns,
parameters,
parent_id,
root_id,
change_set_id,
stack_name,
stack_id,
stack_policy_body,
stack_policy_url,
stack_status,
stack_status_reason,
tags,
template_body,
template_url,
timeout_in_minutes,
last_update_time,
creation_time
FROM aws.cloudformation.stacks
WHERE region = 'us-east-1';

Gets all properties from an individual stack.

SELECT
region,
capabilities,
role_arn,
outputs,
description,
disable_rollback,
enable_termination_protection,
notification_arns,
parameters,
parent_id,
root_id,
change_set_id,
stack_name,
stack_id,
stack_policy_body,
stack_policy_url,
stack_status,
stack_status_reason,
tags,
template_body,
template_url,
timeout_in_minutes,
last_update_time,
creation_time
FROM aws.cloudformation.stacks
WHERE region = 'us-east-1' AND data__Identifier = '<StackId>';

INSERT example

Use the following StackQL query and manifest file to create a new stack resource, using stack-deploy.

/*+ create */
INSERT INTO aws.cloudformation.stacks (
StackName,
region
)
SELECT
'{{ StackName }}',
'{{ region }}';

DELETE example

/*+ delete */
DELETE FROM aws.cloudformation.stacks
WHERE data__Identifier = '<StackId>'
AND region = 'us-east-1';

Permissions

To operate on the stacks resource, the following permissions are required:

Create

cloudformation:DescribeStacks,
cloudformation:CreateStack,
iam:PassRole

Update

cloudformation:DescribeStacks,
cloudformation:UpdateStack,
cloudformation:UpdateTerminationProtection,
cloudformation:SetStackPolicy,
iam:PassRole

Delete

cloudformation:DescribeStacks,
cloudformation:DeleteStack

Read

cloudformation:DescribeStacks,
cloudformation:GetStackPolicy,
cloudformation:GetTemplate

List

cloudformation:ListStacks