AWS CloudFormation

2014/10/16 - AWS CloudFormation - 15 new api methods

UpdateStack (new) Link ¶

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

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',
    ]
)
type StackName

string

param StackName

[REQUIRED]

The name or stack ID of the stack to update.

Note

Must contain only alphanumeric characters (case sensitive) and start with an alpha character. Maximum length of the name is 255 characters.

type TemplateBody

string

param TemplateBody

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 AWS CloudFormation User Guide.)

Conditional: You must specify either the TemplateBody or the TemplateURL parameter, but not both.

type TemplateURL

string

param TemplateURL

Location of file containing the template body. The URL must point to a template located in an S3 bucket in the same region as the stack. For more information, go to Template Anatomy in the AWS CloudFormation User Guide.

Conditional: You must specify either the TemplateBody or the TemplateURL parameter, but not both.

type UsePreviousTemplate

boolean

param UsePreviousTemplate

Reuse the existing template that is associated with the stack that you are updating.

type StackPolicyDuringUpdateBody

string

param StackPolicyDuringUpdateBody

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.

type StackPolicyDuringUpdateURL

string

param StackPolicyDuringUpdateURL

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.

type Parameters

list

param Parameters

A list of Parameter structures that specify input parameters for the stack.

  • (dict) --

    The Parameter data type.

    • ParameterKey (string) --

      The key associated with the parameter.

    • ParameterValue (string) --

      The value associated with the parameter.

    • UsePreviousValue (boolean) --

      During a stack update, use the existing parameter value that is being used for the stack.

type Capabilities

list

param Capabilities

The list of capabilities that you want to allow in the stack. If your stack contains IAM resources, you must specify the CAPABILITY_IAM value for this parameter; otherwise, this action returns an InsufficientCapabilities error. IAM resources are the following: AWS::IAM::AccessKey, AWS::IAM::Group, AWS::IAM::Policy, AWS::IAM::User, and AWS::IAM::UserToGroupAddition.

  • (string) --

type StackPolicyBody

string

param StackPolicyBody

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.

type StackPolicyURL

string

param StackPolicyURL

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.

type NotificationARNs

list

param NotificationARNs

Update the ARNs for the Amazon SNS topics that are associated with the stack.

  • (string) --

rtype

dict

returns

Response Syntax

{
    'StackId': 'string'
}

Response Structure

  • (dict) --

    The output for a UpdateStack action.

    • StackId (string) --

      Unique identifier of the stack.

ListStackResources (new) Link ¶

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

client.list_stack_resources(
    StackName='string',
    NextToken='string'
)
type StackName

string

param StackName

[REQUIRED]

The name or the unique identifier 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.

type NextToken

string

param NextToken

String that identifies the start of the next list of stack resource summaries, if there is one.

Default: There is no default value.

rtype

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'|'UPDATE_IN_PROGRESS'|'UPDATE_FAILED'|'UPDATE_COMPLETE',
            'ResourceStatusReason': '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 AWS Resource Types Reference in the AWS 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.

    • NextToken (string) --

      String that identifies the start of the next list of stack resources, if there is one.

CreateStack (new) Link ¶

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

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'
        },
    ]
)
type StackName

string

param StackName

[REQUIRED]

The name associated with the stack. The name must be unique within your AWS account.

Note

Must contain only alphanumeric characters (case sensitive) and start with an alpha character. Maximum length of the name is 255 characters.

type TemplateBody

string

param TemplateBody

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 AWS CloudFormation User Guide.

Conditional: You must specify either the TemplateBody or the TemplateURL parameter, but not both.

type TemplateURL

string

param TemplateURL

Location of file containing the template body. The URL must point to a template (max size: 307,200 bytes) located in an S3 bucket in the same region as the stack. For more information, go to the Template Anatomy in the AWS CloudFormation User Guide.

Conditional: You must specify either the TemplateBody or the TemplateURL parameter, but not both.

type Parameters

list

param Parameters

