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 = '{{ region }}' 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 }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

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 }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

DELETE example

/*+ delete */
DELETE FROM awscc.cloudformation.stacks
WHERE
Identifier = '{{ stack_id }}' AND
region = '{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

Additional Parameters

Mutable resources in the Cloud Control provider support additional optional parameters which can be supplied with INSERT, UPDATE, or DELETE operations. These include:

ParameterDescription
ClientToken
A unique identifier to ensure the idempotency of the resource request.This allows the provider to accurately distinguish between retries and new requests.
A client token is valid for 36 hours once used.
After that, a resource request with the same client token is treated as a new request.
If you do not specify a client token, one is generated for inclusion in the request.
RoleArn
The ARN of the IAM role used to perform this resource operation.The role specified must have the permissions required for this operation.
If you do not specify a role, a temporary session is created using your AWS user credentials.
TypeVersionId
For private resource types, the type version to use in this resource operation.If you do not specify a resource version, the default version is used.

Permissions

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

cloudformation:DescribeStacks,
cloudformation:CreateStack,
iam:PassRole