stacks
Creates, updates, deletes or gets a stack
resource or lists stacks
in a region
Overview
Name | stacks |
Type | Resource |
Description | The AWS::CloudFormation::Stack resource nests a stack as a resource in a top-level template. |
Id | aws.cloudformation.stacks |
Fields
Name | Datatype | Description |
---|---|---|
capabilities | array | |
role_arn | string | |
outputs | array | |
description | string | |
disable_rollback | boolean | |
enable_termination_protection | boolean | |
notification_arns | array | |
parameters | object | |
parent_id | string | |
root_id | string | |
change_set_id | string | |
stack_name | string | |
stack_id | string | |
stack_policy_body | object | |
stack_policy_url | string | |
stack_status | string | |
stack_status_reason | string | |
tags | array | |
template_body | object | |
template_url | string | |
timeout_in_minutes | integer | |
last_update_time | string | |
creation_time | string | |
region | string | AWS region. |
Methods
Name | Accessible by | Required Params |
---|---|---|
create_resource | INSERT | StackName, region |
delete_resource | DELETE | data__Identifier, region |
update_resource | UPDATE | data__Identifier, data__PatchDocument, region |
list_resources | SELECT | region |
get_resource | SELECT | data__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
.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO aws.cloudformation.stacks (
StackName,
region
)
SELECT
'{{ StackName }}',
'{{ region }}';
/*+ create */
INSERT INTO aws.cloudformation.stacks (
Capabilities,
RoleARN,
Description,
DisableRollback,
EnableTerminationProtection,
NotificationARNs,
Parameters,
StackName,
StackPolicyBody,
StackPolicyURL,
StackStatusReason,
Tags,
TemplateBody,
TemplateURL,
TimeoutInMinutes,
region
)
SELECT
'{{ Capabilities }}',
'{{ RoleARN }}',
'{{ Description }}',
'{{ DisableRollback }}',
'{{ EnableTerminationProtection }}',
'{{ NotificationARNs }}',
'{{ Parameters }}',
'{{ StackName }}',
'{{ StackPolicyBody }}',
'{{ StackPolicyURL }}',
'{{ StackStatusReason }}',
'{{ Tags }}',
'{{ TemplateBody }}',
'{{ TemplateURL }}',
'{{ TimeoutInMinutes }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: stack
props:
- name: Capabilities
value:
- '{{ Capabilities[0] }}'
- name: RoleARN
value: '{{ RoleARN }}'
- name: Description
value: '{{ Description }}'
- name: DisableRollback
value: '{{ DisableRollback }}'
- name: EnableTerminationProtection
value: '{{ EnableTerminationProtection }}'
- name: NotificationARNs
value:
- '{{ NotificationARNs[0] }}'
- name: Parameters
value: {}
- name: StackName
value: '{{ StackName }}'
- name: StackPolicyBody
value: {}
- name: StackPolicyURL
value: '{{ StackPolicyURL }}'
- name: StackStatusReason
value: '{{ StackStatusReason }}'
- name: Tags
value:
- Key: '{{ Key }}'
Value: '{{ Value }}'
- name: TemplateBody
value: {}
- name: TemplateURL
value: '{{ TemplateURL }}'
- name: TimeoutInMinutes
value: '{{ TimeoutInMinutes }}'
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