AWS CloudFormation

2015/09/29 - AWS CloudFormation - 1 new 3 updated api methods

DescribeAccountLimits (new) Link ¶

Retrieves your account's AWS CloudFormation limits, such as the maximum number of stacks that you can create in your account.

Request Syntax

client.describe_account_limits(
    NextToken='string'
)
type NextToken

string

param NextToken

A string that identifies the next page of limits that you want to retrieve.

rtype

dict

returns

Response Syntax

{
    'AccountLimits': [
        {
            'Name': 'string',
            'Value': 123
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    The output for the DescribeAccountLimits action.

    • AccountLimits (list) --

      An account limit structure that contain a list of AWS CloudFormation account limits and their values.

      • (dict) --

        The AccountLimit data type.

        • Name (string) --

          The name of the account limit. Currently, the only account limit is StackLimit .

        • Value (integer) --

          The value that is associated with the account limit name.

    • NextToken (string) --

      A string that identifies the next page of limits. If no additional page exists, this value is null.

CreateStack (updated) Link ¶
Changes (request)
{'ResourceTypes': ['string']}

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',
    ],
    ResourceTypes=[
        'string',
    ],
    OnFailure='DO_NOTHING'|'ROLLBACK'|'DELETE',
    StackPolicyBody='string',
    StackPolicyURL='string',
    Tags=[
        {
            'Key': 'string',
            'Value': 'string'
        },
    ]
)
type StackName

string

param StackName

[REQUIRED]

The name that is associated with the stack. The name must be unique in the region in which you are creating the stack.

Note

A stack name can contain only alphanumeric characters (case sensitive) and hyphens. It must start with an alphabetic character and cannot be longer than 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: 460,800 bytes) that is located in an Amazon S3 bucket. 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. If you don't specify a key and value for a particular parameter, AWS CloudFormation uses the default value that is specified in your template.

    • ParameterValue (string) --

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

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

A list of capabilities that you must specify before AWS CloudFormation can create or update certain stacks. Some stack templates might include resources that can affect permissions in your AWS account. For those stacks, you must explicitly acknowledge their capabilities by specifying this parameter.

Currently, the only valid value is CAPABILITY_IAM , which is required for the following resources: AWS::IAM::AccessKey, AWS::IAM::Group, AWS::IAM::InstanceProfile, AWS::IAM::Policy, AWS::IAM::Role, AWS::IAM::User, and AWS::IAM::UserToGroupAddition. If your stack template contains these resources, we recommend that you review any permissions associated with them. If you don't specify this parameter, this action returns an InsufficientCapabilities error.

  • (string) --

type ResourceTypes

list

param ResourceTypes

The template resource types that you have permissions to work with for this create stack action, such as AWS::EC2::Instance , AWS::EC2::* , or Custom::MyCustomInstance . Use the following syntax to describe template resource types: AWS::* (for all AWS resource), Custom::* (for all custom resources), Custom::logical_ID (for a specific custom resource), AWS::service_name::* (for all resources of a particular AWS service), and AWS::service_name::resource_logical_ID (for a specific AWS resource).

If the list of resource types doesn't include a resource that you're creating, the stack creation fails. By default, AWS CloudFormation grants permissions to all resource types. AWS Identity and Access Management (IAM) uses this parameter for AWS CloudFormation-specific condition keys in IAM policies. For more information, see Controlling Access with AWS Identity and Access Management.

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

GetTemplateSummary (updated) Link ¶
Changes (response)
{'ResourceTypes': ['string']}

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

