Skip to main content

stack_refactors

Creates, updates, deletes, gets or lists a stack_refactors resource.

Overview

Namestack_refactors
TypeResource
Idaws.cloudformation.stack_refactors

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
stack_refactor_idstringThe ID associated with the stack refactor created from the CreateStackRefactor action.
descriptionstringA description to help you identify the refactor.
execution_statusstringThe stack refactor execution operation status that's provided after calling the ExecuteStackRefactor action.
execution_status_reasonstringA detailed explanation for the stack refactor ExecutionStatus.
stack_idsarrayThe unique ID for each stack.
statusstringThe stack refactor operation status that's provided after calling the CreateStackRefactor action.
status_reasonstringA detailed explanation for the stack refactor operation Status.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
describe_stack_refactorselectStackRefactorId, regionDescribes the stack refactor status.
list_stack_refactorsselectregionExecutionStatusFilter, NextToken, MaxResultsLists all account stack refactor operations and their statuses.
create_stack_refactorinsertStackDefinitions, regionDescription, EnableStackCreation, ResourceMappingsCreates a refactor across multiple stacks, with the list of stacks and resources that are affected.
execute_stack_refactorexecStackRefactorId, regionExecutes the stack refactor operation.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
StackDefinitionsarrayThe stacks being refactored.
StackRefactorIdstringThe ID associated with the stack refactor created from the CreateStackRefactor action.
regionstringAWS region (default: us-east-1)
DescriptionstringA description to help you identify the stack refactor.
EnableStackCreationbooleanDetermines if a new stack is created with the refactor.
ExecutionStatusFilterarrayExecution status to use as a filter. Specify one or more execution status codes to list only stack refactors with the specified execution status codes.
MaxResultsintegerThe maximum number of results to be returned with a single call. If the number of available results exceeds this maximum, the response includes a NextToken value that you can assign to the NextToken request parameter to get the next set of results.
NextTokenstringThe token for the next set of items to return. (You received this token from a previous call.)
ResourceMappingsarrayThe mappings for the stack resource Source and stack resource Destination.

SELECT examples

Describes the stack refactor status.

SELECT
stack_refactor_id,
description,
execution_status,
execution_status_reason,
stack_ids,
status,
status_reason
FROM aws.cloudformation.stack_refactors
WHERE StackRefactorId = '{{ StackRefactorId }}' -- required
AND region = '{{ region }}' -- required
;

INSERT examples

Creates a refactor across multiple stacks, with the list of stacks and resources that are affected.

INSERT INTO aws.cloudformation.stack_refactors (
StackDefinitions,
region,
Description,
EnableStackCreation,
ResourceMappings
)
SELECT
'{{ StackDefinitions }}',
'{{ region }}',
'{{ Description }}',
'{{ EnableStackCreation }}',
'{{ ResourceMappings }}'
RETURNING
line_items
;

Lifecycle Methods

Executes the stack refactor operation.

EXEC aws.cloudformation.stack_refactors.execute_stack_refactor
@StackRefactorId='{{ StackRefactorId }}' --required,
@region='{{ region }}' --required
;