A list of Parameter structures that specify input parameters for the stack.

  • (dict) --

    The Parameter data type.

    • ParameterKey (string) --

      The key associated with the parameter.

    • ParameterValue (string) --

      The value associated with the parameter.

    • UsePreviousValue (boolean) --

      During a stack update, use the existing parameter value that is being used for the stack.

type DisableRollback

boolean

param DisableRollback

Set to true to disable rollback of the stack if stack creation failed. You can specify either DisableRollback or OnFailure , but not both.

Default: false

type TimeoutInMinutes

integer

param TimeoutInMinutes

The amount of time that can pass before the stack status becomes CREATE_FAILED; if DisableRollback is not set or is set to false , the stack will be rolled back.

type NotificationARNs

list

param NotificationARNs

The Simple Notification Service (SNS) topic ARNs to publish stack related events. You can find your SNS topic ARNs using the SNS console or your Command Line Interface (CLI).

  • (string) --

type Capabilities

list

param Capabilities

The list of capabilities that you want to allow in the stack. If your template contains certain resources, you must specify the CAPABILITY_IAM value for this parameter; otherwise, this action returns an InsufficientCapabilities error. The following resources require you to specify the capabilities parameter: AWS::CloudFormation::Stack, AWS::IAM::AccessKey, AWS::IAM::Group, AWS::IAM::InstanceProfile, AWS::IAM::Policy, AWS::IAM::Role, AWS::IAM::User, and AWS::IAM::UserToGroupAddition.

  • (string) --

type OnFailure

string

param OnFailure

Determines what action will be taken if stack creation fails. This must be one of: DO_NOTHING, ROLLBACK, or DELETE. You can specify either OnFailure or DisableRollback , but not both.

Default: ROLLBACK

type StackPolicyBody

string

param StackPolicyBody

Structure containing the stack policy body. For more information, go to Prevent Updates to Stack Resources in the AWS CloudFormation User Guide. You can specify either the StackPolicyBody or the StackPolicyURL parameter, but not both.

type StackPolicyURL

string

param StackPolicyURL

Location of a file containing the 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.

type Tags

list

param Tags

A set of user-defined Tags to associate with this stack, represented by key/value pairs. Tags defined for the stack are propagated to EC2 resources that are created as part of the stack. A maximum number of 10 tags can be specified.

  • (dict) --

    The Tag type is used by CreateStack in the Tags parameter. It allows you to specify a key/value pair that can be used to store information related to cost allocation for an AWS 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 (AWS) 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.

rtype

dict

returns

Response Syntax

{
    'StackId': 'string'
}

Response Structure

  • (dict) --

    The output for a CreateStack action.

    • StackId (string) --

      Unique identifier of the stack.

DescribeStackEvents (new) Link ¶

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

client.describe_stack_events(
    StackName='string',
    NextToken='string'
)
type StackName

string

param StackName

The name or the unique identifier 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.

type NextToken

string

param NextToken

String that identifies the start of the next list of events, if there is one.

Default: There is no default value.

rtype

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'|'UPDATE_IN_PROGRESS'|'UPDATE_FAILED'|'UPDATE_COMPLETE',
            'ResourceStatusReason': 'string',
            'ResourceProperties': '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 AWS Resource Types Reference in the AWS 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.

    • NextToken (string) --

      String that identifies the start of the next list of events, if there is one.

GetTemplate (new) Link ¶

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

client.get_template(
    StackName='string'
)
type StackName

string

param StackName

[REQUIRED]

The name or the unique identifier 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.

rtype

dict

returns

Response Syntax

{
    'TemplateBody': 'string'
}

Response Structure

  • (dict) --

    The output for GetTemplate action.

    • TemplateBody (string) --

      Structure containing the template body. (For more information, go to Template Anatomy in the AWS CloudFormation User Guide.)

ListStacks (new) Link ¶

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

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',
    ]
)
type NextToken

string

param NextToken

String that identifies the start of the next list of stacks, if there is one.

Default: There is no default value.

type StackStatusFilter

list