client.get_template_summary(
    TemplateBody='string',
    TemplateURL='string',
    StackName='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 about templates, see Template Anatomy in the AWS CloudFormation User Guide.

Conditional: You must specify only one of the following parameters: StackName , TemplateBody , or TemplateURL .

type TemplateURL

string

param TemplateURL

Location of file containing the template body. The URL must point to a template (max size: 460,800 bytes) that is located in an Amazon S3 bucket. For more information about templates, see Template Anatomy in the AWS CloudFormation User Guide.

Conditional: You must specify only one of the following parameters: StackName , TemplateBody , or TemplateURL .

type StackName

string

param StackName

The name or the stack ID that is associated with the stack, which are not always interchangeable. For running stacks, you can specify either the stack's name or its unique stack ID. For deleted stack, you must specify the unique stack ID.

Conditional: You must specify only one of the following parameters: StackName , TemplateBody , or TemplateURL .

rtype

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',
    'ResourceTypes': [
        'string',
    ],
    'Version': 'string',
    'Metadata': 'string'
}

Response Structure

  • (dict) --

    The output for the GetTemplateSummary action.

    • Parameters (list) --

      A list of parameter declarations that describe various properties for each parameter.

      • (dict) --

        The ParameterDeclaration data type.

        • ParameterKey (string) --

          The name that is associated with the parameter.

        • DefaultValue (string) --

          The default value of the parameter.

        • ParameterType (string) --

          The type of parameter.

        • NoEcho (boolean) --

          Flag that indicates whether the parameter value is shown as plain text in logs and in the AWS Management Console.

        • Description (string) --

          The description that is associate with the parameter.

        • ParameterConstraints (dict) --

          The criteria that AWS CloudFormation uses to validate parameter values.

          • AllowedValues (list) --

            A list of values that are permitted for a parameter.

            • (string) --

    • Description (string) --

      The value that is defined in the Description property of the template.

    • Capabilities (list) --

      The capabilities found within the template. Currently, AWS CloudFormation supports only the CAPABILITY_IAM capability. 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 list of resources that generated the values in the Capabilities response element.

    • ResourceTypes (list) --

      A list of all the template resource types that are defined in the template, such as AWS::EC2::Instance , AWS::Dynamo::Table , and Custom::MyCustomInstance . Use the following syntax to describe template resource types: AWS::* (for all AWS resources), Custom::* (for all custom resources), Custom::logical_ID (for a specific custom resource), AWS::service_name::* (for all resources of a particular AWS service), and AWS::service_name::resource_logical_ID (for a specific AWS resource).

      • (string) --

    • Version (string) --

      The AWS template format version, which identifies the capabilities of the template.

    • Metadata (string) --

      The value that is defined for the Metadata property of the template.

UpdateStack (updated) Link ¶
Changes (request)
{'ResourceTypes': ['string']}

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',
    ],
    ResourceTypes=[
        'string',
    ],
    StackPolicyBody='string',
    StackPolicyURL='string',
    NotificationARNs=[
        'string',
    ]
)
type StackName

string

param StackName

[REQUIRED]

The name or unique stack ID of the stack to update.

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 that is located in an Amazon S3 bucket. 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. 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, AWS CloudFormation uses the default value that is specified in your template.

    • ParameterValue (string) --

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

type Capabilities

list

param Capabilities

A list of capabilities that you must specify before AWS CloudFormation can create or update certain stacks. Some stack templates might include resources that can affect permissions in your AWS account. For those stacks, you must explicitly acknowledge their capabilities by specifying this parameter. Currently, the only valid value is CAPABILITY_IAM , which is required for the following resources: AWS::IAM::AccessKey, AWS::IAM::Group, AWS::IAM::InstanceProfile, AWS::IAM::Policy, AWS::IAM::Role, AWS::IAM::User, and AWS::IAM::UserToGroupAddition. If your stack template contains these resources, we recommend that you review any permissions associated with them. If you don't specify this parameter, this action returns an InsufficientCapabilities error.

  • (string) --

type ResourceTypes

list

param ResourceTypes

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, AWS CloudFormation grants permissions to all resource types. AWS Identity and Access Management (IAM) uses this parameter for AWS CloudFormation-specific condition keys in IAM policies. For more information, see Controlling Access with AWS Identity and Access Management

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