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.
Idawscc.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.

For more information, see AWS::CloudFormation::Stack.

Methods

NameResourceAccessible byRequired Params
create_resourcestacksINSERTStackName, region
delete_resourcestacksDELETEIdentifier, region
update_resourcestacksUPDATEIdentifier, PatchDocument, region
list_resourcesstacks_list_onlySELECTregion
get_resourcestacksSELECTIdentifier, region

SELECT examples

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 awscc.cloudformation.stacks
WHERE
region = 'us-east-1' AND
Identifier = '{{ stack_id }}';

INSERT example

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

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

UPDATE example

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

/*+ update */
UPDATE awscc.cloudformation.stacks
SET PatchDocument = string('{{ {
"Capabilities": capabilities,
"RoleARN": role_arn,
"Description": description,
"DisableRollback": disable_rollback,
"EnableTerminationProtection": enable_termination_protection,
"NotificationARNs": notification_arns,
"Parameters": parameters,
"StackPolicyBody": stack_policy_body,
"StackPolicyURL": stack_policy_url,
"StackStatusReason": stack_status_reason,
"Tags": tags,
"TemplateBody": template_body,
"TemplateURL": template_url,
"TimeoutInMinutes": timeout_in_minutes
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ stack_id }}';

DELETE example

/*+ delete */
DELETE FROM awscc.cloudformation.stacks
WHERE
Identifier = '{{ stack_id }}' AND
region = 'us-east-1';

Permissions

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

cloudformation:DescribeStacks,
cloudformation:CreateStack,
iam:PassRole