2021/08/30 - AWS CloudFormation - 1 new 8 updated api methods
Changes AWS CloudFormation allows you to iteratively develop your applications when failures are encountered without rolling back successfully provisioned resources. By specifying stack failure options, you can troubleshoot resources in a CREATE_FAILED or UPDATE_FAILED status.
When specifying RollbackStack , you preserve the state of previously provisioned resources when an operation fails. You can check the status of the stack through the DescribeStacks API.
Rolls back the specified stack to the last known stable state from CREATE_FAILED or UPDATE_FAILED stack statuses.
This operation will delete a stack if it doesn't contain a last known stable state. A last known stable state includes any status in a *_COMPLETE . This includes the following stack statuses.
CREATE_COMPLETE
UPDATE_COMPLETE
UPDATE_ROLLBACK_COMPLETE
IMPORT_COMPLETE
IMPORT_ROLLBACK_COMPLETE
See also: AWS API Documentation
Request Syntax
client.rollback_stack( StackName='string', RoleARN='string', ClientRequestToken='string' )
string
[REQUIRED]
The name that is associated with the stack.
string
The Amazon Resource Name (ARN) of an Identity and Access Management role that CloudFormation assumes to rollback the stack.
string
A unique identifier for this RollbackStack request.
dict
Response Syntax
{ 'StackId': 'string' }
Response Structure
(dict) --
StackId (string) --
Unique identifier of the stack.
{'StackEvents': {'ResourceStatus': {'ROLLBACK_COMPLETE', 'ROLLBACK_FAILED', 'ROLLBACK_IN_PROGRESS', 'UPDATE_ROLLBACK_COMPLETE', 'UPDATE_ROLLBACK_FAILED', 'UPDATE_ROLLBACK_IN_PROGRESS'}}}
Returns all stack related events for a specified stack in reverse chronological order. For more information about a stack's event history, go to Stacks in the CloudFormation User Guide.
Note
You can list events for stacks that have failed to create or have been deleted by specifying the unique stack identifier (stack ID).
See also: AWS API Documentation
Request Syntax
client.describe_stack_events( StackName='string', NextToken='string' )
string
The name or the unique stack ID that is associated with the stack, which are not always interchangeable:
Running stacks: You can specify either the stack's name or its unique stack ID.
Deleted stacks: You must specify the unique stack ID.
Default: There is no default value.
string
A string that identifies the next page of events that you want to retrieve.
dict
Response Syntax
{ 'StackEvents': [ { 'StackId': 'string', 'EventId': 'string', 'StackName': 'string', 'LogicalResourceId': 'string', 'PhysicalResourceId': 'string', 'ResourceType': 'string', 'Timestamp': datetime(2015, 1, 1), 'ResourceStatus': 'CREATE_IN_PROGRESS'|'CREATE_FAILED'|'CREATE_COMPLETE'|'DELETE_IN_PROGRESS'|'DELETE_FAILED'|'DELETE_COMPLETE'|'DELETE_SKIPPED'|'UPDATE_IN_PROGRESS'|'UPDATE_FAILED'|'UPDATE_COMPLETE'|'IMPORT_FAILED'|'IMPORT_COMPLETE'|'IMPORT_IN_PROGRESS'|'IMPORT_ROLLBACK_IN_PROGRESS'|'IMPORT_ROLLBACK_FAILED'|'IMPORT_ROLLBACK_COMPLETE'|'UPDATE_ROLLBACK_IN_PROGRESS'|'UPDATE_ROLLBACK_COMPLETE'|'UPDATE_ROLLBACK_FAILED'|'ROLLBACK_IN_PROGRESS'|'ROLLBACK_COMPLETE'|'ROLLBACK_FAILED', 'ResourceStatusReason': 'string', 'ResourceProperties': 'string', 'ClientRequestToken': 'string' }, ], 'NextToken': 'string' }
Response Structure
(dict) --
The output for a DescribeStackEvents action.
StackEvents (list) --
A list of StackEvents structures.
(dict) --
The StackEvent data type.
StackId (string) --
The unique ID name of the instance of the stack.
EventId (string) --
The unique ID of this event.
StackName (string) --
The name associated with a stack.
LogicalResourceId (string) --
The logical name of the resource specified in the template.
PhysicalResourceId (string) --
The name or unique identifier associated with the physical instance of the resource.
ResourceType (string) --
Type of resource. (For more information, go to Amazon Web Services Resource Types Reference in the CloudFormation User Guide.)
Timestamp (datetime) --
Time the status was updated.
ResourceStatus (string) --
Current status of the resource.
ResourceStatusReason (string) --
Success/failure message associated with the resource.
ResourceProperties (string) --
BLOB of the properties used to create the resource.
ClientRequestToken (string) --
The token passed to the operation that generated this event.
All events triggered by a given stack operation are assigned the same client request token, which you can use to track operations. For example, if you execute a CreateStack operation with the token token1 , then all the StackEvents generated by that operation will have ClientRequestToken set as token1 .
In the console, stack operations display the client request token on the Events tab. Stack operations that are initiated from the console use the token format Console-StackOperation-ID , which helps you easily identify the stack operation . For example, if you create a stack using the console, each stack event would be assigned the same token in the following format: Console-CreateStack-7f59c3cf-00d2-40c7-b2ff-e75db0987002 .
NextToken (string) --
If the output exceeds 1 MB in size, a string that identifies the next page of events. If no additional page exists, this value is null.
{'StackResourceDetail': {'ResourceStatus': {'ROLLBACK_COMPLETE', 'ROLLBACK_FAILED', 'ROLLBACK_IN_PROGRESS', 'UPDATE_ROLLBACK_COMPLETE', 'UPDATE_ROLLBACK_FAILED', 'UPDATE_ROLLBACK_IN_PROGRESS'}}}
Returns a description of the specified resource in the specified stack.
For deleted stacks, DescribeStackResource returns resource information for up to 90 days after the stack has been deleted.
See also: AWS API Documentation
Request Syntax
client.describe_stack_resource( StackName='string', LogicalResourceId='string' )
string
[REQUIRED]
The name or the unique stack ID that is associated with the stack, which are not always interchangeable:
Running stacks: You can specify either the stack's name or its unique stack ID.
Deleted stacks: You must specify the unique stack ID.
Default: There is no default value.
string
[REQUIRED]
The logical name of the resource as specified in the template.
Default: There is no default value.
dict
Response Syntax
{ 'StackResourceDetail': { 'StackName': 'string', 'StackId': 'string', 'LogicalResourceId': 'string', 'PhysicalResourceId': 'string', 'ResourceType': 'string', 'LastUpdatedTimestamp': datetime(2015, 1, 1), 'ResourceStatus': 'CREATE_IN_PROGRESS'|'CREATE_FAILED'|'CREATE_COMPLETE'|'DELETE_IN_PROGRESS'|'DELETE_FAILED'|'DELETE_COMPLETE'|'DELETE_SKIPPED'|'UPDATE_IN_PROGRESS'|'UPDATE_FAILED'|'UPDATE_COMPLETE'|'IMPORT_FAILED'|'IMPORT_COMPLETE'|'IMPORT_IN_PROGRESS'|'IMPORT_ROLLBACK_IN_PROGRESS'|'IMPORT_ROLLBACK_FAILED'|'IMPORT_ROLLBACK_COMPLETE'|'UPDATE_ROLLBACK_IN_PROGRESS'|'UPDATE_ROLLBACK_COMPLETE'|'UPDATE_ROLLBACK_FAILED'|'ROLLBACK_IN_PROGRESS'|'ROLLBACK_COMPLETE'|'ROLLBACK_FAILED', 'ResourceStatusReason': 'string', 'Description': 'string', 'Metadata': 'string', 'DriftInformation': { 'StackResourceDriftStatus': 'IN_SYNC'|'MODIFIED'|'DELETED'|'NOT_CHECKED', 'LastCheckTimestamp': datetime(2015, 1, 1) }, 'ModuleInfo': { 'TypeHierarchy': 'string', 'LogicalIdHierarchy': 'string' } } }
Response Structure
(dict) --
The output for a DescribeStackResource action.
StackResourceDetail (dict) --
A StackResourceDetail structure containing the description of the specified resource in the specified stack.
StackName (string) --
The name associated with the stack.
StackId (string) --
Unique identifier of the stack.
LogicalResourceId (string) --
The logical name of the resource specified in the template.
PhysicalResourceId (string) --
The name or unique identifier that corresponds to a physical instance ID of a resource supported by CloudFormation.
ResourceType (string) --
Type of resource. ((For more information, go to Amazon Web Services Resource Types Reference in the CloudFormation User Guide.)
LastUpdatedTimestamp (datetime) --
Time the status was updated.
ResourceStatus (string) --
Current status of the resource.
ResourceStatusReason (string) --
Success/failure message associated with the resource.
Description (string) --
User defined description associated with the resource.
Metadata (string) --
The content of the Metadata attribute declared for the resource. For more information, see Metadata Attribute in the CloudFormation User Guide.
DriftInformation (dict) --
Information about whether the resource's actual configuration differs, or has drifted , from its expected configuration, as defined in the stack template and any values specified as template parameters. For more information, see Detecting Unregulated Configuration Changes to Stacks and Resources .
StackResourceDriftStatus (string) --
Status of the resource's actual configuration compared to its expected configuration
DELETED : The resource differs from its expected configuration in that it has been deleted.
MODIFIED : The resource differs from its expected configuration.
NOT_CHECKED : CloudFormation has not checked if the resource differs from its expected configuration. Any resources that do not currently support drift detection have a status of NOT_CHECKED . For more information, see Resources that Support Drift Detection .
IN_SYNC : The resources's actual configuration matches its expected configuration.
LastCheckTimestamp (datetime) --
When CloudFormation last checked if the resource had drifted from its expected configuration.
ModuleInfo (dict) --
Contains information about the module from which the resource was created, if the resource was created from a module included in the stack template.
TypeHierarchy (string) --
A concantenated list of the the module type or types containing the resource. Module types are listed starting with the inner-most nested module, and separated by / .
In the following example, the resource was created from a module of type AWS::First::Example::MODULE , that is nested inside a parent module of type AWS::Second::Example::MODULE .
AWS::First::Example::MODULE/AWS::Second::Example::MODULE
LogicalIdHierarchy (string) --
A concantenated list of the logical IDs of the module or modules containing the resource. Modules are listed starting with the inner-most nested module, and separated by / .
In the following example, the resource was created from a module, moduleA , that is nested inside a parent module, moduleB .
moduleA/moduleB
For more information, see Referencing resources in a module in the CloudFormation User Guide .
{'StackResources': {'ResourceStatus': {'ROLLBACK_COMPLETE', 'ROLLBACK_FAILED', 'ROLLBACK_IN_PROGRESS', 'UPDATE_ROLLBACK_COMPLETE', 'UPDATE_ROLLBACK_FAILED', 'UPDATE_ROLLBACK_IN_PROGRESS'}}}
Returns Amazon Web Services resource descriptions for running and deleted stacks. If StackName is specified, all the associated resources that are part of the stack are returned. If PhysicalResourceId is specified, the associated resources of the stack that the resource belongs to are returned.
Note
Only the first 100 resources will be returned. If your stack has more resources than this, you should use ListStackResources instead.
For deleted stacks, DescribeStackResources returns resource information for up to 90 days after the stack has been deleted.
You must specify either StackName or PhysicalResourceId , but not both. In addition, you can specify LogicalResourceId to filter the returned result. For more information about resources, the LogicalResourceId and PhysicalResourceId , go to the CloudFormation User Guide .
Note
A ValidationError is returned if you specify both StackName and PhysicalResourceId in the same request.
See also: AWS API Documentation
Request Syntax
client.describe_stack_resources( StackName='string', LogicalResourceId='string', PhysicalResourceId='string' )
string
The name or the unique stack ID that is associated with the stack, which are not always interchangeable:
Running stacks: You can specify either the stack's name or its unique stack ID.
Deleted stacks: You must specify the unique stack ID.
Default: There is no default value.
Required: Conditional. If you do not specify StackName , you must specify PhysicalResourceId .
string
The logical name of the resource as specified in the template.
Default: There is no default value.
string
The name or unique identifier that corresponds to a physical instance ID of a resource supported by CloudFormation.
For example, for an Amazon Elastic Compute Cloud (EC2) instance, PhysicalResourceId corresponds to the InstanceId . You can pass the EC2 InstanceId to DescribeStackResources to find which stack the instance belongs to and what other resources are part of the stack.
Required: Conditional. If you do not specify PhysicalResourceId , you must specify StackName .
Default: There is no default value.
dict
Response Syntax
{ 'StackResources': [ { 'StackName': 'string', 'StackId': 'string', 'LogicalResourceId': 'string', 'PhysicalResourceId': 'string', 'ResourceType': 'string', 'Timestamp': datetime(2015, 1, 1), 'ResourceStatus': 'CREATE_IN_PROGRESS'|'CREATE_FAILED'|'CREATE_COMPLETE'|'DELETE_IN_PROGRESS'|'DELETE_FAILED'|'DELETE_COMPLETE'|'DELETE_SKIPPED'|'UPDATE_IN_PROGRESS'|'UPDATE_FAILED'|'UPDATE_COMPLETE'|'IMPORT_FAILED'|'IMPORT_COMPLETE'|'IMPORT_IN_PROGRESS'|'IMPORT_ROLLBACK_IN_PROGRESS'|'IMPORT_ROLLBACK_FAILED'|'IMPORT_ROLLBACK_COMPLETE'|'UPDATE_ROLLBACK_IN_PROGRESS'|'UPDATE_ROLLBACK_COMPLETE'|'UPDATE_ROLLBACK_FAILED'|'ROLLBACK_IN_PROGRESS'|'ROLLBACK_COMPLETE'|'ROLLBACK_FAILED', 'ResourceStatusReason': 'string', 'Description': 'string', 'DriftInformation': { 'StackResourceDriftStatus': 'IN_SYNC'|'MODIFIED'|'DELETED'|'NOT_CHECKED', 'LastCheckTimestamp': datetime(2015, 1, 1) }, 'ModuleInfo': { 'TypeHierarchy': 'string', 'LogicalIdHierarchy': 'string' } }, ] }
Response Structure
(dict) --
The output for a DescribeStackResources action.
StackResources (list) --
A list of StackResource structures.
(dict) --
The StackResource data type.
StackName (string) --
The name associated with the stack.
StackId (string) --
Unique identifier of the stack.
LogicalResourceId (string) --
The logical name of the resource specified in the template.
PhysicalResourceId (string) --
The name or unique identifier that corresponds to a physical instance ID of a resource supported by CloudFormation.
ResourceType (string) --
Type of resource. (For more information, go to Amazon Web Services Resource Types Reference in the CloudFormation User Guide.)
Timestamp (datetime) --
Time the status was updated.
ResourceStatus (string) --
Current status of the resource.
ResourceStatusReason (string) --
Success/failure message associated with the resource.
Description (string) --
User defined description associated with the resource.
DriftInformation (dict) --
Information about whether the resource's actual configuration differs, or has drifted , from its expected configuration, as defined in the stack template and any values specified as template parameters. For more information, see Detecting Unregulated Configuration Changes to Stacks and Resources .
StackResourceDriftStatus (string) --
Status of the resource's actual configuration compared to its expected configuration
DELETED : The resource differs from its expected configuration in that it has been deleted.
MODIFIED : The resource differs from its expected configuration.
NOT_CHECKED : CloudFormation has not checked if the resource differs from its expected configuration. Any resources that do not currently support drift detection have a status of NOT_CHECKED . For more information, see Resources that Support Drift Detection .
IN_SYNC : The resources's actual configuration matches its expected configuration.
LastCheckTimestamp (datetime) --
When CloudFormation last checked if the resource had drifted from its expected configuration.
ModuleInfo (dict) --
Contains information about the module from which the resource was created, if the resource was created from a module included in the stack template.
TypeHierarchy (string) --
A concantenated list of the the module type or types containing the resource. Module types are listed starting with the inner-most nested module, and separated by / .
In the following example, the resource was created from a module of type AWS::First::Example::MODULE , that is nested inside a parent module of type AWS::Second::Example::MODULE .
AWS::First::Example::MODULE/AWS::Second::Example::MODULE
LogicalIdHierarchy (string) --
A concantenated list of the logical IDs of the module or modules containing the resource. Modules are listed starting with the inner-most nested module, and separated by / .
In the following example, the resource was created from a module, moduleA , that is nested inside a parent module, moduleB .
moduleA/moduleB
For more information, see Referencing resources in a module in the CloudFormation User Guide .
{'Stacks': {'StackStatus': {'UPDATE_FAILED'}}}
Returns the description for the specified stack; if no stack name was specified, then it returns the description for all the stacks created.
Note
If the stack does not exist, an AmazonCloudFormationException is returned.
See also: AWS API Documentation
Request Syntax
client.describe_stacks( StackName='string', NextToken='string' )
string
The name or the unique stack ID that is associated with the stack, which are not always interchangeable:
Running stacks: You can specify either the stack's name or its unique stack ID.
Deleted stacks: You must specify the unique stack ID.
Default: There is no default value.
string
A string that identifies the next page of stacks that you want to retrieve.
dict
Response Syntax
{ 'Stacks': [ { 'StackId': 'string', 'StackName': 'string', 'ChangeSetId': 'string', 'Description': 'string', 'Parameters': [ { 'ParameterKey': 'string', 'ParameterValue': 'string', 'UsePreviousValue': True|False, 'ResolvedValue': 'string' }, ], 'CreationTime': datetime(2015, 1, 1), 'DeletionTime': datetime(2015, 1, 1), 'LastUpdatedTime': datetime(2015, 1, 1), 'RollbackConfiguration': { 'RollbackTriggers': [ { 'Arn': 'string', 'Type': 'string' }, ], 'MonitoringTimeInMinutes': 123 }, 'StackStatus': 'CREATE_IN_PROGRESS'|'CREATE_FAILED'|'CREATE_COMPLETE'|'ROLLBACK_IN_PROGRESS'|'ROLLBACK_FAILED'|'ROLLBACK_COMPLETE'|'DELETE_IN_PROGRESS'|'DELETE_FAILED'|'DELETE_COMPLETE'|'UPDATE_IN_PROGRESS'|'UPDATE_COMPLETE_CLEANUP_IN_PROGRESS'|'UPDATE_COMPLETE'|'UPDATE_FAILED'|'UPDATE_ROLLBACK_IN_PROGRESS'|'UPDATE_ROLLBACK_FAILED'|'UPDATE_ROLLBACK_COMPLETE_CLEANUP_IN_PROGRESS'|'UPDATE_ROLLBACK_COMPLETE'|'REVIEW_IN_PROGRESS'|'IMPORT_IN_PROGRESS'|'IMPORT_COMPLETE'|'IMPORT_ROLLBACK_IN_PROGRESS'|'IMPORT_ROLLBACK_FAILED'|'IMPORT_ROLLBACK_COMPLETE', 'StackStatusReason': 'string', 'DisableRollback': True|False, 'NotificationARNs': [ 'string', ], 'TimeoutInMinutes': 123, 'Capabilities': [ 'CAPABILITY_IAM'|'CAPABILITY_NAMED_IAM'|'CAPABILITY_AUTO_EXPAND', ], 'Outputs': [ { 'OutputKey': 'string', 'OutputValue': 'string', 'Description': 'string', 'ExportName': 'string' }, ], 'RoleARN': 'string', 'Tags': [ { 'Key': 'string', 'Value': 'string' }, ], 'EnableTerminationProtection': True|False, 'ParentId': 'string', 'RootId': 'string', 'DriftInformation': { 'StackDriftStatus': 'DRIFTED'|'IN_SYNC'|'UNKNOWN'|'NOT_CHECKED', 'LastCheckTimestamp': datetime(2015, 1, 1) } }, ], 'NextToken': 'string' }
Response Structure
(dict) --
The output for a DescribeStacks action.
Stacks (list) --
A list of stack structures.
(dict) --
The Stack data type.
StackId (string) --
Unique identifier of the stack.
StackName (string) --
The name associated with the stack.
ChangeSetId (string) --
The unique ID of the change set.
Description (string) --
A user-defined description associated with the stack.
Parameters (list) --
A list of Parameter structures.
(dict) --
The Parameter data type.
ParameterKey (string) --
The key associated with the parameter. If you don't specify a key and value for a particular parameter, CloudFormation uses the default value that is specified in your template.
ParameterValue (string) --
The input value associated with the parameter.
UsePreviousValue (boolean) --
During a stack update, use the existing parameter value that the stack is using for a given parameter key. If you specify true , do not specify a parameter value.
ResolvedValue (string) --
Read-only. The value that corresponds to a Systems Manager parameter key. This field is returned only for ` SSM parameter types <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/parameters-section-structure.html#aws-ssm-parameter-types>`__ in the template.
CreationTime (datetime) --
The time at which the stack was created.
DeletionTime (datetime) --
The time the stack was deleted.
LastUpdatedTime (datetime) --
The time the stack was last updated. This field will only be returned if the stack has been updated at least once.
RollbackConfiguration (dict) --
The rollback triggers for CloudFormation to monitor during stack creation and updating operations, and for the specified monitoring period afterwards.
RollbackTriggers (list) --
The triggers to monitor during stack creation or update actions.
By default, CloudFormation saves the rollback triggers specified for a stack and applies them to any subsequent update operations for the stack, unless you specify otherwise. If you do specify rollback triggers for this parameter, those triggers replace any list of triggers previously specified for the stack. This means:
To use the rollback triggers previously specified for this stack, if any, don't specify this parameter.
To specify new or updated rollback triggers, you must specify all the triggers that you want used for this stack, even triggers you've specifed before (for example, when creating the stack or during a previous stack update). Any triggers that you don't include in the updated list of triggers are no longer applied to the stack.
To remove all currently specified triggers, specify an empty list for this parameter.
If a specified trigger is missing, the entire stack operation fails and is rolled back.
(dict) --
A rollback trigger CloudFormation monitors during creation and updating of stacks. If any of the alarms you specify goes to ALARM state during the stack operation or within the specified monitoring period afterwards, CloudFormation rolls back the entire stack operation.
Arn (string) --
The Amazon Resource Name (ARN) of the rollback trigger.
If a specified trigger is missing, the entire stack operation fails and is rolled back.
Type (string) --
The resource type of the rollback trigger. Currently, AWS::CloudWatch::Alarm is the only supported resource type.
MonitoringTimeInMinutes (integer) --
The amount of time, in minutes, during which CloudFormation should monitor all the rollback triggers after the stack creation or update operation deploys all necessary resources.
The default is 0 minutes.
If you specify a monitoring period but do not specify any rollback triggers, CloudFormation still waits the specified period of time before cleaning up old resources after update operations. You can use this monitoring period to perform any manual stack validation desired, and manually cancel the stack creation or update (using CancelUpdateStack , for example) as necessary.
If you specify 0 for this parameter, CloudFormation still monitors the specified rollback triggers during stack creation and update operations. Then, for update operations, it begins disposing of old resources immediately once the operation completes.
StackStatus (string) --
Current status of the stack.
StackStatusReason (string) --
Success/failure message associated with the stack status.
DisableRollback (boolean) --
Boolean to enable or disable rollback on stack creation failures:
true : disable rollback
false : enable rollback
NotificationARNs (list) --
SNS topic ARNs to which stack related events are published.
(string) --
TimeoutInMinutes (integer) --
The amount of time within which stack creation should complete.
Capabilities (list) --
The capabilities allowed in the stack.
(string) --
Outputs (list) --
A list of output structures.
(dict) --
The Output data type.
OutputKey (string) --
The key associated with the output.
OutputValue (string) --
The value associated with the output.
Description (string) --
User defined description associated with the output.
ExportName (string) --
The name of the export associated with the output.
RoleARN (string) --
The Amazon Resource Name (ARN) of an Identity and Access Management (IAM) role that is associated with the stack. During a stack operation, CloudFormation uses this role's credentials to make calls on your behalf.
Tags (list) --
A list of Tag s that specify information about the stack.
(dict) --
The Tag type enables you to specify a key-value pair that can be used to store information about an CloudFormation stack.
Key (string) --
Required . A string used to identify this tag. You can specify a maximum of 128 characters for a tag key. Tags owned by Amazon Web Services (Amazon Web Services) have the reserved prefix: aws: .
Value (string) --
Required . A string containing the value for this tag. You can specify a maximum of 256 characters for a tag value.
EnableTerminationProtection (boolean) --
Whether termination protection is enabled for the stack.
For nested stacks , termination protection is set on the root stack and cannot be changed directly on the nested stack. For more information, see Protecting a Stack From Being Deleted in the CloudFormation User Guide .
ParentId (string) --
For nested stacks--stacks created as resources for another stack--the stack ID of the direct parent of this stack. For the first level of nested stacks, the root stack is also the parent stack.
For more information, see Working with Nested Stacks in the CloudFormation User Guide .
RootId (string) --
For nested stacks--stacks created as resources for another stack--the stack ID of the top-level stack to which the nested stack ultimately belongs.
For more information, see Working with Nested Stacks in the CloudFormation User Guide .
DriftInformation (dict) --
Information on whether a stack's actual configuration differs, or has drifted , from it's expected configuration, as defined in the stack template and any values specified as template parameters. For more information, see Detecting Unregulated Configuration Changes to Stacks and Resources .
StackDriftStatus (string) --
Status of the stack's actual configuration compared to its expected template configuration.
DRIFTED : The stack differs from its expected template configuration. A stack is considered to have drifted if one or more of its resources have drifted.
NOT_CHECKED : CloudFormation has not checked if the stack differs from its expected template configuration.
IN_SYNC : The stack's actual configuration matches its expected template configuration.
UNKNOWN : This value is reserved for future use.
LastCheckTimestamp (datetime) --
Most recent time when a drift detection operation was initiated on the stack, or any of its individual resources that support drift detection.
NextToken (string) --
If the output exceeds 1 MB in size, a string that identifies the next page of stacks. If no additional page exists, this value is null.
{'DisableRollback': 'boolean'}
Updates a stack using the input information that was provided when the specified change set was created. After the call successfully completes, CloudFormation starts updating the stack. Use the DescribeStacks action to view the status of the update.
When you execute a change set, CloudFormation deletes all other change sets associated with the stack because they aren't valid for the updated stack.
If a stack policy is associated with the stack, CloudFormation enforces the policy during the update. You can't specify a temporary stack policy that overrides the current policy.
To create a change set for the entire stack hierachy, IncludeNestedStacks must have been set to True .
See also: AWS API Documentation
Request Syntax
client.execute_change_set( ChangeSetName='string', StackName='string', ClientRequestToken='string', DisableRollback=True|False )
string
[REQUIRED]
The name or ARN of the change set that you want use to update the specified stack.
string
If you specified the name of a change set, specify the stack name or ID (ARN) that is associated with the change set you want to execute.
string
A unique identifier for this ExecuteChangeSet request. Specify this token if you plan to retry requests so that CloudFormation knows that you're not attempting to execute a change set to update a stack with the same name. You might retry ExecuteChangeSet requests to ensure that CloudFormation successfully received them.
boolean
Preserves the state of previously provisioned resources when an operation fails.
Default: True
dict
Response Syntax
{}
Response Structure
(dict) --
The output for the ExecuteChangeSet action.
{'StackResourceSummaries': {'ResourceStatus': {'ROLLBACK_COMPLETE', 'ROLLBACK_FAILED', 'ROLLBACK_IN_PROGRESS', 'UPDATE_ROLLBACK_COMPLETE', 'UPDATE_ROLLBACK_FAILED', 'UPDATE_ROLLBACK_IN_PROGRESS'}}}
Returns descriptions of all resources of the specified stack.
For deleted stacks, ListStackResources returns resource information for up to 90 days after the stack has been deleted.
See also: AWS API Documentation
Request Syntax
client.list_stack_resources( StackName='string', NextToken='string' )
string
[REQUIRED]
The name or the unique stack ID that is associated with the stack, which are not always interchangeable:
Running stacks: You can specify either the stack's name or its unique stack ID.
Deleted stacks: You must specify the unique stack ID.
Default: There is no default value.
string
A string that identifies the next page of stack resources that you want to retrieve.
dict
Response Syntax
{ 'StackResourceSummaries': [ { 'LogicalResourceId': 'string', 'PhysicalResourceId': 'string', 'ResourceType': 'string', 'LastUpdatedTimestamp': datetime(2015, 1, 1), 'ResourceStatus': 'CREATE_IN_PROGRESS'|'CREATE_FAILED'|'CREATE_COMPLETE'|'DELETE_IN_PROGRESS'|'DELETE_FAILED'|'DELETE_COMPLETE'|'DELETE_SKIPPED'|'UPDATE_IN_PROGRESS'|'UPDATE_FAILED'|'UPDATE_COMPLETE'|'IMPORT_FAILED'|'IMPORT_COMPLETE'|'IMPORT_IN_PROGRESS'|'IMPORT_ROLLBACK_IN_PROGRESS'|'IMPORT_ROLLBACK_FAILED'|'IMPORT_ROLLBACK_COMPLETE'|'UPDATE_ROLLBACK_IN_PROGRESS'|'UPDATE_ROLLBACK_COMPLETE'|'UPDATE_ROLLBACK_FAILED'|'ROLLBACK_IN_PROGRESS'|'ROLLBACK_COMPLETE'|'ROLLBACK_FAILED', 'ResourceStatusReason': 'string', 'DriftInformation': { 'StackResourceDriftStatus': 'IN_SYNC'|'MODIFIED'|'DELETED'|'NOT_CHECKED', 'LastCheckTimestamp': datetime(2015, 1, 1) }, 'ModuleInfo': { 'TypeHierarchy': 'string', 'LogicalIdHierarchy': 'string' } }, ], 'NextToken': 'string' }
Response Structure
(dict) --
The output for a ListStackResources action.
StackResourceSummaries (list) --
A list of StackResourceSummary structures.
(dict) --
Contains high-level information about the specified stack resource.
LogicalResourceId (string) --
The logical name of the resource specified in the template.
PhysicalResourceId (string) --
The name or unique identifier that corresponds to a physical instance ID of the resource.
ResourceType (string) --
Type of resource. (For more information, go to Amazon Web Services Resource Types Reference in the CloudFormation User Guide.)
LastUpdatedTimestamp (datetime) --
Time the status was updated.
ResourceStatus (string) --
Current status of the resource.
ResourceStatusReason (string) --
Success/failure message associated with the resource.
DriftInformation (dict) --
Information about whether the resource's actual configuration differs, or has drifted , from its expected configuration, as defined in the stack template and any values specified as template parameters. For more information, see Detecting Unregulated Configuration Changes to Stacks and Resources .
StackResourceDriftStatus (string) --
Status of the resource's actual configuration compared to its expected configuration
DELETED : The resource differs from its expected configuration in that it has been deleted.
MODIFIED : The resource differs from its expected configuration.
NOT_CHECKED : CloudFormation has not checked if the resource differs from its expected configuration. Any resources that do not currently support drift detection have a status of NOT_CHECKED . For more information, see Resources that Support Drift Detection . If you performed an ContinueUpdateRollback operation on a stack, any resources included in ResourcesToSkip will also have a status of NOT_CHECKED . For more information on skipping resources during rollback operations, see Continue Rolling Back an Update in the CloudFormation User Guide.
IN_SYNC : The resources's actual configuration matches its expected configuration.
LastCheckTimestamp (datetime) --
When CloudFormation last checked if the resource had drifted from its expected configuration.
ModuleInfo (dict) --
Contains information about the module from which the resource was created, if the resource was created from a module included in the stack template.
TypeHierarchy (string) --
A concantenated list of the the module type or types containing the resource. Module types are listed starting with the inner-most nested module, and separated by / .
In the following example, the resource was created from a module of type AWS::First::Example::MODULE , that is nested inside a parent module of type AWS::Second::Example::MODULE .
AWS::First::Example::MODULE/AWS::Second::Example::MODULE
LogicalIdHierarchy (string) --
A concantenated list of the logical IDs of the module or modules containing the resource. Modules are listed starting with the inner-most nested module, and separated by / .
In the following example, the resource was created from a module, moduleA , that is nested inside a parent module, moduleB .
moduleA/moduleB
For more information, see Referencing resources in a module in the CloudFormation User Guide .
NextToken (string) --
If the output exceeds 1 MB, a string that identifies the next page of stack resources. If no additional page exists, this value is null.
{'StackStatusFilter': {'UPDATE_FAILED'}}Response
{'StackSummaries': {'StackStatus': {'UPDATE_FAILED'}}}
Returns the summary information for stacks whose status matches the specified StackStatusFilter. Summary information for stacks that have been deleted is kept for 90 days after the stack is deleted. If no StackStatusFilter is specified, summary information for all stacks is returned (including existing stacks and stacks that have been deleted).
See also: AWS API Documentation
Request Syntax
client.list_stacks( NextToken='string', StackStatusFilter=[ 'CREATE_IN_PROGRESS'|'CREATE_FAILED'|'CREATE_COMPLETE'|'ROLLBACK_IN_PROGRESS'|'ROLLBACK_FAILED'|'ROLLBACK_COMPLETE'|'DELETE_IN_PROGRESS'|'DELETE_FAILED'|'DELETE_COMPLETE'|'UPDATE_IN_PROGRESS'|'UPDATE_COMPLETE_CLEANUP_IN_PROGRESS'|'UPDATE_COMPLETE'|'UPDATE_FAILED'|'UPDATE_ROLLBACK_IN_PROGRESS'|'UPDATE_ROLLBACK_FAILED'|'UPDATE_ROLLBACK_COMPLETE_CLEANUP_IN_PROGRESS'|'UPDATE_ROLLBACK_COMPLETE'|'REVIEW_IN_PROGRESS'|'IMPORT_IN_PROGRESS'|'IMPORT_COMPLETE'|'IMPORT_ROLLBACK_IN_PROGRESS'|'IMPORT_ROLLBACK_FAILED'|'IMPORT_ROLLBACK_COMPLETE', ] )
string
A string that identifies the next page of stacks that you want to retrieve.
list
Stack status to use as a filter. Specify one or more stack status codes to list only stacks with the specified status codes. For a complete list of stack status codes, see the StackStatus parameter of the Stack data type.
(string) --
dict
Response Syntax
{ 'StackSummaries': [ { 'StackId': 'string', 'StackName': 'string', 'TemplateDescription': 'string', 'CreationTime': datetime(2015, 1, 1), 'LastUpdatedTime': datetime(2015, 1, 1), 'DeletionTime': datetime(2015, 1, 1), 'StackStatus': 'CREATE_IN_PROGRESS'|'CREATE_FAILED'|'CREATE_COMPLETE'|'ROLLBACK_IN_PROGRESS'|'ROLLBACK_FAILED'|'ROLLBACK_COMPLETE'|'DELETE_IN_PROGRESS'|'DELETE_FAILED'|'DELETE_COMPLETE'|'UPDATE_IN_PROGRESS'|'UPDATE_COMPLETE_CLEANUP_IN_PROGRESS'|'UPDATE_COMPLETE'|'UPDATE_FAILED'|'UPDATE_ROLLBACK_IN_PROGRESS'|'UPDATE_ROLLBACK_FAILED'|'UPDATE_ROLLBACK_COMPLETE_CLEANUP_IN_PROGRESS'|'UPDATE_ROLLBACK_COMPLETE'|'REVIEW_IN_PROGRESS'|'IMPORT_IN_PROGRESS'|'IMPORT_COMPLETE'|'IMPORT_ROLLBACK_IN_PROGRESS'|'IMPORT_ROLLBACK_FAILED'|'IMPORT_ROLLBACK_COMPLETE', 'StackStatusReason': 'string', 'ParentId': 'string', 'RootId': 'string', 'DriftInformation': { 'StackDriftStatus': 'DRIFTED'|'IN_SYNC'|'UNKNOWN'|'NOT_CHECKED', 'LastCheckTimestamp': datetime(2015, 1, 1) } }, ], 'NextToken': 'string' }
Response Structure
(dict) --
The output for ListStacks action.
StackSummaries (list) --
A list of StackSummary structures containing information about the specified stacks.
(dict) --
The StackSummary Data Type
StackId (string) --
Unique stack identifier.
StackName (string) --
The name associated with the stack.
TemplateDescription (string) --
The template description of the template used to create the stack.
CreationTime (datetime) --
The time the stack was created.
LastUpdatedTime (datetime) --
The time the stack was last updated. This field will only be returned if the stack has been updated at least once.
DeletionTime (datetime) --
The time the stack was deleted.
StackStatus (string) --
The current status of the stack.
StackStatusReason (string) --
Success/Failure message associated with the stack status.
ParentId (string) --
For nested stacks--stacks created as resources for another stack--the stack ID of the direct parent of this stack. For the first level of nested stacks, the root stack is also the parent stack.
For more information, see Working with Nested Stacks in the CloudFormation User Guide .
RootId (string) --
For nested stacks--stacks created as resources for another stack--the stack ID of the top-level stack to which the nested stack ultimately belongs.
For more information, see Working with Nested Stacks in the CloudFormation User Guide .
DriftInformation (dict) --
Summarizes information on whether a stack's actual configuration differs, or has drifted , from it's expected configuration, as defined in the stack template and any values specified as template parameters. For more information, see Detecting Unregulated Configuration Changes to Stacks and Resources .
StackDriftStatus (string) --
Status of the stack's actual configuration compared to its expected template configuration.
DRIFTED : The stack differs from its expected template configuration. A stack is considered to have drifted if one or more of its resources have drifted.
NOT_CHECKED : CloudFormation has not checked if the stack differs from its expected template configuration.
IN_SYNC : The stack's actual configuration matches its expected template configuration.
UNKNOWN : This value is reserved for future use.
LastCheckTimestamp (datetime) --
Most recent time when a drift detection operation was initiated on the stack, or any of its individual resources that support drift detection.
NextToken (string) --
If the output exceeds 1 MB in size, a string that identifies the next page of stacks. If no additional page exists, this value is null.
{'DisableRollback': 'boolean'}
Updates a stack as specified in the template. After the call completes successfully, the stack update starts. You can check the status of the stack via the DescribeStacks action.
To get a copy of the template for an existing stack, you can use the GetTemplate action.
For more information about creating an update template, updating a stack, and monitoring the progress of the update, see Updating a Stack .
See also: AWS API Documentation
Request Syntax
client.update_stack( StackName='string', TemplateBody='string', TemplateURL='string', UsePreviousTemplate=True|False, StackPolicyDuringUpdateBody='string', StackPolicyDuringUpdateURL='string', Parameters=[ { 'ParameterKey': 'string', 'ParameterValue': 'string', 'UsePreviousValue': True|False, 'ResolvedValue': 'string' }, ], Capabilities=[ 'CAPABILITY_IAM'|'CAPABILITY_NAMED_IAM'|'CAPABILITY_AUTO_EXPAND', ], ResourceTypes=[ 'string', ], RoleARN='string', RollbackConfiguration={ 'RollbackTriggers': [ { 'Arn': 'string', 'Type': 'string' }, ], 'MonitoringTimeInMinutes': 123 }, StackPolicyBody='string', StackPolicyURL='string', NotificationARNs=[ 'string', ], Tags=[ { 'Key': 'string', 'Value': 'string' }, ], DisableRollback=True|False, ClientRequestToken='string' )
string
[REQUIRED]
The name or unique stack ID of the stack to update.
string
Structure containing the template body with a minimum length of 1 byte and a maximum length of 51,200 bytes. (For more information, go to Template Anatomy in the CloudFormation User Guide.)
Conditional: You must specify only one of the following parameters: TemplateBody , TemplateURL , or set the UsePreviousTemplate to true .
string
Location of file containing the template body. The URL must point to a template that is located in an Amazon S3 bucket or a Systems Manager document. For more information, go to Template Anatomy in the CloudFormation User Guide.
Conditional: You must specify only one of the following parameters: TemplateBody , TemplateURL , or set the UsePreviousTemplate to true .
boolean
Reuse the existing template that is associated with the stack that you are updating.
Conditional: You must specify only one of the following parameters: TemplateBody , TemplateURL , or set the UsePreviousTemplate to true .
string
Structure containing the temporary overriding stack policy body. You can specify either the StackPolicyDuringUpdateBody or the StackPolicyDuringUpdateURL parameter, but not both.
If you want to update protected resources, specify a temporary overriding stack policy during this update. If you do not specify a stack policy, the current policy that is associated with the stack will be used.
string
Location of a file containing the temporary overriding stack policy. The URL must point to a policy (max size: 16KB) located in an S3 bucket in the same Region as the stack. You can specify either the StackPolicyDuringUpdateBody or the StackPolicyDuringUpdateURL parameter, but not both.
If you want to update protected resources, specify a temporary overriding stack policy during this update. If you do not specify a stack policy, the current policy that is associated with the stack will be used.
list
A list of Parameter structures that specify input parameters for the stack. For more information, see the Parameter data type.
(dict) --
The Parameter data type.
ParameterKey (string) --
The key associated with the parameter. If you don't specify a key and value for a particular parameter, CloudFormation uses the default value that is specified in your template.
ParameterValue (string) --
The input value associated with the parameter.
UsePreviousValue (boolean) --
During a stack update, use the existing parameter value that the stack is using for a given parameter key. If you specify true , do not specify a parameter value.
ResolvedValue (string) --
Read-only. The value that corresponds to a Systems Manager parameter key. This field is returned only for ` SSM parameter types <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/parameters-section-structure.html#aws-ssm-parameter-types>`__ in the template.
list
In some cases, you must explicitly acknowledge that your stack template contains certain capabilities in order for CloudFormation to update the stack.
CAPABILITY_IAM and CAPABILITY_NAMED_IAM Some stack templates might include resources that can affect permissions in your Amazon Web Services account; for example, by creating new Identity and Access Management (IAM) users. For those stacks, you must explicitly acknowledge this by specifying one of these capabilities. The following IAM resources require you to specify either the CAPABILITY_IAM or CAPABILITY_NAMED_IAM capability.
If you have IAM resources, you can specify either capability.
If you have IAM resources with custom names, you must specify CAPABILITY_NAMED_IAM .
If you don't specify either of these capabilities, CloudFormation returns an InsufficientCapabilities error.
If your stack template contains these resources, we recommend that you review all permissions associated with them and edit their permissions if necessary.
For more information, see Acknowledging IAM Resources in CloudFormation Templates .
CAPABILITY_AUTO_EXPAND Some template contain macros. Macros perform custom processing on templates; this can include simple actions like find-and-replace operations, all the way to extensive transformations of entire templates. Because of this, users typically create a change set from the processed template, so that they can review the changes resulting from the macros before actually updating the stack. If your stack template contains one or more macros, and you choose to update a stack directly from the processed template, without first reviewing the resulting changes in a change set, you must acknowledge this capability. This includes the AWS::Include and AWS::Serverless transforms, which are macros hosted by CloudFormation. If you want to update a stack from a stack template that contains macros and nested stacks, you must update the stack directly from the template using this capability.
Warning
You should only update stacks directly from a stack template that contains macros if you know what processing the macro performs. Each macro relies on an underlying Lambda service function for processing stack templates. Be aware that the Lambda function owner can update the function operation without CloudFormation being notified.
For more information, see Using CloudFormation Macros to Perform Custom Processing on Templates .
(string) --
list
The template resource types that you have permissions to work with for this update stack action, such as AWS::EC2::Instance , AWS::EC2::* , or Custom::MyCustomInstance .
If the list of resource types doesn't include a resource that you're updating, the stack update fails. By default, CloudFormation grants permissions to all resource types. Identity and Access Management (IAM) uses this parameter for CloudFormation-specific condition keys in IAM policies. For more information, see Controlling Access with Identity and Access Management .
(string) --
string
The Amazon Resource Name (ARN) of an Identity and Access Management (IAM) role that CloudFormation assumes to update the stack. CloudFormation uses the role's credentials to make calls on your behalf. CloudFormation always uses this role for all future operations on the stack. As long as users have permission to operate on the stack, CloudFormation uses this role even if the users don't have permission to pass it. Ensure that the role grants least privilege.
If you don't specify a value, CloudFormation uses the role that was previously associated with the stack. If no role is available, CloudFormation uses a temporary session that is generated from your user credentials.
dict
The rollback triggers for CloudFormation to monitor during stack creation and updating operations, and for the specified monitoring period afterwards.
RollbackTriggers (list) --
The triggers to monitor during stack creation or update actions.
By default, CloudFormation saves the rollback triggers specified for a stack and applies them to any subsequent update operations for the stack, unless you specify otherwise. If you do specify rollback triggers for this parameter, those triggers replace any list of triggers previously specified for the stack. This means:
To use the rollback triggers previously specified for this stack, if any, don't specify this parameter.
To specify new or updated rollback triggers, you must specify all the triggers that you want used for this stack, even triggers you've specifed before (for example, when creating the stack or during a previous stack update). Any triggers that you don't include in the updated list of triggers are no longer applied to the stack.
To remove all currently specified triggers, specify an empty list for this parameter.
If a specified trigger is missing, the entire stack operation fails and is rolled back.
(dict) --
A rollback trigger CloudFormation monitors during creation and updating of stacks. If any of the alarms you specify goes to ALARM state during the stack operation or within the specified monitoring period afterwards, CloudFormation rolls back the entire stack operation.
Arn (string) -- [REQUIRED]
The Amazon Resource Name (ARN) of the rollback trigger.
If a specified trigger is missing, the entire stack operation fails and is rolled back.
Type (string) -- [REQUIRED]
The resource type of the rollback trigger. Currently, AWS::CloudWatch::Alarm is the only supported resource type.
MonitoringTimeInMinutes (integer) --
The amount of time, in minutes, during which CloudFormation should monitor all the rollback triggers after the stack creation or update operation deploys all necessary resources.
The default is 0 minutes.
If you specify a monitoring period but do not specify any rollback triggers, CloudFormation still waits the specified period of time before cleaning up old resources after update operations. You can use this monitoring period to perform any manual stack validation desired, and manually cancel the stack creation or update (using CancelUpdateStack , for example) as necessary.
If you specify 0 for this parameter, CloudFormation still monitors the specified rollback triggers during stack creation and update operations. Then, for update operations, it begins disposing of old resources immediately once the operation completes.
string
Structure containing a new stack policy body. You can specify either the StackPolicyBody or the StackPolicyURL parameter, but not both.
You might update the stack policy, for example, in order to protect a new resource that you created during a stack update. If you do not specify a stack policy, the current policy that is associated with the stack is unchanged.
string
Location of a file containing the updated stack policy. The URL must point to a policy (max size: 16KB) located in an S3 bucket in the same Region as the stack. You can specify either the StackPolicyBody or the StackPolicyURL parameter, but not both.
You might update the stack policy, for example, in order to protect a new resource that you created during a stack update. If you do not specify a stack policy, the current policy that is associated with the stack is unchanged.
list
Amazon Simple Notification Service topic Amazon Resource Names (ARNs) that CloudFormation associates with the stack. Specify an empty list to remove all notification topics.
(string) --
list
Key-value pairs to associate with this stack. CloudFormation also propagates these tags to supported resources in the stack. You can specify a maximum number of 50 tags.
If you don't specify this parameter, CloudFormation doesn't modify the stack's tags. If you specify an empty value, CloudFormation removes all associated tags.
(dict) --
The Tag type enables you to specify a key-value pair that can be used to store information about an CloudFormation stack.
Key (string) -- [REQUIRED]
Required . A string used to identify this tag. You can specify a maximum of 128 characters for a tag key. Tags owned by Amazon Web Services (Amazon Web Services) have the reserved prefix: aws: .
Value (string) -- [REQUIRED]
Required . A string containing the value for this tag. You can specify a maximum of 256 characters for a tag value.
boolean
Preserve the state of previously provisioned resources when an operation fails.
Default: False
string
A unique identifier for this UpdateStack request. Specify this token if you plan to retry requests so that CloudFormation knows that you're not attempting to update a stack with the same name. You might retry UpdateStack requests to ensure that CloudFormation successfully received them.
All events triggered by a given stack operation are assigned the same client request token, which you can use to track operations. For example, if you execute a CreateStack operation with the token token1 , then all the StackEvents generated by that operation will have ClientRequestToken set as token1 .
In the console, stack operations display the client request token on the Events tab. Stack operations that are initiated from the console use the token format Console-StackOperation-ID , which helps you easily identify the stack operation . For example, if you create a stack using the console, each stack event would be assigned the same token in the following format: Console-CreateStack-7f59c3cf-00d2-40c7-b2ff-e75db0987002 .
dict
Response Syntax
{ 'StackId': 'string' }
Response Structure
(dict) --
The output for an UpdateStack action.
StackId (string) --
Unique identifier of the stack.