Table of Contents
CloudFormation.
Client
¶A low-level client representing AWS CloudFormation:
import boto3
client = boto3.client('cloudformation')
These are the available methods:
can_paginate()
cancel_update_stack()
create_stack()
delete_stack()
describe_stack_events()
describe_stack_resource()
describe_stack_resources()
describe_stacks()
estimate_template_cost()
generate_presigned_url()
get_paginator()
get_stack_policy()
get_template()
get_template_summary()
get_waiter()
list_stack_resources()
list_stacks()
set_stack_policy()
signal_resource()
update_stack()
validate_template()
can_paginate
(operation_name)¶Check if an operation can be paginated.
Parameters: | operation_name (string) -- The operation name. This is the same name
as the method name on the client. For example, if the
method name is create_foo , and you'd normally invoke the
operation as client.create_foo(**kwargs) , if the
create_foo operation can be paginated, you can use the
call client.get_paginator("create_foo") . |
---|---|
Returns: | True if the operation can be paginated,
False otherwise. |
cancel_update_stack
(**kwargs)¶Cancels an update on the specified stack. If the call completes successfully, the stack will roll back the update and revert to the previous stack configuration.
Note
Only stacks that are in the UPDATE_IN_PROGRESS state can be canceled.
Request Syntax
response = client.cancel_update_stack(
StackName='string'
)
Parameters: | StackName (string) -- [REQUIRED] The name or the unique stack ID that is associated with the stack. |
---|---|
Returns: | None |
create_stack
(**kwargs)¶Creates a stack as specified in the template. After the call completes successfully, the stack creation starts. You can check the status of the stack via the DescribeStacks API.
Request Syntax
response = client.create_stack(
StackName='string',
TemplateBody='string',
TemplateURL='string',
Parameters=[
{
'ParameterKey': 'string',
'ParameterValue': 'string',
'UsePreviousValue': True|False
},
],
DisableRollback=True|False,
TimeoutInMinutes=123,
NotificationARNs=[
'string',
],
Capabilities=[
'CAPABILITY_IAM',
],
OnFailure='DO_NOTHING'|'ROLLBACK'|'DELETE',
StackPolicyBody='string',
StackPolicyURL='string',
Tags=[
{
'Key': 'string',
'Value': 'string'
},
]
)
Parameters: |
|
---|---|
Return type: | dict |
Returns: | Response Syntax {
'StackId': 'string'
}
Response Structure
|
delete_stack
(**kwargs)¶Deletes a specified stack. Once the call completes successfully, stack deletion starts. Deleted stacks do not show up in the DescribeStacks API if the deletion has been completed successfully.
Request Syntax
response = client.delete_stack(
StackName='string'
)
Parameters: | StackName (string) -- [REQUIRED] The name or the unique stack ID that is associated with the stack. |
---|---|
Returns: | None |
describe_stack_events
(**kwargs)¶Returns all stack related events for a specified stack. For more information about a stack's event history, go to Stacks in the AWS 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).
Request Syntax
response = client.describe_stack_events(
StackName='string',
NextToken='string'
)
Parameters: |
|
---|---|
Return type: | dict |
Returns: | 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',
'ResourceStatusReason': 'string',
'ResourceProperties': 'string'
},
],
'NextToken': 'string'
}
Response Structure
|
describe_stack_resource
(**kwargs)¶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.
Request Syntax
response = client.describe_stack_resource(
StackName='string',
LogicalResourceId='string'
)
Parameters: |
|
---|---|
Return type: | dict |
Returns: | 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',
'ResourceStatusReason': 'string',
'Description': 'string',
'Metadata': 'string'
}
}
Response Structure
|
describe_stack_resources
(**kwargs)¶Returns AWS 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 AWS CloudFormation User Guide .
Note
A ValidationError
is returned if you specify both StackName
and PhysicalResourceId
in the same request.
Request Syntax
response = client.describe_stack_resources(
StackName='string',
LogicalResourceId='string',
PhysicalResourceId='string'
)
Parameters: |
|
---|---|
Return type: | dict |
Returns: | 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',
'ResourceStatusReason': 'string',
'Description': 'string'
},
]
}
Response Structure
|
describe_stacks
(**kwargs)¶Returns the description for the specified stack; if no stack name was specified, then it returns the description for all the stacks created.
Request Syntax
response = client.describe_stacks(
StackName='string',
NextToken='string'
)
Parameters: |
|
---|---|
Return type: | dict |
Returns: | Response Syntax {
'Stacks': [
{
'StackId': 'string',
'StackName': 'string',
'Description': 'string',
'Parameters': [
{
'ParameterKey': 'string',
'ParameterValue': 'string',
'UsePreviousValue': True|False
},
],
'CreationTime': datetime(2015, 1, 1),
'LastUpdatedTime': 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_ROLLBACK_IN_PROGRESS'|'UPDATE_ROLLBACK_FAILED'|'UPDATE_ROLLBACK_COMPLETE_CLEANUP_IN_PROGRESS'|'UPDATE_ROLLBACK_COMPLETE',
'StackStatusReason': 'string',
'DisableRollback': True|False,
'NotificationARNs': [
'string',
],
'TimeoutInMinutes': 123,
'Capabilities': [
'CAPABILITY_IAM',
],
'Outputs': [
{
'OutputKey': 'string',
'OutputValue': 'string',
'Description': 'string'
},
],
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
},
],
'NextToken': 'string'
}
Response Structure
|
estimate_template_cost
(**kwargs)¶Returns the estimated monthly cost of a template. The return value is an AWS Simple Monthly Calculator URL with a query string that describes the resources required to run the template.
Request Syntax
response = client.estimate_template_cost(
TemplateBody='string',
TemplateURL='string',
Parameters=[
{
'ParameterKey': 'string',
'ParameterValue': 'string',
'UsePreviousValue': True|False
},
]
)
Parameters: |
|
---|---|
Return type: | dict |
Returns: | Response Syntax {
'Url': 'string'
}
Response Structure
|
generate_presigned_url
(ClientMethod, Params=None, ExpiresIn=3600, HttpMethod=None)¶Generate a presigned url given a client, its method, and arguments
Parameters: |
|
---|---|
Returns: | The presigned url |
get_paginator
(operation_name)¶Create a paginator for an operation.
Parameters: | operation_name (string) -- The operation name. This is the same name
as the method name on the client. For example, if the
method name is create_foo , and you'd normally invoke the
operation as client.create_foo(**kwargs) , if the
create_foo operation can be paginated, you can use the
call client.get_paginator("create_foo") . |
---|---|
Raises OperationNotPageableError: | |
Raised if the operation is not
pageable. You can use the client.can_paginate method to
check if an operation is pageable. |
|
Return type: | L{botocore.paginate.Paginator} |
Returns: | A paginator object. |
get_stack_policy
(**kwargs)¶Returns the stack policy for a specified stack. If a stack doesn't have a policy, a null value is returned.
Request Syntax
response = client.get_stack_policy(
StackName='string'
)
Parameters: | StackName (string) -- [REQUIRED] The name or unique stack ID that is associated with the stack whose policy you want to get. |
---|---|
Return type: | dict |
Returns: | Response Syntax{
'StackPolicyBody': 'string'
}
Response Structure
|
get_template
(**kwargs)¶Returns the template body for a specified stack. You can get the template for running or deleted stacks.
For deleted stacks, GetTemplate returns the template for up to 90 days after the stack has been deleted.
Note
If the template does not exist, a ValidationError
is returned.
Request Syntax
response = client.get_template(
StackName='string'
)
Parameters: | StackName (string) -- [REQUIRED] The name or the unique stack ID that is associated with the stack, which are not always interchangeable:
Default: There is no default value. |
---|---|
Return type: | dict |
Returns: | Response Syntax{
'TemplateBody': 'string'
}
Response Structure
|
get_template_summary
(**kwargs)¶Returns information about a new or existing template. The GetTemplateSummary
action is useful for viewing parameter information, such as default parameter values and parameter types, before you create or update a stack.
You can use the GetTemplateSummary
action when you submit a template, or you can get template information for a running or deleted stack.
For deleted stacks, GetTemplateSummary
returns the template information for up to 90 days after the stack has been deleted. If the template does not exist, a ValidationError
is returned.
Request Syntax
response = client.get_template_summary(
TemplateBody='string',
TemplateURL='string',
StackName='string'
)
Parameters: |
|
---|---|
Return type: | dict |
Returns: | Response Syntax {
'Parameters': [
{
'ParameterKey': 'string',
'DefaultValue': 'string',
'ParameterType': 'string',
'NoEcho': True|False,
'Description': 'string',
'ParameterConstraints': {
'AllowedValues': [
'string',
]
}
},
],
'Description': 'string',
'Capabilities': [
'CAPABILITY_IAM',
],
'CapabilitiesReason': 'string',
'Version': 'string',
'Metadata': 'string'
}
Response Structure
|
get_waiter
(waiter_name)¶list_stack_resources
(**kwargs)¶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.
Request Syntax
response = client.list_stack_resources(
StackName='string',
NextToken='string'
)
Parameters: |
|
---|---|
Return type: | dict |
Returns: | 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',
'ResourceStatusReason': 'string'
},
],
'NextToken': 'string'
}
Response Structure
|
list_stacks
(**kwargs)¶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).
Request Syntax
response = 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_ROLLBACK_IN_PROGRESS'|'UPDATE_ROLLBACK_FAILED'|'UPDATE_ROLLBACK_COMPLETE_CLEANUP_IN_PROGRESS'|'UPDATE_ROLLBACK_COMPLETE',
]
)
Parameters: |
|
---|---|
Return type: | dict |
Returns: | 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_ROLLBACK_IN_PROGRESS'|'UPDATE_ROLLBACK_FAILED'|'UPDATE_ROLLBACK_COMPLETE_CLEANUP_IN_PROGRESS'|'UPDATE_ROLLBACK_COMPLETE',
'StackStatusReason': 'string'
},
],
'NextToken': 'string'
}
Response Structure
|
set_stack_policy
(**kwargs)¶Sets a stack policy for a specified stack.
Request Syntax
response = client.set_stack_policy(
StackName='string',
StackPolicyBody='string',
StackPolicyURL='string'
)
Parameters: |
|
---|---|
Returns: | None |
signal_resource
(**kwargs)¶Sends a signal to the specified resource with a success or failure status. You can use the SignalResource API in conjunction with a creation policy or update policy. AWS CloudFormation doesn't proceed with a stack creation or update until resources receive the required number of signals or the timeout period is exceeded. The SignalResource API is useful in cases where you want to send signals from anywhere other than an Amazon EC2 instance.
Request Syntax
response = client.signal_resource(
StackName='string',
LogicalResourceId='string',
UniqueId='string',
Status='SUCCESS'|'FAILURE'
)
Parameters: |
|
---|---|
Returns: | None |
update_stack
(**kwargs)¶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.
Tags that were associated with this stack during creation time will still be associated with the stack after an UpdateStack
operation.
For more information about creating an update template, updating a stack, and monitoring the progress of the update, see Updating a Stack .
Request Syntax
response = client.update_stack(
StackName='string',
TemplateBody='string',
TemplateURL='string',
UsePreviousTemplate=True|False,
StackPolicyDuringUpdateBody='string',
StackPolicyDuringUpdateURL='string',
Parameters=[
{
'ParameterKey': 'string',
'ParameterValue': 'string',
'UsePreviousValue': True|False
},
],
Capabilities=[
'CAPABILITY_IAM',
],
StackPolicyBody='string',
StackPolicyURL='string',
NotificationARNs=[
'string',
]
)
Parameters: |
|
---|---|
Return type: | dict |
Returns: | Response Syntax {
'StackId': 'string'
}
Response Structure
|
validate_template
(**kwargs)¶Validates a specified template.
Request Syntax
response = client.validate_template(
TemplateBody='string',
TemplateURL='string'
)
Parameters: |
|
---|---|
Return type: | dict |
Returns: | Response Syntax {
'Parameters': [
{
'ParameterKey': 'string',
'DefaultValue': 'string',
'NoEcho': True|False,
'Description': 'string'
},
],
'Description': 'string',
'Capabilities': [
'CAPABILITY_IAM',
],
'CapabilitiesReason': 'string'
}
Response Structure
|
The available paginators are:
CloudFormation.Paginator.describe_stack_events
CloudFormation.Paginator.describe_stacks
CloudFormation.Paginator.list_stack_resources
CloudFormation.Paginator.list_stacks
CloudFormation.Paginator.
describe_stack_events
¶paginator = client.get_paginator('describe_stack_events')
paginate
(**kwargs)¶Creates an iterator that will paginate through responses from CloudFormation.Client.describe_stack_events()
.
Request Syntax
response_iterator = paginator.paginate(
StackName='string',
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
Parameters: |
|
---|---|
Return type: | dict |
Returns: | 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',
'ResourceStatusReason': 'string',
'ResourceProperties': 'string'
},
],
}
Response Structure
|
CloudFormation.Paginator.
describe_stacks
¶paginator = client.get_paginator('describe_stacks')
paginate
(**kwargs)¶Creates an iterator that will paginate through responses from CloudFormation.Client.describe_stacks()
.
Request Syntax
response_iterator = paginator.paginate(
StackName='string',
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
Parameters: |
|
---|---|
Return type: | dict |
Returns: | Response Syntax {
'Stacks': [
{
'StackId': 'string',
'StackName': 'string',
'Description': 'string',
'Parameters': [
{
'ParameterKey': 'string',
'ParameterValue': 'string',
'UsePreviousValue': True|False
},
],
'CreationTime': datetime(2015, 1, 1),
'LastUpdatedTime': 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_ROLLBACK_IN_PROGRESS'|'UPDATE_ROLLBACK_FAILED'|'UPDATE_ROLLBACK_COMPLETE_CLEANUP_IN_PROGRESS'|'UPDATE_ROLLBACK_COMPLETE',
'StackStatusReason': 'string',
'DisableRollback': True|False,
'NotificationARNs': [
'string',
],
'TimeoutInMinutes': 123,
'Capabilities': [
'CAPABILITY_IAM',
],
'Outputs': [
{
'OutputKey': 'string',
'OutputValue': 'string',
'Description': 'string'
},
],
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
},
],
}
Response Structure
|
CloudFormation.Paginator.
list_stack_resources
¶paginator = client.get_paginator('list_stack_resources')
paginate
(**kwargs)¶Creates an iterator that will paginate through responses from CloudFormation.Client.list_stack_resources()
.
Request Syntax
response_iterator = paginator.paginate(
StackName='string',
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
Parameters: |
|
---|---|
Return type: | dict |
Returns: | 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',
'ResourceStatusReason': 'string'
},
],
}
Response Structure
|
CloudFormation.Paginator.
list_stacks
¶paginator = client.get_paginator('list_stacks')
paginate
(**kwargs)¶Creates an iterator that will paginate through responses from CloudFormation.Client.list_stacks()
.
Request Syntax
response_iterator = paginator.paginate(
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_ROLLBACK_IN_PROGRESS'|'UPDATE_ROLLBACK_FAILED'|'UPDATE_ROLLBACK_COMPLETE_CLEANUP_IN_PROGRESS'|'UPDATE_ROLLBACK_COMPLETE',
],
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
Parameters: |
|
---|---|
Return type: | dict |
Returns: | 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_ROLLBACK_IN_PROGRESS'|'UPDATE_ROLLBACK_FAILED'|'UPDATE_ROLLBACK_COMPLETE_CLEANUP_IN_PROGRESS'|'UPDATE_ROLLBACK_COMPLETE',
'StackStatusReason': 'string'
},
],
}
Response Structure
|
CloudFormation.
ServiceResource
¶A resource representing AWS CloudFormation:
import boto3
cloudformation = boto3.resource('cloudformation')
These are the resource's available actions:
These are the resource's available sub-resources:
These are the resource's available collections:
Actions
Actions call operations on resources. They may automatically handle the passing in of arguments set from identifiers and some attributes. For more information about actions refer to the Resources Introduction Guide.
create_stack
(**kwargs)¶Creates a stack as specified in the template. After the call completes successfully, the stack creation starts. You can check the status of the stack via the DescribeStacks API.
Request Syntax
stack = cloudformation.create_stack(
StackName='string',
TemplateBody='string',
TemplateURL='string',
Parameters=[
{
'ParameterKey': 'string',
'ParameterValue': 'string',
'UsePreviousValue': True|False
},
],
DisableRollback=True|False,
TimeoutInMinutes=123,
NotificationARNs=[
'string',
],
Capabilities=[
'CAPABILITY_IAM',
],
OnFailure='DO_NOTHING'|'ROLLBACK'|'DELETE',
StackPolicyBody='string',
StackPolicyURL='string',
Tags=[
{
'Key': 'string',
'Value': 'string'
},
]
)
Parameters: |
|
---|---|
Return type: |
|
Returns: | A Stack resource |
Sub-resources
Sub-resources are methods that create a new instance of a child resource. This resource's identifiers get passed along to the child. For more information about sub-resources refer to the Resources Introduction Guide.
Event
(id)¶Creates a Event resource.:
event = cloudformation.Event('id')
Parameters: | id (string) -- The Event's id identifier. This must be set. |
---|---|
Return type: | CloudFormation.Event |
Returns: | A Event resource |
Stack
(name)¶Creates a Stack resource.:
stack = cloudformation.Stack('name')
Parameters: | name (string) -- The Stack's name identifier. This must be set. |
---|---|
Return type: | CloudFormation.Stack |
Returns: | A Stack resource |
StackResource
(stack_name, logical_id)¶Creates a StackResource resource.:
stack_resource = cloudformation.StackResource('stack_name','logical_id')
Parameters: |
|
---|---|
Return type: | |
Returns: | A StackResource resource |
StackResourceSummary
(stack_name, logical_id)¶Creates a StackResourceSummary resource.:
stack_resource_summary = cloudformation.StackResourceSummary('stack_name','logical_id')
Parameters: |
|
---|---|
Return type: | |
Returns: | A StackResourceSummary resource |
Collections
Collections provide an interface to iterate over and manipulate groups of resources. For more information about collections refer to the Resources Introduction Guide.
stacks
¶all
()¶Creates an iterable of all Stack resources in the collection.
Request Syntax
stack_iterator = cloudformation.stacks.all()
Return type: | cloudformation.Stack |
---|---|
Returns: | A Stack resource |
filter
(**kwargs)¶Creates an iterable of all Stack resources in the collection filtered by kwargs passed to method.
Request Syntax
stack_iterator = cloudformation.stacks.filter(
StackName='string',
NextToken='string'
)
Parameters: |
|
---|---|
Return type: |
|
Returns: | A Stack resource |
limit
(**kwargs)¶Creates an iterable up to a specified amount of Stack resources in the collection.
Request Syntax
stack_iterator = cloudformation.stacks.limit(
count=123
)
Parameters: | count (integer) -- The limit to the number of resources in the iterable. |
---|---|
Return type: | cloudformation.Stack |
Returns: | A Stack resource |
page_size
(**kwargs)¶Creates an iterable of all Stack resources in the collection, but limits the number of items returned by each service call by the specified amount.
Request Syntax
stack_iterator = cloudformation.stacks.page_size(
count=123
)
Parameters: | count (integer) -- The number of items returned by each service call |
---|---|
Return type: | cloudformation.Stack |
Returns: | A Stack resource |
CloudFormation.
Event
(id)¶A resource representing an AWS CloudFormation Event:
import boto3
cloudformation = boto3.resource('cloudformation')
event = cloudformation.Event('id')
Parameters: | id (string) -- The Event's id identifier. This must be set. |
---|
These are the resource's available identifiers:
These are the resource's available attributes:
stack_id
timestamp
logical_resource_id
stack_name
event_id
resource_status_reason
resource_status
physical_resource_id
resource_properties
resource_type
Identifiers
Identifiers are properties of a resource that are set upon instantation of the resource. For more information about identifiers refer to the Resources Introduction Guide.
id
¶(string) The Event's id identifier. This must be set.
Attributes
Attributes provide access to the properties of a resource. Attributes are lazy-loaded the first time one is accessed via the load()
method.
For more information about attributes refer to the Resources Introduction Guide.
stack_id
¶(string)
The unique ID name of the instance of the stack.
timestamp
¶(datetime)
Time the status was updated.
logical_resource_id
¶(string)
The logical name of the resource specified in the template.
stack_name
¶(string)
The name associated with a stack.
event_id
¶(string)
The unique ID of this event.
resource_status_reason
¶(string)
Success/failure message associated with the resource.
resource_status
¶(string)
Current status of the resource.
physical_resource_id
¶(string)
The name or unique identifier associated with the physical instance of the resource.
resource_properties
¶(string)
BLOB of the properties used to create the resource.
resource_type
¶(string)
Type of resource. (For more information, go to AWS Resource Types Reference in the AWS CloudFormation User Guide.)
CloudFormation.
Stack
(name)¶A resource representing an AWS CloudFormation Stack:
import boto3
cloudformation = boto3.resource('cloudformation')
stack = cloudformation.Stack('name')
Parameters: | name (string) -- The Stack's name identifier. This must be set. |
---|
These are the resource's available identifiers:
These are the resource's available attributes:
disable_rollback
description
parameters
stack_status_reason
stack_id
outputs
tags
creation_time
last_updated_time
capabilities
stack_name
stack_status
timeout_in_minutes
notification_arns
These are the resource's available actions:
These are the resource's available sub-resources:
These are the resource's available collections:
Identifiers
Identifiers are properties of a resource that are set upon instantation of the resource. For more information about identifiers refer to the Resources Introduction Guide.
name
¶(string) The Stack's name identifier. This must be set.
Attributes
Attributes provide access to the properties of a resource. Attributes are lazy-loaded the first time one is accessed via the load()
method.
For more information about attributes refer to the Resources Introduction Guide.
disable_rollback
¶(boolean)
Boolean to enable or disable rollback on stack creation failures:
true
: disable rollbackfalse
: enable rollbackdescription
¶(string)
User defined description associated with the stack.
parameters
¶(list)
A list of Parameter
structures.
stack_status_reason
¶(string)
Success/failure message associated with the stack status.
stack_id
¶(string)
Unique identifier of the stack.
outputs
¶(list)
A list of output structures.
(list)
A list of Tag
s that specify cost allocation information for the stack.
creation_time
¶(datetime)
Time at which the stack was created.
last_updated_time
¶(datetime)
The time the stack was last updated. This field will only be returned if the stack has been updated at least once.
capabilities
¶(list)
The capabilities allowed in the stack.
stack_name
¶(string)
The name associated with the stack.
stack_status
¶(string)
Current status of the stack.
timeout_in_minutes
¶(integer)
The amount of time within which stack creation should complete.
notification_arns
¶(list)
SNS topic ARNs to which stack related events are published.
Actions
Actions call operations on resources. They may automatically handle the passing in of arguments set from identifiers and some attributes. For more information about actions refer to the Resources Introduction Guide.
cancel_update
()¶Cancels an update on the specified stack. If the call completes successfully, the stack will roll back the update and revert to the previous stack configuration.
Note
Only stacks that are in the UPDATE_IN_PROGRESS state can be canceled.
Request Syntax
response = stack.cancel_update()
Returns: | None |
---|
delete
()¶Deletes a specified stack. Once the call completes successfully, stack deletion starts. Deleted stacks do not show up in the DescribeStacks API if the deletion has been completed successfully.
Request Syntax
response = stack.delete()
Returns: | None |
---|
load
()¶Calls cloudformation.Client.describe_stacks()
to update the attributes of the Stack resource
Request Syntax
stack.load()
Returns: | None |
---|
reload
()¶Calls cloudformation.Client.describe_stacks()
to update the attributes of the Stack resource
Request Syntax
stack.reload()
Returns: | None |
---|
update
(**kwargs)¶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.
Tags that were associated with this stack during creation time will still be associated with the stack after an UpdateStack
operation.
For more information about creating an update template, updating a stack, and monitoring the progress of the update, see Updating a Stack .
Request Syntax
response = stack.update(
TemplateBody='string',
TemplateURL='string',
UsePreviousTemplate=True|False,
StackPolicyDuringUpdateBody='string',
StackPolicyDuringUpdateURL='string',
Parameters=[
{
'ParameterKey': 'string',
'ParameterValue': 'string',
'UsePreviousValue': True|False
},
],
Capabilities=[
'CAPABILITY_IAM',
],
StackPolicyBody='string',
StackPolicyURL='string',
NotificationARNs=[
'string',
]
)
Parameters: |
|
---|---|
Return type: | dict |
Returns: | Response Syntax {
'StackId': 'string'
}
Response Structure
|
Sub-resources
Sub-resources are methods that create a new instance of a child resource. This resource's identifiers get passed along to the child. For more information about sub-resources refer to the Resources Introduction Guide.
Resource
(logical_id)¶Creates a StackResource resource.:
stack_resource = stack.Resource('logical_id')
Parameters: | logical_id (string) -- The Resource's logical_id identifier. This must be set. |
---|---|
Return type: | CloudFormation.StackResource |
Returns: | A StackResource resource |
Collections
Collections provide an interface to iterate over and manipulate groups of resources. For more information about collections refer to the Resources Introduction Guide.
events
¶all
()¶Creates an iterable of all Event resources in the collection.
Request Syntax
event_iterator = stack.events.all()
Return type: | cloudformation.Event |
---|---|
Returns: | A Event resource |
filter
(**kwargs)¶Creates an iterable of all Event resources in the collection filtered by kwargs passed to method.
Request Syntax
event_iterator = stack.events.filter(
NextToken='string'
)
Parameters: | NextToken (string) -- String that identifies the start of the next list of events, if there is one. Default: There is no default value. |
---|---|
Return type: | cloudformation.Event |
Returns: | A Event resource |
limit
(**kwargs)¶Creates an iterable up to a specified amount of Event resources in the collection.
Request Syntax
event_iterator = stack.events.limit(
count=123
)
Parameters: | count (integer) -- The limit to the number of resources in the iterable. |
---|---|
Return type: | cloudformation.Event |
Returns: | A Event resource |
page_size
(**kwargs)¶Creates an iterable of all Event resources in the collection, but limits the number of items returned by each service call by the specified amount.
Request Syntax
event_iterator = stack.events.page_size(
count=123
)
Parameters: | count (integer) -- The number of items returned by each service call |
---|---|
Return type: | cloudformation.Event |
Returns: | A Event resource |
resource_summaries
¶all
()Creates an iterable of all StackResourceSummary resources in the collection.
Request Syntax
stack_resource_summary_iterator = stack.resource_summaries.all()
Return type: | cloudformation.StackResourceSummary |
---|---|
Returns: | A StackResourceSummary resource |
filter
(**kwargs)Creates an iterable of all StackResourceSummary resources in the collection filtered by kwargs passed to method.
Request Syntax
stack_resource_summary_iterator = stack.resource_summaries.filter(
NextToken='string'
)
Parameters: | NextToken (string) -- String that identifies the start of the next list of stack resource summaries, if there is one. Default: There is no default value. |
---|---|
Return type: | cloudformation.StackResourceSummary |
Returns: | A StackResourceSummary resource |
limit
(**kwargs)Creates an iterable up to a specified amount of StackResourceSummary resources in the collection.
Request Syntax
stack_resource_summary_iterator = stack.resource_summaries.limit(
count=123
)
Parameters: | count (integer) -- The limit to the number of resources in the iterable. |
---|---|
Return type: | cloudformation.StackResourceSummary |
Returns: | A StackResourceSummary resource |
page_size
(**kwargs)Creates an iterable of all StackResourceSummary resources in the collection, but limits the number of items returned by each service call by the specified amount.
Request Syntax
stack_resource_summary_iterator = stack.resource_summaries.page_size(
count=123
)
Parameters: | count (integer) -- The number of items returned by each service call |
---|---|
Return type: | cloudformation.StackResourceSummary |
Returns: | A StackResourceSummary resource |
CloudFormation.
StackResource
(stack_name, logical_id)¶A resource representing an AWS CloudFormation StackResource:
import boto3
cloudformation = boto3.resource('cloudformation')
stack_resource = cloudformation.StackResource('stack_name','logical_id')
Parameters: |
|
---|
These are the resource's available identifiers:
These are the resource's available attributes:
description
last_updated_timestamp
stack_id
logical_resource_id
resource_status
resource_status_reason
physical_resource_id
resource_type
metadata
These are the resource's available sub-resources:
Identifiers
Identifiers are properties of a resource that are set upon instantation of the resource. For more information about identifiers refer to the Resources Introduction Guide.
stack_name
¶(string) The StackResource's stack_name identifier. This must be set.
logical_id
¶(string) The StackResource's logical_id identifier. This must be set.
Attributes
Attributes provide access to the properties of a resource. Attributes are lazy-loaded the first time one is accessed via the load()
method.
For more information about attributes refer to the Resources Introduction Guide.
description
¶(string)
User defined description associated with the resource.
last_updated_timestamp
¶(datetime)
Time the status was updated.
stack_id
¶(string)
Unique identifier of the stack.
logical_resource_id
¶(string)
The logical name of the resource specified in the template.
resource_status
¶(string)
Current status of the resource.
resource_status_reason
¶(string)
Success/failure message associated with the resource.
physical_resource_id
¶(string)
The name or unique identifier that corresponds to a physical instance ID of a resource supported by AWS CloudFormation.
resource_type
¶(string)
Type of resource. ((For more information, go to AWS Resource Types Reference in the AWS CloudFormation User Guide.)
metadata
¶(string)
The JSON format content of the Metadata
attribute declared for the resource. For more information, see Metadata Attribute in the AWS CloudFormation User Guide.
Sub-resources
Sub-resources are methods that create a new instance of a child resource. This resource's identifiers get passed along to the child. For more information about sub-resources refer to the Resources Introduction Guide.
Stack
()¶Creates a Stack resource.:
stack = stack_resource.Stack()
Return type: | CloudFormation.Stack |
---|---|
Returns: | A Stack resource |
CloudFormation.
StackResourceSummary
(stack_name, logical_id)¶A resource representing an AWS CloudFormation StackResourceSummary:
import boto3
cloudformation = boto3.resource('cloudformation')
stack_resource_summary = cloudformation.StackResourceSummary('stack_name','logical_id')
Parameters: |
|
---|
These are the resource's available identifiers:
These are the resource's available attributes:
last_updated_timestamp
logical_resource_id
resource_status
resource_status_reason
physical_resource_id
resource_type
These are the resource's available sub-resources:
Identifiers
Identifiers are properties of a resource that are set upon instantation of the resource. For more information about identifiers refer to the Resources Introduction Guide.
stack_name
¶(string) The StackResourceSummary's stack_name identifier. This must be set.
logical_id
¶(string) The StackResourceSummary's logical_id identifier. This must be set.
Attributes
Attributes provide access to the properties of a resource. Attributes are lazy-loaded the first time one is accessed via the load()
method.
For more information about attributes refer to the Resources Introduction Guide.
last_updated_timestamp
¶(datetime)
Time the status was updated.
logical_resource_id
¶(string)
The logical name of the resource specified in the template.
resource_status
¶(string)
Current status of the resource.
resource_status_reason
¶(string)
Success/failure message associated with the resource.
physical_resource_id
¶(string)
The name or unique identifier that corresponds to a physical instance ID of the resource.
resource_type
¶(string)
Type of resource. (For more information, go to AWS Resource Types Reference in the AWS CloudFormation User Guide.)
Sub-resources
Sub-resources are methods that create a new instance of a child resource. This resource's identifiers get passed along to the child. For more information about sub-resources refer to the Resources Introduction Guide.
Resource
()¶Creates a StackResource resource.:
stack_resource = stack_resource_summary.Resource()
Return type: | CloudFormation.StackResource |
---|---|
Returns: | A StackResource resource |