param StackStatusFilter

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) --

rtype

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

  • (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.

    • NextToken (string) --

      String that identifies the start of the next list of stacks, if there is one.

DescribeStacks (new) Link ¶

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

client.describe_stacks(
    StackName='string',
    NextToken='string'
)
type StackName

string

param StackName

The name or the unique identifier 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.

type NextToken

string

param NextToken

String that identifies the start of the next list of stacks, if there is one.

rtype

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

  • (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.

        • Description (string) --

          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.

            • ParameterValue (string) --

              The value associated with the parameter.

            • UsePreviousValue (boolean) --

              During a stack update, use the existing parameter value that is being used for the stack.

        • CreationTime (datetime) --

          Time at which 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.

        • 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.

        • Tags (list) --

          A list of Tag s that specify cost allocation information for the stack.

          • (dict) --

            The Tag type is used by CreateStack in the Tags parameter. It allows you to specify a key/value pair that can be used to store information related to cost allocation for an AWS 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 (AWS) 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.

    • NextToken (string) -- String that identifies the start of the next list of stacks, if there is one.

CancelUpdateStack (new) Link ¶

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

client.cancel_update_stack(
    StackName='string'
)
type StackName

string

param StackName

[REQUIRED]

The name or the unique identifier associated with the stack.

returns

None

DeleteStack (new) Link ¶

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

client.delete_stack(
    StackName='string'
)
type StackName

string

param StackName

[REQUIRED]

The name or the unique identifier associated with the stack.

returns

None

SetStackPolicy (new) Link ¶

Sets a stack policy for a specified stack.

Request Syntax

client.set_stack_policy(
    StackName='string',
    StackPolicyBody='string',
    StackPolicyURL='string'
)
type StackName

string

param StackName

[REQUIRED]

The name or stack ID that you want to associate a policy with.

type StackPolicyBody

string

param StackPolicyBody

Structure containing the stack policy body. For more information, go to Prevent Updates to Stack Resources in the AWS CloudFormation User Guide. You can specify either the StackPolicyBody or the StackPolicyURL parameter, but not both.

type StackPolicyURL

string

param StackPolicyURL

Location of a file containing the 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.

returns

None

EstimateTemplateCost (new) Link ¶

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

client.estimate_template_cost(
    TemplateBody='string',
    TemplateURL='string',
    Parameters=[
        {
            'ParameterKey': 'string',
            'ParameterValue': 'string',
            'UsePreviousValue': True|False
        },
    ]
)
type TemplateBody

string

param TemplateBody

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 AWS CloudFormation User Guide.)

Conditional: You must pass TemplateBody or TemplateURL . If both are passed, only TemplateBody is used.

type TemplateURL

string

param TemplateURL

Location of file containing the template body. The URL must point to a template located in an S3 bucket in the same region as the stack. For more information, go to Template Anatomy in the AWS CloudFormation User Guide.

Conditional: You must pass TemplateURL or TemplateBody . If both are passed, only TemplateBody is used.

type Parameters

list

param Parameters

A list of Parameter structures that specify input parameters.

  • (dict) --

    The Parameter data type.

    • ParameterKey (string) --

      The key associated with the parameter.

    • ParameterValue (string) --

      The value associated with the parameter.

    • UsePreviousValue (boolean) --

      During a stack update, use the existing parameter value that is being used for the stack.

rtype

dict

returns

Response Syntax

{
    'Url': 'string'
}

Response Structure

  • (dict) --

    The output for a EstimateTemplateCost action.

    • Url (string) --

      An AWS Simple Monthly Calculator URL with a query string that describes the resources required to run the template.

DescribeStackResources (new) Link ¶

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

client.describe_stack_resources(
    StackName='string',
    LogicalResourceId='string',
    PhysicalResourceId='string'
)
type StackName

string

param StackName

The name or the unique identifier 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 .

type LogicalResourceId

string

param LogicalResourceId

The logical name of the resource as specified in the template.

Default: There is no default value.

type PhysicalResourceId

string

param PhysicalResourceId

The name or unique identifier that corresponds to a physical instance ID of a resource supported by AWS 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.

rtype

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'|'UPDATE_IN_PROGRESS'|'UPDATE_FAILED'|'UPDATE_COMPLETE',
            'ResourceStatusReason': 'string',
            'Description': '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 AWS CloudFormation.

        • ResourceType (string) --

          Type of resource. (For more information, go to AWS Resource Types Reference in the AWS 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.

ValidateTemplate (new) Link ¶

Validates a specified template.

Request Syntax

client.validate_template(
    TemplateBody='string',
    TemplateURL='string'
)
type TemplateBody

string

param TemplateBody

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 AWS CloudFormation User Guide.

Conditional: You must pass TemplateURL or TemplateBody . If both are passed, only TemplateBody is used.

type TemplateURL

string

param TemplateURL

Location of file containing the template body. The URL must point to a template (max size: 307,200 bytes) located in an S3 bucket in the same region as the stack. For more information, go to Template Anatomy in the AWS CloudFormation User Guide.

Conditional: You must pass TemplateURL or TemplateBody . If both are passed, only TemplateBody is used.

rtype

dict

returns

Response Syntax

{
    'Parameters': [
        {
            'ParameterKey': 'string',
            'DefaultValue': 'string',
            'NoEcho': True|False,
            'Description': 'string'
        },
    ],
    'Description': 'string',
    'Capabilities': [
        'CAPABILITY_IAM',
    ],
    'CapabilitiesReason': 'string'
}

Response Structure

  • (dict) --

    The output for ValidateTemplate action.

    • Parameters (list) --

      A list of TemplateParameter structures.

      • (dict) --

        The TemplateParameter data type.

        • ParameterKey (string) --

          The name associated with the parameter.

        • DefaultValue (string) --

          The default value associated with the parameter.

        • NoEcho (boolean) --

          Flag indicating whether the parameter should be displayed as plain text in logs and UIs.

        • Description (string) --

          User defined description associated with the parameter.

    • Description (string) --

      The description found within the template.

    • Capabilities (list) --

      The capabilities found within the template. Currently, CAPABILITY_IAM is the only capability detected. If your template contains IAM resources, you must specify the CAPABILITY_IAM value for this parameter when you use the CreateStack or UpdateStack actions with your template; otherwise, those actions return an InsufficientCapabilities error.

      • (string) --

    • CapabilitiesReason (string) --

      The capabilities reason found within the template.

GetStackPolicy (new) Link ¶

Returns the stack policy for a specified stack. If a stack doesn't have a policy, a null value is returned.

Request Syntax

client.get_stack_policy(
    StackName='string'
)
type StackName

string

param StackName

[REQUIRED]

The name or stack ID that is associated with the stack whose policy you want to get.

rtype

dict

returns

Response Syntax

{
    'StackPolicyBody': 'string'
}

Response Structure

  • (dict) --

    The output for the GetStackPolicy action.

    • StackPolicyBody (string) --

      Structure containing the stack policy body. (For more information, go to Prevent Updates to Stack Resources in the AWS CloudFormation User Guide.)

DescribeStackResource (new) Link ¶

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

client.describe_stack_resource(
    StackName='string',
    LogicalResourceId='string'
)
type StackName

string

param StackName

[REQUIRED]

The name or the unique identifier 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.

type LogicalResourceId

string

param LogicalResourceId

[REQUIRED]

The logical name of the resource as specified in the template.

Default: There is no default value.

rtype

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'|'UPDATE_IN_PROGRESS'|'UPDATE_FAILED'|'UPDATE_COMPLETE',
        'ResourceStatusReason': 'string',
        'Description': 'string',
        'Metadata': '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 AWS CloudFormation.

      • ResourceType (string) --

        Type of resource. ((For more information, go to AWS Resource Types Reference in the AWS 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 JSON format content of the Metadata attribute declared for the resource. For more information, see Metadata Attribute in the AWS CloudFormation User Guide.