You are viewing documentation for version 2 of the AWS SDK for Ruby. Version 3 documentation can be found here.

Class: Aws::CloudFormation::Client

Inherits:
Seahorse::Client::Base show all
Defined in:
(unknown)

Overview

An API client for AWS CloudFormation. To construct a client, you need to configure a :region and :credentials.

cloudformation = Aws::CloudFormation::Client.new(
  region: region_name,
  credentials: credentials,
  # ...
)

See #initialize for a full list of supported configuration options.

Region

You can configure a default region in the following locations:

  • ENV['AWS_REGION']
  • Aws.config[:region]

Go here for a list of supported regions.

Credentials

Default credentials are loaded automatically from the following locations:

  • ENV['AWS_ACCESS_KEY_ID'] and ENV['AWS_SECRET_ACCESS_KEY']
  • Aws.config[:credentials]
  • The shared credentials ini file at ~/.aws/credentials (more information)
  • From an instance profile when running on EC2

You can also construct a credentials object from one of the following classes:

Alternatively, you configure credentials with :access_key_id and :secret_access_key:

# load credentials from disk
creds = YAML.load(File.read('/path/to/secrets'))

Aws::CloudFormation::Client.new(
  access_key_id: creds['access_key_id'],
  secret_access_key: creds['secret_access_key']
)

Always load your credentials from outside your application. Avoid configuring credentials statically and never commit them to source control.

Instance Attribute Summary

Attributes inherited from Seahorse::Client::Base

#config, #handlers

Constructor collapse

API Operations collapse

Instance Method Summary collapse

Methods inherited from Seahorse::Client::Base

add_plugin, api, #build_request, clear_plugins, define, new, #operation, #operation_names, plugins, remove_plugin, set_api, set_plugins

Methods included from Seahorse::Client::HandlerBuilder

#handle, #handle_request, #handle_response

Constructor Details

#initialize(options = {}) ⇒ Aws::CloudFormation::Client

Constructs an API client.

Options Hash (options):

  • :access_key_id (String)

    Used to set credentials statically. See Plugins::RequestSigner for more details.

  • :active_endpoint_cache (Boolean)

    When set to true, a thread polling for endpoints will be running in the background every 60 secs (default). Defaults to false. See Plugins::EndpointDiscovery for more details.

  • :convert_params (Boolean) — default: true

    When true, an attempt is made to coerce request parameters into the required types. See Plugins::ParamConverter for more details.

  • :credentials (required, Credentials)

    Your AWS credentials. The following locations will be searched in order for credentials:

    • :access_key_id, :secret_access_key, and :session_token options
    • ENV['AWS_ACCESS_KEY_ID'], ENV['AWS_SECRET_ACCESS_KEY']
    • HOME/.aws/credentials shared credentials file
    • EC2 instance profile credentials See Plugins::RequestSigner for more details.
  • :disable_host_prefix_injection (Boolean)

    Set to true to disable SDK automatically adding host prefix to default service endpoint when available. See Plugins::EndpointPattern for more details.

  • :endpoint (String)

    A default endpoint is constructed from the :region. See Plugins::RegionalEndpoint for more details.

  • :endpoint_cache_max_entries (Integer)

    Used for the maximum size limit of the LRU cache storing endpoints data for endpoint discovery enabled operations. Defaults to 1000. See Plugins::EndpointDiscovery for more details.

  • :endpoint_cache_max_threads (Integer)

    Used for the maximum threads in use for polling endpoints to be cached, defaults to 10. See Plugins::EndpointDiscovery for more details.

  • :endpoint_cache_poll_interval (Integer)

    When :endpoint_discovery and :active_endpoint_cache is enabled, Use this option to config the time interval in seconds for making requests fetching endpoints information. Defaults to 60 sec. See Plugins::EndpointDiscovery for more details.

  • :endpoint_discovery (Boolean)

    When set to true, endpoint discovery will be enabled for operations when available. Defaults to false. See Plugins::EndpointDiscovery for more details.

  • :http_continue_timeout (Float) — default: 1

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :http_idle_timeout (Integer) — default: 5

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :http_open_timeout (Integer) — default: 15

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :http_proxy (String)

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :http_read_timeout (Integer) — default: 60

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :http_wire_trace (Boolean) — default: false

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :log_level (Symbol) — default: :info

    The log level to send messages to the logger at. See Plugins::Logging for more details.

  • :log_formatter (Logging::LogFormatter)

    The log formatter. Defaults to Seahorse::Client::Logging::Formatter.default. See Plugins::Logging for more details.

  • :logger (Logger) — default: nil

    The Logger instance to send log messages to. If this option is not set, logging will be disabled. See Plugins::Logging for more details.

  • :profile (String)

    Used when loading credentials from the shared credentials file at HOME/.aws/credentials. When not specified, 'default' is used. See Plugins::RequestSigner for more details.

  • :raise_response_errors (Boolean) — default: true

    When true, response errors are raised. See Seahorse::Client::Plugins::RaiseResponseErrors for more details.

  • :region (required, String)

    The AWS region to connect to. The region is used to construct the client endpoint. Defaults to ENV['AWS_REGION']. Also checks AMAZON_REGION and AWS_DEFAULT_REGION. See Plugins::RegionalEndpoint for more details.

  • :retry_limit (Integer) — default: 3

    The maximum number of times to retry failed requests. Only ~ 500 level server errors and certain ~ 400 level client errors are retried. Generally, these are throttling errors, data checksum errors, networking errors, timeout errors and auth errors from expired credentials. See Plugins::RetryErrors for more details.

  • :secret_access_key (String)

    Used to set credentials statically. See Plugins::RequestSigner for more details.

  • :session_token (String)

    Used to set credentials statically. See Plugins::RequestSigner for more details.

  • :ssl_ca_bundle (String)

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :ssl_ca_directory (String)

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :ssl_ca_store (String)

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :ssl_verify_peer (Boolean) — default: true

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :stub_responses (Boolean) — default: false

    Causes the client to return stubbed responses. By default fake responses are generated and returned. You can specify the response data to return or errors to raise by calling Aws::ClientStubs#stub_responses. See Aws::ClientStubs for more information.

    Please note When response stubbing is enabled, no HTTP requests are made, and retries are disabled. See Plugins::StubResponses for more details.

  • :validate_params (Boolean) — default: true

    When true, request parameters are validated before sending the request. See Plugins::ParamValidator for more details.

Instance Method Details

#cancel_update_stack(options = {}) ⇒ Struct

Cancels an update on the specified stack. If the call completes successfully, the stack rolls back the update and reverts to the previous stack configuration.

You can cancel only stacks that are in the UPDATE_IN_PROGRESS state.

Examples:

Request syntax with placeholder values


resp = client.cancel_update_stack({
  stack_name: "StackName", # required
  client_request_token: "ClientRequestToken",
})

Options Hash (options):

  • :stack_name (required, String)

    The name or the unique stack ID that is associated with the stack.

  • :client_request_token (String)

    A unique identifier for this CancelUpdateStack request. Specify this token if you plan to retry requests so that AWS CloudFormation knows that you\'re not attempting to cancel an update on a stack with the same name. You might retry CancelUpdateStack requests to ensure that AWS CloudFormation successfully received them.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#continue_update_rollback(options = {}) ⇒ Struct

For a specified stack that is in the UPDATE_ROLLBACK_FAILED state, continues rolling it back to the UPDATE_ROLLBACK_COMPLETE state. Depending on the cause of the failure, you can manually fix the error and continue the rollback. By continuing the rollback, you can return your stack to a working state (the UPDATE_ROLLBACK_COMPLETE state), and then try to update the stack again.

A stack goes into the UPDATE_ROLLBACK_FAILED state when AWS CloudFormation cannot roll back all changes after a failed stack update. For example, you might have a stack that is rolling back to an old database instance that was deleted outside of AWS CloudFormation. Because AWS CloudFormation doesn't know the database was deleted, it assumes that the database instance still exists and attempts to roll back to it, causing the update rollback to fail.

Examples:

Request syntax with placeholder values


resp = client.continue_update_rollback({
  stack_name: "StackNameOrId", # required
  role_arn: "RoleARN",
  resources_to_skip: ["ResourceToSkip"],
  client_request_token: "ClientRequestToken",
})

Options Hash (options):

  • :stack_name (required, String)

    The name or the unique ID of the stack that you want to continue rolling back.

    Don\'t specify the name of a nested stack (a stack that was created by using the AWS::CloudFormation::Stack resource). Instead, use this operation on the parent stack (the stack that contains the AWS::CloudFormation::Stack resource).

  • :role_arn (String)

    The Amazon Resource Name (ARN) of an AWS Identity and Access Management (IAM) role that AWS CloudFormation assumes to roll back the stack. AWS CloudFormation uses the role\'s credentials to make calls on your behalf. AWS CloudFormation always uses this role for all future operations on the stack. As long as users have permission to operate on the stack, AWS CloudFormation uses this role even if the users don\'t have permission to pass it. Ensure that the role grants least privilege.

    If you don\'t specify a value, AWS CloudFormation uses the role that was previously associated with the stack. If no role is available, AWS CloudFormation uses a temporary session that is generated from your user credentials.

  • :resources_to_skip (Array<String>)

    A list of the logical IDs of the resources that AWS CloudFormation skips during the continue update rollback operation. You can specify only resources that are in the UPDATE_FAILED state because a rollback failed. You can\'t specify resources that are in the UPDATE_FAILED state for other reasons, for example, because an update was cancelled. To check why a resource update failed, use the DescribeStackResources action, and view the resource status reason.

    Specify this property to skip rolling back resources that AWS CloudFormation can\'t successfully roll back. We recommend that you troubleshoot resources before skipping them. AWS CloudFormation sets the status of the specified resources to UPDATE_COMPLETE and continues to roll back the stack. After the rollback is complete, the state of the skipped resources will be inconsistent with the state of the resources in the stack template. Before performing another stack update, you must update the stack or resources to be consistent with each other. If you don\'t, subsequent stack updates might fail, and the stack will become unrecoverable.

    Specify the minimum number of resources required to successfully roll back your stack. For example, a failed resource update might cause dependent resources to fail. In this case, it might not be necessary to skip the dependent resources.

    To skip resources that are part of nested stacks, use the following format: NestedStackName.ResourceLogicalID. If you want to specify the logical ID of a stack resource (Type: AWS::CloudFormation::Stack) in the ResourcesToSkip list, then its corresponding embedded stack must be in one of the following states: DELETE_IN_PROGRESS, DELETE_COMPLETE, or DELETE_FAILED.

    Don\'t confuse a child stack\'s name with its corresponding logical ID defined in the parent stack. For an example of a continue update rollback operation with nested stacks, see Using ResourcesToSkip to recover a nested stacks hierarchy.

  • :client_request_token (String)

    A unique identifier for this ContinueUpdateRollback request. Specify this token if you plan to retry requests so that AWS CloudFormation knows that you\'re not attempting to continue the rollback to a stack with the same name. You might retry ContinueUpdateRollback requests to ensure that AWS CloudFormation successfully received them.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#create_change_set(options = {}) ⇒ Types::CreateChangeSetOutput

Creates a list of changes that will be applied to a stack so that you can review the changes before executing them. You can create a change set for a stack that doesn't exist or an existing stack. If you create a change set for a stack that doesn't exist, the change set shows all of the resources that AWS CloudFormation will create. If you create a change set for an existing stack, AWS CloudFormation compares the stack's information with the information that you submit in the change set and lists the differences. Use change sets to understand which resources AWS CloudFormation will create or change, and how it will change resources in an existing stack, before you create or update a stack.

To create a change set for a stack that doesn't exist, for the ChangeSetType parameter, specify CREATE. To create a change set for an existing stack, specify UPDATE for the ChangeSetType parameter. To create a change set for an import operation, specify IMPORT for the ChangeSetType parameter. After the CreateChangeSet call successfully completes, AWS CloudFormation starts creating the change set. To check the status of the change set or to review it, use the DescribeChangeSet action.

When you are satisfied with the changes the change set will make, execute the change set by using the ExecuteChangeSet action. AWS CloudFormation doesn't make changes until you execute the change set.

To create a change set for the entire stack hierachy, set IncludeNestedStacks to True.

Examples:

Request syntax with placeholder values


resp = client.create_change_set({
  stack_name: "StackNameOrId", # required
  template_body: "TemplateBody",
  template_url: "TemplateURL",
  use_previous_template: false,
  parameters: [
    {
      parameter_key: "ParameterKey",
      parameter_value: "ParameterValue",
      use_previous_value: false,
      resolved_value: "ParameterValue",
    },
  ],
  capabilities: ["CAPABILITY_IAM"], # accepts CAPABILITY_IAM, CAPABILITY_NAMED_IAM, CAPABILITY_AUTO_EXPAND
  resource_types: ["ResourceType"],
  role_arn: "RoleARN",
  rollback_configuration: {
    rollback_triggers: [
      {
        arn: "Arn", # required
        type: "Type", # required
      },
    ],
    monitoring_time_in_minutes: 1,
  },
  notification_arns: ["NotificationARN"],
  tags: [
    {
      key: "TagKey", # required
      value: "TagValue", # required
    },
  ],
  change_set_name: "ChangeSetName", # required
  client_token: "ClientToken",
  description: "Description",
  change_set_type: "CREATE", # accepts CREATE, UPDATE, IMPORT
  resources_to_import: [
    {
      resource_type: "ResourceType", # required
      logical_resource_id: "LogicalResourceId", # required
      resource_identifier: { # required
        "ResourceIdentifierPropertyKey" => "ResourceIdentifierPropertyValue",
      },
    },
  ],
  include_nested_stacks: false,
})

Response structure


resp.id #=> String
resp.stack_id #=> String

Options Hash (options):

  • :stack_name (required, String)

    The name or the unique ID of the stack for which you are creating a change set. AWS CloudFormation generates the change set by comparing this stack\'s information with the information that you submit, such as a modified template or different parameter input values.

  • :template_body (String)

    A structure that contains the body of the revised template, with a minimum length of 1 byte and a maximum length of 51,200 bytes. AWS CloudFormation generates the change set by comparing this template with the template of the stack that you specified.

    Conditional: You must specify only TemplateBody or TemplateURL.

  • :template_url (String)

    The location of the file that contains the revised template. The URL must point to a template (max size: 460,800 bytes) that is located in an S3 bucket. AWS CloudFormation generates the change set by comparing this template with the stack that you specified.

    Conditional: You must specify only TemplateBody or TemplateURL.

  • :use_previous_template (Boolean)

    Whether to reuse the template that is associated with the stack to create the change set.

  • :parameters (Array<Types::Parameter>)

    A list of Parameter structures that specify input parameters for the change set. For more information, see the Parameter data type.

  • :capabilities (Array<String>)

    In some cases, you must explicitly acknowledge that your stack template contains certain capabilities in order for AWS CloudFormation to create the stack.

    • CAPABILITY_IAM and CAPABILITY_NAMED_IAM

      Some stack templates might include resources that can affect permissions in your AWS account; for example, by creating new AWS Identity and Access Management (IAM) users. For those stacks, you must explicitly acknowledge this by specifying one of these capabilities.

      The following IAM resources require you to specify either the CAPABILITY_IAM or CAPABILITY_NAMED_IAM capability.

      • If you have IAM resources, you can specify either capability.

      • If you have IAM resources with custom names, you must specify CAPABILITY_NAMED_IAM.

      • If you don\'t specify either of these capabilities, AWS CloudFormation returns an InsufficientCapabilities error.

      If your stack template contains these resources, we recommend that you review all permissions associated with them and edit their permissions if necessary.

      For more information, see Acknowledging IAM Resources in AWS CloudFormation Templates.

    • CAPABILITY_AUTO_EXPAND

      Some template contain macros. Macros perform custom processing on templates; this can include simple actions like find-and-replace operations, all the way to extensive transformations of entire templates. Because of this, users typically create a change set from the processed template, so that they can review the changes resulting from the macros before actually creating the stack. If your stack template contains one or more macros, and you choose to create a stack directly from the processed template, without first reviewing the resulting changes in a change set, you must acknowledge this capability. This includes the AWS::Include and AWS::Serverless transforms, which are macros hosted by AWS CloudFormation.

      This capacity does not apply to creating change sets, and specifying it when creating change sets has no effect.

      If you want to create a stack from a stack template that contains macros and nested stacks, you must create or update the stack directly from the template using the CreateStack or UpdateStack action, and specifying this capability.

      For more information on macros, see Using AWS CloudFormation Macros to Perform Custom Processing on Templates.

  • :resource_types (Array<String>)

    The template resource types that you have permissions to work with if you execute this change set, such as AWS::EC2::Instance, AWS::EC2::*, or Custom::MyCustomInstance.

    If the list of resource types doesn\'t include a resource type 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 condition keys in IAM policies for AWS CloudFormation. For more information, see Controlling Access with AWS Identity and Access Management in the AWS CloudFormation User Guide.

  • :role_arn (String)

    The Amazon Resource Name (ARN) of an AWS Identity and Access Management (IAM) role that AWS CloudFormation assumes when executing the change set. AWS CloudFormation uses the role\'s credentials to make calls on your behalf. AWS CloudFormation uses this role for all future operations on the stack. As long as users have permission to operate on the stack, AWS CloudFormation uses this role even if the users don\'t have permission to pass it. Ensure that the role grants least privilege.

    If you don\'t specify a value, AWS CloudFormation uses the role that was previously associated with the stack. If no role is available, AWS CloudFormation uses a temporary session that is generated from your user credentials.

  • :rollback_configuration (Types::RollbackConfiguration)

    The rollback triggers for AWS CloudFormation to monitor during stack creation and updating operations, and for the specified monitoring period afterwards.

  • :notification_arns (Array<String>)

    The Amazon Resource Names (ARNs) of Amazon Simple Notification Service (Amazon SNS) topics that AWS CloudFormation associates with the stack. To remove all associated notification topics, specify an empty list.

  • :tags (Array<Types::Tag>)

    Key-value pairs to associate with this stack. AWS CloudFormation also propagates these tags to resources in the stack. You can specify a maximum of 50 tags.

  • :change_set_name (required, String)

    The name of the change set. The name must be unique among all change sets that are associated with the specified stack.

    A change set name can contain only alphanumeric, case sensitive characters and hyphens. It must start with an alphabetic character and cannot exceed 128 characters.

  • :client_token (String)

    A unique identifier for this CreateChangeSet request. Specify this token if you plan to retry requests so that AWS CloudFormation knows that you\'re not attempting to create another change set with the same name. You might retry CreateChangeSet requests to ensure that AWS CloudFormation successfully received them.

  • :description (String)

    A description to help you identify this change set.

  • :change_set_type (String)

    The type of change set operation. To create a change set for a new stack, specify CREATE. To create a change set for an existing stack, specify UPDATE. To create a change set for an import operation, specify IMPORT.

    If you create a change set for a new stack, AWS Cloudformation creates a stack with a unique stack ID, but no template or resources. The stack will be in the REVIEW_IN_PROGRESS state until you execute the change set.

    By default, AWS CloudFormation specifies UPDATE. You can\'t use the UPDATE type to create a change set for a new stack or the CREATE type to create a change set for an existing stack.

  • :resources_to_import (Array<Types::ResourceToImport>)

    The resources to import into your stack.

  • :include_nested_stacks (Boolean)

    Creates a change set for the all nested stacks specified in the template. The default behavior of this action is set to False. To include nested sets in a change set, specify True.

Returns:

See Also:

#create_stack(options = {}) ⇒ Types::CreateStackOutput

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.

Examples:

Request syntax with placeholder values


resp = client.create_stack({
  stack_name: "StackName", # required
  template_body: "TemplateBody",
  template_url: "TemplateURL",
  parameters: [
    {
      parameter_key: "ParameterKey",
      parameter_value: "ParameterValue",
      use_previous_value: false,
      resolved_value: "ParameterValue",
    },
  ],
  disable_rollback: false,
  rollback_configuration: {
    rollback_triggers: [
      {
        arn: "Arn", # required
        type: "Type", # required
      },
    ],
    monitoring_time_in_minutes: 1,
  },
  timeout_in_minutes: 1,
  notification_arns: ["NotificationARN"],
  capabilities: ["CAPABILITY_IAM"], # accepts CAPABILITY_IAM, CAPABILITY_NAMED_IAM, CAPABILITY_AUTO_EXPAND
  resource_types: ["ResourceType"],
  role_arn: "RoleARN",
  on_failure: "DO_NOTHING", # accepts DO_NOTHING, ROLLBACK, DELETE
  stack_policy_body: "StackPolicyBody",
  stack_policy_url: "StackPolicyURL",
  tags: [
    {
      key: "TagKey", # required
      value: "TagValue", # required
    },
  ],
  client_request_token: "ClientRequestToken",
  enable_termination_protection: false,
})

Response structure


resp.stack_id #=> String

Options Hash (options):

  • :stack_name (required, String)

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

    A stack name can contain only alphanumeric characters (case sensitive) and hyphens. It must start with an alphabetic character and cannot be longer than 128 characters.

  • :template_body (String)

    Structure containing the template body with a minimum length of 1 byte and a maximum length of 51,200 bytes. For more information, go to Template Anatomy in the AWS CloudFormation User Guide.

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

  • :template_url (String)

    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.

  • :parameters (Array<Types::Parameter>)

    A list of Parameter structures that specify input parameters for the stack. For more information, see the Parameter data type.

  • :disable_rollback (Boolean)

    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

  • :rollback_configuration (Types::RollbackConfiguration)

    The rollback triggers for AWS CloudFormation to monitor during stack creation and updating operations, and for the specified monitoring period afterwards.

  • :timeout_in_minutes (Integer)

    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.

  • :notification_arns (Array<String>)

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

  • :capabilities (Array<String>)

    In some cases, you must explicitly acknowledge that your stack template contains certain capabilities in order for AWS CloudFormation to create the stack.

    • CAPABILITY_IAM and CAPABILITY_NAMED_IAM

      Some stack templates might include resources that can affect permissions in your AWS account; for example, by creating new AWS Identity and Access Management (IAM) users. For those stacks, you must explicitly acknowledge this by specifying one of these capabilities.

      The following IAM resources require you to specify either the CAPABILITY_IAM or CAPABILITY_NAMED_IAM capability.

      • If you have IAM resources, you can specify either capability.

      • If you have IAM resources with custom names, you must specify CAPABILITY_NAMED_IAM.

      • If you don\'t specify either of these capabilities, AWS CloudFormation returns an InsufficientCapabilities error.

      If your stack template contains these resources, we recommend that you review all permissions associated with them and edit their permissions if necessary.

      For more information, see Acknowledging IAM Resources in AWS CloudFormation Templates.

    • CAPABILITY_AUTO_EXPAND

      Some template contain macros. Macros perform custom processing on templates; this can include simple actions like find-and-replace operations, all the way to extensive transformations of entire templates. Because of this, users typically create a change set from the processed template, so that they can review the changes resulting from the macros before actually creating the stack. If your stack template contains one or more macros, and you choose to create a stack directly from the processed template, without first reviewing the resulting changes in a change set, you must acknowledge this capability. This includes the AWS::Include and AWS::Serverless transforms, which are macros hosted by AWS CloudFormation.

      If you want to create a stack from a stack template that contains macros and nested stacks, you must create the stack directly from the template using this capability.

      You should only create stacks directly from a stack template that contains macros if you know what processing the macro performs.

      Each macro relies on an underlying Lambda service function for processing stack templates. Be aware that the Lambda function owner can update the function operation without AWS CloudFormation being notified.

      For more information, see Using AWS CloudFormation Macros to Perform Custom Processing on Templates.

  • :resource_types (Array<String>)

    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.

  • :role_arn (String)

    The Amazon Resource Name (ARN) of an AWS Identity and Access Management (IAM) role that AWS CloudFormation assumes to create the stack. AWS CloudFormation uses the role\'s credentials to make calls on your behalf. AWS CloudFormation always uses this role for all future operations on the stack. As long as users have permission to operate on the stack, AWS CloudFormation uses this role even if the users don\'t have permission to pass it. Ensure that the role grants least privilege.

    If you don\'t specify a value, AWS CloudFormation uses the role that was previously associated with the stack. If no role is available, AWS CloudFormation uses a temporary session that is generated from your user credentials.

  • :on_failure (String)

    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

  • :stack_policy_body (String)

    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.

  • :stack_policy_url (String)

    Location of a file containing the stack policy. The URL must point to a policy (maximum size: 16 KB) 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.

  • :tags (Array<Types::Tag>)

    Key-value pairs to associate with this stack. AWS CloudFormation also propagates these tags to the resources created in the stack. A maximum number of 50 tags can be specified.

  • :client_request_token (String)

    A unique identifier for this CreateStack request. Specify this token if you plan to retry requests so that AWS CloudFormation knows that you\'re not attempting to create a stack with the same name. You might retry CreateStack requests to ensure that AWS CloudFormation successfully received them.

    All events triggered by a given stack operation are assigned the same client request token, which you can use to track operations. For example, if you execute a CreateStack operation with the token token1, then all the StackEvents generated by that operation will have ClientRequestToken set as token1.

    In the console, stack operations display the client request token on the Events tab. Stack operations that are initiated from the console use the token format Console-StackOperation-ID, which helps you easily identify the stack operation . For example, if you create a stack using the console, each stack event would be assigned the same token in the following format: Console-CreateStack-7f59c3cf-00d2-40c7-b2ff-e75db0987002.

  • :enable_termination_protection (Boolean)

    Whether to enable termination protection on the specified stack. If a user attempts to delete a stack with termination protection enabled, the operation fails and the stack remains unchanged. For more information, see Protecting a Stack From Being Deleted in the AWS CloudFormation User Guide. Termination protection is disabled on stacks by default.

    For nested stacks, termination protection is set on the root stack and cannot be changed directly on the nested stack.

Returns:

See Also:

#create_stack_instances(options = {}) ⇒ Types::CreateStackInstancesOutput

Creates stack instances for the specified accounts, within the specified Regions. A stack instance refers to a stack in a specific account and Region. You must specify at least one value for either Accounts or DeploymentTargets, and you must specify at least one value for Regions.

Examples:

Request syntax with placeholder values


resp = client.create_stack_instances({
  stack_set_name: "StackSetName", # required
  accounts: ["Account"],
  deployment_targets: {
    accounts: ["Account"],
    organizational_unit_ids: ["OrganizationalUnitId"],
  },
  regions: ["Region"], # required
  parameter_overrides: [
    {
      parameter_key: "ParameterKey",
      parameter_value: "ParameterValue",
      use_previous_value: false,
      resolved_value: "ParameterValue",
    },
  ],
  operation_preferences: {
    region_order: ["Region"],
    failure_tolerance_count: 1,
    failure_tolerance_percentage: 1,
    max_concurrent_count: 1,
    max_concurrent_percentage: 1,
  },
  operation_id: "ClientRequestToken",
})

Response structure


resp.operation_id #=> String

Options Hash (options):

  • :stack_set_name (required, String)

    The name or unique ID of the stack set that you want to create stack instances from.

  • :accounts (Array<String>)

    [Self-managed permissions] The names of one or more AWS accounts that you want to create stack instances in the specified Region(s) for.

    You can specify Accounts or DeploymentTargets, but not both.

  • :deployment_targets (Types::DeploymentTargets)

    [Service-managed permissions] The AWS Organizations accounts for which to create stack instances in the specified Regions.

    You can specify Accounts or DeploymentTargets, but not both.

  • :regions (required, Array<String>)

    The names of one or more Regions where you want to create stack instances using the specified AWS account(s).

  • :parameter_overrides (Array<Types::Parameter>)

    A list of stack set parameters whose values you want to override in the selected stack instances.

    Any overridden parameter values will be applied to all stack instances in the specified accounts and Regions. When specifying parameters and their values, be aware of how AWS CloudFormation sets parameter values during stack instance operations:

    • To override the current value for a parameter, include the parameter and specify its value.

    • To leave a parameter set to its present value, you can do one of the following:

      • Do not include the parameter in the list.

      • Include the parameter and specify UsePreviousValue as true. (You cannot specify both a value and set UsePreviousValue to true.)

    • To set all overridden parameter back to the values specified in the stack set, specify a parameter list but do not include any parameters.

    • To leave all parameters set to their present values, do not specify this property at all.

    During stack set updates, any parameter values overridden for a stack instance are not updated, but retain their overridden value.

    You can only override the parameter values that are specified in the stack set; to add or delete a parameter itself, use UpdateStackSet to update the stack set template.

  • :operation_preferences (Types::StackSetOperationPreferences)

    Preferences for how AWS CloudFormation performs this stack set operation.

  • :operation_id (String)

    This parameter will be auto-filled on your behalf with a random UUIDv4 when no value is provided. The unique identifier for this stack set operation.

    The operation ID also functions as an idempotency token, to ensure that AWS CloudFormation performs the stack set operation only once, even if you retry the request multiple times. You might retry stack set operation requests to ensure that AWS CloudFormation successfully received them.

    If you don\'t specify an operation ID, the SDK generates one automatically.

    Repeating this stack set operation with a new operation ID retries all stack instances whose status is OUTDATED.

Returns:

See Also:

#create_stack_set(options = {}) ⇒ Types::CreateStackSetOutput

Creates a stack set.

Examples:

Request syntax with placeholder values


resp = client.create_stack_set({
  stack_set_name: "StackSetName", # required
  description: "Description",
  template_body: "TemplateBody",
  template_url: "TemplateURL",
  parameters: [
    {
      parameter_key: "ParameterKey",
      parameter_value: "ParameterValue",
      use_previous_value: false,
      resolved_value: "ParameterValue",
    },
  ],
  capabilities: ["CAPABILITY_IAM"], # accepts CAPABILITY_IAM, CAPABILITY_NAMED_IAM, CAPABILITY_AUTO_EXPAND
  tags: [
    {
      key: "TagKey", # required
      value: "TagValue", # required
    },
  ],
  administration_role_arn: "RoleARN",
  execution_role_name: "ExecutionRoleName",
  permission_model: "SERVICE_MANAGED", # accepts SERVICE_MANAGED, SELF_MANAGED
  auto_deployment: {
    enabled: false,
    retain_stacks_on_account_removal: false,
  },
  client_request_token: "ClientRequestToken",
})

Response structure


resp.stack_set_id #=> String

Options Hash (options):

  • :stack_set_name (required, String)

    The name to associate with the stack set. The name must be unique in the Region where you create your stack set.

    A stack name can contain only alphanumeric characters (case-sensitive) and hyphens. It must start with an alphabetic character and can\'t be longer than 128 characters.

  • :description (String)

    A description of the stack set. You can use the description to identify the stack set\'s purpose or other important information.

  • :template_body (String)

    The structure that contains the template body, with a minimum length of 1 byte and a maximum length of 51,200 bytes. For more information, see Template Anatomy in the AWS CloudFormation User Guide.

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

  • :template_url (String)

    The location of the file that contains the template body. The URL must point to a template (maximum size: 460,800 bytes) that\'s located in an Amazon S3 bucket. For more information, see Template Anatomy in the AWS CloudFormation User Guide.

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

  • :parameters (Array<Types::Parameter>)

    The input parameters for the stack set template.

  • :capabilities (Array<String>)

    In some cases, you must explicitly acknowledge that your stack set template contains certain capabilities in order for AWS CloudFormation to create the stack set and related stack instances.

    • CAPABILITY_IAM and CAPABILITY_NAMED_IAM

      Some stack templates might include resources that can affect permissions in your AWS account; for example, by creating new AWS Identity and Access Management (IAM) users. For those stack sets, you must explicitly acknowledge this by specifying one of these capabilities.

      The following IAM resources require you to specify either the CAPABILITY_IAM or CAPABILITY_NAMED_IAM capability.

      • If you have IAM resources, you can specify either capability.

      • If you have IAM resources with custom names, you must specify CAPABILITY_NAMED_IAM.

      • If you don\'t specify either of these capabilities, AWS CloudFormation returns an InsufficientCapabilities error.

      If your stack template contains these resources, we recommend that you review all permissions associated with them and edit their permissions if necessary.

      For more information, see Acknowledging IAM Resources in AWS CloudFormation Templates.

    • CAPABILITY_AUTO_EXPAND

      Some templates contain macros. If your stack template contains one or more macros, and you choose to create a stack directly from the processed template, without first reviewing the resulting changes in a change set, you must acknowledge this capability. For more information, see Using AWS CloudFormation Macros to Perform Custom Processing on Templates.

      Stack sets do not currently support macros in stack templates. (This includes the AWS::Include and AWS::Serverless transforms, which are macros hosted by AWS CloudFormation.) Even if you specify this capability, if you include a macro in your template the stack set operation will fail.

  • :tags (Array<Types::Tag>)

    The key-value pairs to associate with this stack set and the stacks created from it. AWS CloudFormation also propagates these tags to supported resources that are created in the stacks. A maximum number of 50 tags can be specified.

    If you specify tags as part of a CreateStackSet action, AWS CloudFormation checks to see if you have the required IAM permission to tag resources. If you don\'t, the entire CreateStackSet action fails with an access denied error, and the stack set is not created.

  • :administration_role_arn (String)

    The Amazon Resource Number (ARN) of the IAM role to use to create this stack set.

    Specify an IAM role only if you are using customized administrator roles to control which users or groups can manage specific stack sets within the same administrator account. For more information, see Prerequisites: Granting Permissions for Stack Set Operations in the AWS CloudFormation User Guide.

  • :execution_role_name (String)

    The name of the IAM execution role to use to create the stack set. If you do not specify an execution role, AWS CloudFormation uses the AWSCloudFormationStackSetExecutionRole role for the stack set operation.

    Specify an IAM role only if you are using customized execution roles to control which stack resources users and groups can include in their stack sets.

  • :permission_model (String)

    Describes how the IAM roles required for stack set operations are created. By default, SELF-MANAGED is specified.

  • :auto_deployment (Types::AutoDeployment)

    Describes whether StackSets automatically deploys to AWS Organizations accounts that are added to the target organization or organizational unit (OU). Specify only if PermissionModel is SERVICE_MANAGED.

  • :client_request_token (String)

    This parameter will be auto-filled on your behalf with a random UUIDv4 when no value is provided. A unique identifier for this CreateStackSet request. Specify this token if you plan to retry requests so that AWS CloudFormation knows that you\'re not attempting to create another stack set with the same name. You might retry CreateStackSet requests to ensure that AWS CloudFormation successfully received them.

    If you don\'t specify an operation ID, the SDK generates one automatically.

Returns:

See Also:

#delete_change_set(options = {}) ⇒ Struct

Deletes the specified change set. Deleting change sets ensures that no one executes the wrong change set.

If the call successfully completes, AWS CloudFormation successfully deleted the change set.

If IncludeNestedStacks specifies True during the creation of the nested change set, then DeleteChangeSet will delete all change sets that belong to the stacks hierarchy and will also delete all change sets for nested stacks with the status of REVIEW_IN_PROGRESS.

Examples:

Request syntax with placeholder values


resp = client.delete_change_set({
  change_set_name: "ChangeSetNameOrId", # required
  stack_name: "StackNameOrId",
})

Options Hash (options):

  • :change_set_name (required, String)

    The name or Amazon Resource Name (ARN) of the change set that you want to delete.

  • :stack_name (String)

    If you specified the name of a change set to delete, specify the stack name or ID (ARN) that is associated with it.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#delete_stack(options = {}) ⇒ Struct

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.

Examples:

Request syntax with placeholder values


resp = client.delete_stack({
  stack_name: "StackName", # required
  retain_resources: ["LogicalResourceId"],
  role_arn: "RoleARN",
  client_request_token: "ClientRequestToken",
})

Options Hash (options):

  • :stack_name (required, String)

    The name or the unique stack ID that is associated with the stack.

  • :retain_resources (Array<String>)

    For stacks in the DELETE_FAILED state, a list of resource logical IDs that are associated with the resources you want to retain. During deletion, AWS CloudFormation deletes the stack but does not delete the retained resources.

    Retaining resources is useful when you cannot delete a resource, such as a non-empty S3 bucket, but you want to delete the stack.

  • :role_arn (String)

    The Amazon Resource Name (ARN) of an AWS Identity and Access Management (IAM) role that AWS CloudFormation assumes to delete the stack. AWS CloudFormation uses the role\'s credentials to make calls on your behalf.

    If you don\'t specify a value, AWS CloudFormation uses the role that was previously associated with the stack. If no role is available, AWS CloudFormation uses a temporary session that is generated from your user credentials.

  • :client_request_token (String)

    A unique identifier for this DeleteStack request. Specify this token if you plan to retry requests so that AWS CloudFormation knows that you\'re not attempting to delete a stack with the same name. You might retry DeleteStack requests to ensure that AWS CloudFormation successfully received them.

    All events triggered by a given stack operation are assigned the same client request token, which you can use to track operations. For example, if you execute a CreateStack operation with the token token1, then all the StackEvents generated by that operation will have ClientRequestToken set as token1.

    In the console, stack operations display the client request token on the Events tab. Stack operations that are initiated from the console use the token format Console-StackOperation-ID, which helps you easily identify the stack operation . For example, if you create a stack using the console, each stack event would be assigned the same token in the following format: Console-CreateStack-7f59c3cf-00d2-40c7-b2ff-e75db0987002.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#delete_stack_instances(options = {}) ⇒ Types::DeleteStackInstancesOutput

Deletes stack instances for the specified accounts, in the specified Regions.

Examples:

Request syntax with placeholder values


resp = client.delete_stack_instances({
  stack_set_name: "StackSetName", # required
  accounts: ["Account"],
  deployment_targets: {
    accounts: ["Account"],
    organizational_unit_ids: ["OrganizationalUnitId"],
  },
  regions: ["Region"], # required
  operation_preferences: {
    region_order: ["Region"],
    failure_tolerance_count: 1,
    failure_tolerance_percentage: 1,
    max_concurrent_count: 1,
    max_concurrent_percentage: 1,
  },
  retain_stacks: false, # required
  operation_id: "ClientRequestToken",
})

Response structure


resp.operation_id #=> String

Options Hash (options):

  • :stack_set_name (required, String)

    The name or unique ID of the stack set that you want to delete stack instances for.

  • :accounts (Array<String>)

    [Self-managed permissions] The names of the AWS accounts that you want to delete stack instances for.

    You can specify Accounts or DeploymentTargets, but not both.

  • :deployment_targets (Types::DeploymentTargets)

    [Service-managed permissions] The AWS Organizations accounts from which to delete stack instances.

    You can specify Accounts or DeploymentTargets, but not both.

  • :regions (required, Array<String>)

    The Regions where you want to delete stack set instances.

  • :operation_preferences (Types::StackSetOperationPreferences)

    Preferences for how AWS CloudFormation performs this stack set operation.

  • :retain_stacks (required, Boolean)

    Removes the stack instances from the specified stack set, but doesn\'t delete the stacks. You can\'t reassociate a retained stack or add an existing, saved stack to a new stack set.

    For more information, see Stack set operation options.

  • :operation_id (String)

    This parameter will be auto-filled on your behalf with a random UUIDv4 when no value is provided. The unique identifier for this stack set operation.

    If you don\'t specify an operation ID, the SDK generates one automatically.

    The operation ID also functions as an idempotency token, to ensure that AWS CloudFormation performs the stack set operation only once, even if you retry the request multiple times. You can retry stack set operation requests to ensure that AWS CloudFormation successfully received them.

    Repeating this stack set operation with a new operation ID retries all stack instances whose status is OUTDATED.

Returns:

See Also:

#delete_stack_set(options = {}) ⇒ Struct

Deletes a stack set. Before you can delete a stack set, all of its member stack instances must be deleted. For more information about how to do this, see DeleteStackInstances.

Examples:

Request syntax with placeholder values


resp = client.delete_stack_set({
  stack_set_name: "StackSetName", # required
})

Options Hash (options):

  • :stack_set_name (required, String)

    The name or unique ID of the stack set that you\'re deleting. You can obtain this value by running ListStackSets.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#deregister_type(options = {}) ⇒ Struct

Removes a type or type version from active use in the CloudFormation registry. If a type or type version is deregistered, it cannot be used in CloudFormation operations.

To deregister a type, you must individually deregister all registered versions of that type. If a type has only a single registered version, deregistering that version results in the type itself being deregistered.

You cannot deregister the default version of a type, unless it is the only registered version of that type, in which case the type itself is deregistered as well.

Examples:

Request syntax with placeholder values


resp = client.deregister_type({
  arn: "PrivateTypeArn",
  type: "RESOURCE", # accepts RESOURCE
  type_name: "TypeName",
  version_id: "TypeVersionId",
})

Options Hash (options):

  • :arn (String)

    The Amazon Resource Name (ARN) of the type.

    Conditional: You must specify either TypeName and Type, or Arn.

  • :type (String)

    The kind of type.

    Currently the only valid value is RESOURCE.

    Conditional: You must specify either TypeName and Type, or Arn.

  • :type_name (String)

    The name of the type.

    Conditional: You must specify either TypeName and Type, or Arn.

  • :version_id (String)

    The ID of a specific version of the type. The version ID is the value at the end of the Amazon Resource Name (ARN) assigned to the type version when it is registered.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#describe_account_limits(options = {}) ⇒ Types::DescribeAccountLimitsOutput

Retrieves your account's AWS CloudFormation limits, such as the maximum number of stacks that you can create in your account. For more information about account limits, see AWS CloudFormation Limits in the AWS CloudFormation User Guide.

Examples:

Request syntax with placeholder values


resp = client.({
  next_token: "NextToken",
})

Response structure


resp. #=> Array
resp.[0].name #=> String
resp.[0].value #=> Integer
resp.next_token #=> String

Options Hash (options):

  • :next_token (String)

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

Returns:

See Also:

#describe_change_set(options = {}) ⇒ Types::DescribeChangeSetOutput

Returns the inputs for the change set and a list of changes that AWS CloudFormation will make if you execute the change set. For more information, see Updating Stacks Using Change Sets in the AWS CloudFormation User Guide.

Examples:

Request syntax with placeholder values


resp = client.describe_change_set({
  change_set_name: "ChangeSetNameOrId", # required
  stack_name: "StackNameOrId",
  next_token: "NextToken",
})

Response structure


resp.change_set_name #=> String
resp.change_set_id #=> String
resp.stack_id #=> String
resp.stack_name #=> String
resp.description #=> String
resp.parameters #=> Array
resp.parameters[0].parameter_key #=> String
resp.parameters[0].parameter_value #=> String
resp.parameters[0].use_previous_value #=> true/false
resp.parameters[0].resolved_value #=> String
resp.creation_time #=> Time
resp.execution_status #=> String, one of "UNAVAILABLE", "AVAILABLE", "EXECUTE_IN_PROGRESS", "EXECUTE_COMPLETE", "EXECUTE_FAILED", "OBSOLETE"
resp.status #=> String, one of "CREATE_PENDING", "CREATE_IN_PROGRESS", "CREATE_COMPLETE", "DELETE_PENDING", "DELETE_IN_PROGRESS", "DELETE_COMPLETE", "DELETE_FAILED", "FAILED"
resp.status_reason #=> String
resp.notification_arns #=> Array
resp.notification_arns[0] #=> String
resp.rollback_configuration.rollback_triggers #=> Array
resp.rollback_configuration.rollback_triggers[0].arn #=> String
resp.rollback_configuration.rollback_triggers[0].type #=> String
resp.rollback_configuration.monitoring_time_in_minutes #=> Integer
resp.capabilities #=> Array
resp.capabilities[0] #=> String, one of "CAPABILITY_IAM", "CAPABILITY_NAMED_IAM", "CAPABILITY_AUTO_EXPAND"
resp.tags #=> Array
resp.tags[0].key #=> String
resp.tags[0].value #=> String
resp.changes #=> Array
resp.changes[0].type #=> String, one of "Resource"
resp.changes[0].resource_change.action #=> String, one of "Add", "Modify", "Remove", "Import", "Dynamic"
resp.changes[0].resource_change.logical_resource_id #=> String
resp.changes[0].resource_change.physical_resource_id #=> String
resp.changes[0].resource_change.resource_type #=> String
resp.changes[0].resource_change.replacement #=> String, one of "True", "False", "Conditional"
resp.changes[0].resource_change.scope #=> Array
resp.changes[0].resource_change.scope[0] #=> String, one of "Properties", "Metadata", "CreationPolicy", "UpdatePolicy", "DeletionPolicy", "Tags"
resp.changes[0].resource_change.details #=> Array
resp.changes[0].resource_change.details[0].target.attribute #=> String, one of "Properties", "Metadata", "CreationPolicy", "UpdatePolicy", "DeletionPolicy", "Tags"
resp.changes[0].resource_change.details[0].target.name #=> String
resp.changes[0].resource_change.details[0].target.requires_recreation #=> String, one of "Never", "Conditionally", "Always"
resp.changes[0].resource_change.details[0].evaluation #=> String, one of "Static", "Dynamic"
resp.changes[0].resource_change.details[0].change_source #=> String, one of "ResourceReference", "ParameterReference", "ResourceAttribute", "DirectModification", "Automatic"
resp.changes[0].resource_change.details[0].causing_entity #=> String
resp.changes[0].resource_change.change_set_id #=> String
resp.next_token #=> String
resp.include_nested_stacks #=> true/false
resp.parent_change_set_id #=> String
resp.root_change_set_id #=> String

Options Hash (options):

  • :change_set_name (required, String)

    The name or Amazon Resource Name (ARN) of the change set that you want to describe.

  • :stack_name (String)

    If you specified the name of a change set, specify the stack name or ID (ARN) of the change set you want to describe.

  • :next_token (String)

    A string (provided by the DescribeChangeSet response output) that identifies the next page of information that you want to retrieve.

Returns:

See Also:

#describe_stack_drift_detection_status(options = {}) ⇒ Types::DescribeStackDriftDetectionStatusOutput

Returns information about a stack drift detection operation. A stack drift detection operation detects whether a stack's actual configuration differs, or has drifted, from it's expected configuration, as defined in the stack template and any values specified as template parameters. A stack is considered to have drifted if one or more of its resources have drifted. For more information on stack and resource drift, see Detecting Unregulated Configuration Changes to Stacks and Resources.

Use DetectStackDrift to initiate a stack drift detection operation. DetectStackDrift returns a StackDriftDetectionId you can use to monitor the progress of the operation using DescribeStackDriftDetectionStatus. Once the drift detection operation has completed, use DescribeStackResourceDrifts to return drift information about the stack and its resources.

Examples:

Request syntax with placeholder values


resp = client.describe_stack_drift_detection_status({
  stack_drift_detection_id: "StackDriftDetectionId", # required
})

Response structure


resp.stack_id #=> String
resp.stack_drift_detection_id #=> String
resp.stack_drift_status #=> String, one of "DRIFTED", "IN_SYNC", "UNKNOWN", "NOT_CHECKED"
resp.detection_status #=> String, one of "DETECTION_IN_PROGRESS", "DETECTION_FAILED", "DETECTION_COMPLETE"
resp.detection_status_reason #=> String
resp.drifted_stack_resource_count #=> Integer
resp.timestamp #=> Time

Options Hash (options):

  • :stack_drift_detection_id (required, String)

    The ID of the drift detection results of this operation.

    AWS CloudFormation generates new results, with a new drift detection ID, each time this operation is run. However, the number of drift results AWS CloudFormation retains for any given stack, and for how long, may vary.

Returns:

See Also:

#describe_stack_events(options = {}) ⇒ Types::DescribeStackEventsOutput

Returns all stack related events for a specified stack in reverse chronological order. For more information about a stack's event history, go to Stacks in the AWS CloudFormation User Guide.

You can list events for stacks that have failed to create or have been deleted by specifying the unique stack identifier (stack ID).

Examples:

Request syntax with placeholder values


resp = client.describe_stack_events({
  stack_name: "StackName",
  next_token: "NextToken",
})

Response structure


resp.stack_events #=> Array
resp.stack_events[0].stack_id #=> String
resp.stack_events[0].event_id #=> String
resp.stack_events[0].stack_name #=> String
resp.stack_events[0].logical_resource_id #=> String
resp.stack_events[0].physical_resource_id #=> String
resp.stack_events[0].resource_type #=> String
resp.stack_events[0].timestamp #=> Time
resp.stack_events[0].resource_status #=> String, one of "CREATE_IN_PROGRESS", "CREATE_FAILED", "CREATE_COMPLETE", "DELETE_IN_PROGRESS", "DELETE_FAILED", "DELETE_COMPLETE", "DELETE_SKIPPED", "UPDATE_IN_PROGRESS", "UPDATE_FAILED", "UPDATE_COMPLETE", "IMPORT_FAILED", "IMPORT_COMPLETE", "IMPORT_IN_PROGRESS", "IMPORT_ROLLBACK_IN_PROGRESS", "IMPORT_ROLLBACK_FAILED", "IMPORT_ROLLBACK_COMPLETE"
resp.stack_events[0].resource_status_reason #=> String
resp.stack_events[0].resource_properties #=> String
resp.stack_events[0].client_request_token #=> String
resp.next_token #=> String

Options Hash (options):

  • :stack_name (String)

    The name or the unique stack ID that is associated with the stack, which are not always interchangeable:

    • Running stacks: You can specify either the stack\'s name or its unique stack ID.

    • Deleted stacks: You must specify the unique stack ID.

    Default: There is no default value.

  • :next_token (String)

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

Returns:

See Also:

#describe_stack_instance(options = {}) ⇒ Types::DescribeStackInstanceOutput

Returns the stack instance that's associated with the specified stack set, AWS account, and Region.

For a list of stack instances that are associated with a specific stack set, use ListStackInstances.

Examples:

Request syntax with placeholder values


resp = client.describe_stack_instance({
  stack_set_name: "StackSetName", # required
  stack_instance_account: "Account", # required
  stack_instance_region: "Region", # required
})

Response structure


resp.stack_instance.stack_set_id #=> String
resp.stack_instance.region #=> String
resp.stack_instance. #=> String
resp.stack_instance.stack_id #=> String
resp.stack_instance.parameter_overrides #=> Array
resp.stack_instance.parameter_overrides[0].parameter_key #=> String
resp.stack_instance.parameter_overrides[0].parameter_value #=> String
resp.stack_instance.parameter_overrides[0].use_previous_value #=> true/false
resp.stack_instance.parameter_overrides[0].resolved_value #=> String
resp.stack_instance.status #=> String, one of "CURRENT", "OUTDATED", "INOPERABLE"
resp.stack_instance.stack_instance_status.detailed_status #=> String, one of "PENDING", "RUNNING", "SUCCEEDED", "FAILED", "CANCELLED", "INOPERABLE"
resp.stack_instance.status_reason #=> String
resp.stack_instance.organizational_unit_id #=> String
resp.stack_instance.drift_status #=> String, one of "DRIFTED", "IN_SYNC", "UNKNOWN", "NOT_CHECKED"
resp.stack_instance.last_drift_check_timestamp #=> Time

Options Hash (options):

  • :stack_set_name (required, String)

    The name or the unique stack ID of the stack set that you want to get stack instance information for.

  • :stack_instance_account (required, String)

    The ID of an AWS account that\'s associated with this stack instance.

  • :stack_instance_region (required, String)

    The name of a Region that\'s associated with this stack instance.

Returns:

See Also:

#describe_stack_resource(options = {}) ⇒ Types::DescribeStackResourceOutput

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.

Examples:

Request syntax with placeholder values


resp = client.describe_stack_resource({
  stack_name: "StackName", # required
  logical_resource_id: "LogicalResourceId", # required
})

Response structure


resp.stack_resource_detail.stack_name #=> String
resp.stack_resource_detail.stack_id #=> String
resp.stack_resource_detail.logical_resource_id #=> String
resp.stack_resource_detail.physical_resource_id #=> String
resp.stack_resource_detail.resource_type #=> String
resp.stack_resource_detail.last_updated_timestamp #=> Time
resp.stack_resource_detail.resource_status #=> String, one of "CREATE_IN_PROGRESS", "CREATE_FAILED", "CREATE_COMPLETE", "DELETE_IN_PROGRESS", "DELETE_FAILED", "DELETE_COMPLETE", "DELETE_SKIPPED", "UPDATE_IN_PROGRESS", "UPDATE_FAILED", "UPDATE_COMPLETE", "IMPORT_FAILED", "IMPORT_COMPLETE", "IMPORT_IN_PROGRESS", "IMPORT_ROLLBACK_IN_PROGRESS", "IMPORT_ROLLBACK_FAILED", "IMPORT_ROLLBACK_COMPLETE"
resp.stack_resource_detail.resource_status_reason #=> String
resp.stack_resource_detail.description #=> String
resp.stack_resource_detail. #=> String
resp.stack_resource_detail.drift_information.stack_resource_drift_status #=> String, one of "IN_SYNC", "MODIFIED", "DELETED", "NOT_CHECKED"
resp.stack_resource_detail.drift_information.last_check_timestamp #=> Time

Options Hash (options):

  • :stack_name (required, String)

    The name or the unique stack ID that is associated with the stack, which are not always interchangeable:

    • Running stacks: You can specify either the stack\'s name or its unique stack ID.

    • Deleted stacks: You must specify the unique stack ID.

    Default: There is no default value.

  • :logical_resource_id (required, String)

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

    Default: There is no default value.

Returns:

See Also:

#describe_stack_resource_drifts(options = {}) ⇒ Types::DescribeStackResourceDriftsOutput

Returns drift information for the resources that have been checked for drift in the specified stack. This includes actual and expected configuration values for resources where AWS CloudFormation detects configuration drift.

For a given stack, there will be one StackResourceDrift for each stack resource that has been checked for drift. Resources that have not yet been checked for drift are not included. Resources that do not currently support drift detection are not checked, and so not included. For a list of resources that support drift detection, see Resources that Support Drift Detection.

Use DetectStackResourceDrift to detect drift on individual resources, or DetectStackDrift to detect drift on all supported resources for a given stack.

Examples:

Request syntax with placeholder values


resp = client.describe_stack_resource_drifts({
  stack_name: "StackNameOrId", # required
  stack_resource_drift_status_filters: ["IN_SYNC"], # accepts IN_SYNC, MODIFIED, DELETED, NOT_CHECKED
  next_token: "NextToken",
  max_results: 1,
})

Response structure


resp.stack_resource_drifts #=> Array
resp.stack_resource_drifts[0].stack_id #=> String
resp.stack_resource_drifts[0].logical_resource_id #=> String
resp.stack_resource_drifts[0].physical_resource_id #=> String
resp.stack_resource_drifts[0].physical_resource_id_context #=> Array
resp.stack_resource_drifts[0].physical_resource_id_context[0].key #=> String
resp.stack_resource_drifts[0].physical_resource_id_context[0].value #=> String
resp.stack_resource_drifts[0].resource_type #=> String
resp.stack_resource_drifts[0].expected_properties #=> String
resp.stack_resource_drifts[0].actual_properties #=> String
resp.stack_resource_drifts[0].property_differences #=> Array
resp.stack_resource_drifts[0].property_differences[0].property_path #=> String
resp.stack_resource_drifts[0].property_differences[0].expected_value #=> String
resp.stack_resource_drifts[0].property_differences[0].actual_value #=> String
resp.stack_resource_drifts[0].property_differences[0].difference_type #=> String, one of "ADD", "REMOVE", "NOT_EQUAL"
resp.stack_resource_drifts[0].stack_resource_drift_status #=> String, one of "IN_SYNC", "MODIFIED", "DELETED", "NOT_CHECKED"
resp.stack_resource_drifts[0].timestamp #=> Time
resp.next_token #=> String

Options Hash (options):

  • :stack_name (required, String)

    The name of the stack for which you want drift information.

  • :stack_resource_drift_status_filters (Array<String>)

    The resource drift status values to use as filters for the resource drift results returned.

    • DELETED: The resource differs from its expected template configuration in that the resource has been deleted.

    • MODIFIED: One or more resource properties differ from their expected template values.

    • IN_SYNC: The resources\'s actual configuration matches its expected template configuration.

    • NOT_CHECKED: AWS CloudFormation does not currently return this value.

  • :next_token (String)

    A string that identifies the next page of stack resource drift results.

  • :max_results (Integer)

    The maximum number of results to be returned with a single call. If the number of available results exceeds this maximum, the response includes a NextToken value that you can assign to the NextToken request parameter to get the next set of results.

Returns:

See Also:

#describe_stack_resources(options = {}) ⇒ Types::DescribeStackResourcesOutput

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.

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.

A ValidationError is returned if you specify both StackName and PhysicalResourceId in the same request.

Examples:

Request syntax with placeholder values


resp = client.describe_stack_resources({
  stack_name: "StackName",
  logical_resource_id: "LogicalResourceId",
  physical_resource_id: "PhysicalResourceId",
})

Response structure


resp.stack_resources #=> Array
resp.stack_resources[0].stack_name #=> String
resp.stack_resources[0].stack_id #=> String
resp.stack_resources[0].logical_resource_id #=> String
resp.stack_resources[0].physical_resource_id #=> String
resp.stack_resources[0].resource_type #=> String
resp.stack_resources[0].timestamp #=> Time
resp.stack_resources[0].resource_status #=> String, one of "CREATE_IN_PROGRESS", "CREATE_FAILED", "CREATE_COMPLETE", "DELETE_IN_PROGRESS", "DELETE_FAILED", "DELETE_COMPLETE", "DELETE_SKIPPED", "UPDATE_IN_PROGRESS", "UPDATE_FAILED", "UPDATE_COMPLETE", "IMPORT_FAILED", "IMPORT_COMPLETE", "IMPORT_IN_PROGRESS", "IMPORT_ROLLBACK_IN_PROGRESS", "IMPORT_ROLLBACK_FAILED", "IMPORT_ROLLBACK_COMPLETE"
resp.stack_resources[0].resource_status_reason #=> String
resp.stack_resources[0].description #=> String
resp.stack_resources[0].drift_information.stack_resource_drift_status #=> String, one of "IN_SYNC", "MODIFIED", "DELETED", "NOT_CHECKED"
resp.stack_resources[0].drift_information.last_check_timestamp #=> Time

Options Hash (options):

  • :stack_name (String)

    The name or the unique stack ID that is associated with the stack, which are not always interchangeable:

    • Running stacks: You can specify either the stack\'s name or its unique stack ID.

    • Deleted stacks: You must specify the unique stack ID.

    Default: There is no default value.

    Required: Conditional. If you do not specify StackName, you must specify PhysicalResourceId.

  • :logical_resource_id (String)

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

    Default: There is no default value.

  • :physical_resource_id (String)

    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.

Returns:

See Also:

#describe_stack_set(options = {}) ⇒ Types::DescribeStackSetOutput

Returns the description of the specified stack set.

Examples:

Request syntax with placeholder values


resp = client.describe_stack_set({
  stack_set_name: "StackSetName", # required
})

Response structure


resp.stack_set.stack_set_name #=> String
resp.stack_set.stack_set_id #=> String
resp.stack_set.description #=> String
resp.stack_set.status #=> String, one of "ACTIVE", "DELETED"
resp.stack_set.template_body #=> String
resp.stack_set.parameters #=> Array
resp.stack_set.parameters[0].parameter_key #=> String
resp.stack_set.parameters[0].parameter_value #=> String
resp.stack_set.parameters[0].use_previous_value #=> true/false
resp.stack_set.parameters[0].resolved_value #=> String
resp.stack_set.capabilities #=> Array
resp.stack_set.capabilities[0] #=> String, one of "CAPABILITY_IAM", "CAPABILITY_NAMED_IAM", "CAPABILITY_AUTO_EXPAND"
resp.stack_set.tags #=> Array
resp.stack_set.tags[0].key #=> String
resp.stack_set.tags[0].value #=> String
resp.stack_set.stack_set_arn #=> String
resp.stack_set.administration_role_arn #=> String
resp.stack_set.execution_role_name #=> String
resp.stack_set.stack_set_drift_detection_details.drift_status #=> String, one of "DRIFTED", "IN_SYNC", "NOT_CHECKED"
resp.stack_set.stack_set_drift_detection_details.drift_detection_status #=> String, one of "COMPLETED", "FAILED", "PARTIAL_SUCCESS", "IN_PROGRESS", "STOPPED"
resp.stack_set.stack_set_drift_detection_details.last_drift_check_timestamp #=> Time
resp.stack_set.stack_set_drift_detection_details.total_stack_instances_count #=> Integer
resp.stack_set.stack_set_drift_detection_details.drifted_stack_instances_count #=> Integer
resp.stack_set.stack_set_drift_detection_details.in_sync_stack_instances_count #=> Integer
resp.stack_set.stack_set_drift_detection_details.in_progress_stack_instances_count #=> Integer
resp.stack_set.stack_set_drift_detection_details.failed_stack_instances_count #=> Integer
resp.stack_set.auto_deployment.enabled #=> true/false
resp.stack_set.auto_deployment. #=> true/false
resp.stack_set.permission_model #=> String, one of "SERVICE_MANAGED", "SELF_MANAGED"
resp.stack_set.organizational_unit_ids #=> Array
resp.stack_set.organizational_unit_ids[0] #=> String

Options Hash (options):

  • :stack_set_name (required, String)

    The name or unique ID of the stack set whose description you want.

Returns:

See Also:

#describe_stack_set_operation(options = {}) ⇒ Types::DescribeStackSetOperationOutput

Returns the description of the specified stack set operation.

Examples:

Request syntax with placeholder values


resp = client.describe_stack_set_operation({
  stack_set_name: "StackSetName", # required
  operation_id: "ClientRequestToken", # required
})

Response structure


resp.stack_set_operation.operation_id #=> String
resp.stack_set_operation.stack_set_id #=> String
resp.stack_set_operation.action #=> String, one of "CREATE", "UPDATE", "DELETE", "DETECT_DRIFT"
resp.stack_set_operation.status #=> String, one of "RUNNING", "SUCCEEDED", "FAILED", "STOPPING", "STOPPED", "QUEUED"
resp.stack_set_operation.operation_preferences.region_order #=> Array
resp.stack_set_operation.operation_preferences.region_order[0] #=> String
resp.stack_set_operation.operation_preferences.failure_tolerance_count #=> Integer
resp.stack_set_operation.operation_preferences.failure_tolerance_percentage #=> Integer
resp.stack_set_operation.operation_preferences.max_concurrent_count #=> Integer
resp.stack_set_operation.operation_preferences.max_concurrent_percentage #=> Integer
resp.stack_set_operation.retain_stacks #=> true/false
resp.stack_set_operation.administration_role_arn #=> String
resp.stack_set_operation.execution_role_name #=> String
resp.stack_set_operation.creation_timestamp #=> Time
resp.stack_set_operation.end_timestamp #=> Time
resp.stack_set_operation.deployment_targets.accounts #=> Array
resp.stack_set_operation.deployment_targets.accounts[0] #=> String
resp.stack_set_operation.deployment_targets.organizational_unit_ids #=> Array
resp.stack_set_operation.deployment_targets.organizational_unit_ids[0] #=> String
resp.stack_set_operation.stack_set_drift_detection_details.drift_status #=> String, one of "DRIFTED", "IN_SYNC", "NOT_CHECKED"
resp.stack_set_operation.stack_set_drift_detection_details.drift_detection_status #=> String, one of "COMPLETED", "FAILED", "PARTIAL_SUCCESS", "IN_PROGRESS", "STOPPED"
resp.stack_set_operation.stack_set_drift_detection_details.last_drift_check_timestamp #=> Time
resp.stack_set_operation.stack_set_drift_detection_details.total_stack_instances_count #=> Integer
resp.stack_set_operation.stack_set_drift_detection_details.drifted_stack_instances_count #=> Integer
resp.stack_set_operation.stack_set_drift_detection_details.in_sync_stack_instances_count #=> Integer
resp.stack_set_operation.stack_set_drift_detection_details.in_progress_stack_instances_count #=> Integer
resp.stack_set_operation.stack_set_drift_detection_details.failed_stack_instances_count #=> Integer

Options Hash (options):

  • :stack_set_name (required, String)

    The name or the unique stack ID of the stack set for the stack operation.

  • :operation_id (required, String)

    The unique ID of the stack set operation.

Returns:

See Also:

#describe_stacks(options = {}) ⇒ Types::DescribeStacksOutput

Returns the description for the specified stack; if no stack name was specified, then it returns the description for all the stacks created.

If the stack does not exist, an AmazonCloudFormationException is returned.

Examples:

Request syntax with placeholder values


resp = client.describe_stacks({
  stack_name: "StackName",
  next_token: "NextToken",
})

Response structure


resp.stacks #=> Array
resp.stacks[0].stack_id #=> String
resp.stacks[0].stack_name #=> String
resp.stacks[0].change_set_id #=> String
resp.stacks[0].description #=> String
resp.stacks[0].parameters #=> Array
resp.stacks[0].parameters[0].parameter_key #=> String
resp.stacks[0].parameters[0].parameter_value #=> String
resp.stacks[0].parameters[0].use_previous_value #=> true/false
resp.stacks[0].parameters[0].resolved_value #=> String
resp.stacks[0].creation_time #=> Time
resp.stacks[0].deletion_time #=> Time
resp.stacks[0].last_updated_time #=> Time
resp.stacks[0].rollback_configuration.rollback_triggers #=> Array
resp.stacks[0].rollback_configuration.rollback_triggers[0].arn #=> String
resp.stacks[0].rollback_configuration.rollback_triggers[0].type #=> String
resp.stacks[0].rollback_configuration.monitoring_time_in_minutes #=> Integer
resp.stacks[0].stack_status #=> String, one of "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", "REVIEW_IN_PROGRESS", "IMPORT_IN_PROGRESS", "IMPORT_COMPLETE", "IMPORT_ROLLBACK_IN_PROGRESS", "IMPORT_ROLLBACK_FAILED", "IMPORT_ROLLBACK_COMPLETE"
resp.stacks[0].stack_status_reason #=> String
resp.stacks[0].disable_rollback #=> true/false
resp.stacks[0].notification_arns #=> Array
resp.stacks[0].notification_arns[0] #=> String
resp.stacks[0].timeout_in_minutes #=> Integer
resp.stacks[0].capabilities #=> Array
resp.stacks[0].capabilities[0] #=> String, one of "CAPABILITY_IAM", "CAPABILITY_NAMED_IAM", "CAPABILITY_AUTO_EXPAND"
resp.stacks[0].outputs #=> Array
resp.stacks[0].outputs[0].output_key #=> String
resp.stacks[0].outputs[0].output_value #=> String
resp.stacks[0].outputs[0].description #=> String
resp.stacks[0].outputs[0].export_name #=> String
resp.stacks[0].role_arn #=> String
resp.stacks[0].tags #=> Array
resp.stacks[0].tags[0].key #=> String
resp.stacks[0].tags[0].value #=> String
resp.stacks[0].enable_termination_protection #=> true/false
resp.stacks[0].parent_id #=> String
resp.stacks[0].root_id #=> String
resp.stacks[0].drift_information.stack_drift_status #=> String, one of "DRIFTED", "IN_SYNC", "UNKNOWN", "NOT_CHECKED"
resp.stacks[0].drift_information.last_check_timestamp #=> Time
resp.next_token #=> String

Options Hash (options):

  • :stack_name (String)

    The name or the unique stack ID that is associated with the stack, which are not always interchangeable:

    • Running stacks: You can specify either the stack\'s name or its unique stack ID.

    • Deleted stacks: You must specify the unique stack ID.

    Default: There is no default value.

  • :next_token (String)

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

Returns:

See Also:

#describe_type(options = {}) ⇒ Types::DescribeTypeOutput

Returns detailed information about a type that has been registered.

If you specify a VersionId, DescribeType returns information about that specific type version. Otherwise, it returns information about the default type version.

Examples:

Request syntax with placeholder values


resp = client.describe_type({
  type: "RESOURCE", # accepts RESOURCE
  type_name: "TypeName",
  arn: "TypeArn",
  version_id: "TypeVersionId",
})

Response structure


resp.arn #=> String
resp.type #=> String, one of "RESOURCE"
resp.type_name #=> String
resp.default_version_id #=> String
resp.is_default_version #=> true/false
resp.description #=> String
resp.schema #=> String
resp.provisioning_type #=> String, one of "NON_PROVISIONABLE", "IMMUTABLE", "FULLY_MUTABLE"
resp.deprecated_status #=> String, one of "LIVE", "DEPRECATED"
resp.logging_config.log_role_arn #=> String
resp.logging_config.log_group_name #=> String
resp.execution_role_arn #=> String
resp.visibility #=> String, one of "PUBLIC", "PRIVATE"
resp.source_url #=> String
resp.documentation_url #=> String
resp.last_updated #=> Time
resp.time_created #=> Time

Options Hash (options):

  • :type (String)

    The kind of type.

    Currently the only valid value is RESOURCE.

    Conditional: You must specify either TypeName and Type, or Arn.

  • :type_name (String)

    The name of the type.

    Conditional: You must specify either TypeName and Type, or Arn.

  • :arn (String)

    The Amazon Resource Name (ARN) of the type.

    Conditional: You must specify either TypeName and Type, or Arn.

  • :version_id (String)

    The ID of a specific version of the type. The version ID is the value at the end of the Amazon Resource Name (ARN) assigned to the type version when it is registered.

    If you specify a VersionId, DescribeType returns information about that specific type version. Otherwise, it returns information about the default type version.

Returns:

See Also:

#describe_type_registration(options = {}) ⇒ Types::DescribeTypeRegistrationOutput

Returns information about a type's registration, including its current status and type and version identifiers.

When you initiate a registration request using RegisterType , you can then use DescribeTypeRegistration to monitor the progress of that registration request.

Once the registration request has completed, use DescribeType to return detailed informaiton about a type.

Examples:

Request syntax with placeholder values


resp = client.describe_type_registration({
  registration_token: "RegistrationToken", # required
})

Response structure


resp.progress_status #=> String, one of "COMPLETE", "IN_PROGRESS", "FAILED"
resp.description #=> String
resp.type_arn #=> String
resp.type_version_arn #=> String

Options Hash (options):

  • :registration_token (required, String)

    The identifier for this registration request.

    This registration token is generated by CloudFormation when you initiate a registration request using RegisterType.

Returns:

See Also:

#detect_stack_drift(options = {}) ⇒ Types::DetectStackDriftOutput

Detects whether a stack's actual configuration differs, or has drifted, from it's expected configuration, as defined in the stack template and any values specified as template parameters. For each resource in the stack that supports drift detection, AWS CloudFormation compares the actual configuration of the resource with its expected template configuration. Only resource properties explicitly defined in the stack template are checked for drift. A stack is considered to have drifted if one or more of its resources differ from their expected template configurations. For more information, see Detecting Unregulated Configuration Changes to Stacks and Resources.

Use DetectStackDrift to detect drift on all supported resources for a given stack, or DetectStackResourceDrift to detect drift on individual resources.

For a list of stack resources that currently support drift detection, see Resources that Support Drift Detection.

DetectStackDrift can take up to several minutes, depending on the number of resources contained within the stack. Use DescribeStackDriftDetectionStatus to monitor the progress of a detect stack drift operation. Once the drift detection operation has completed, use DescribeStackResourceDrifts to return drift information about the stack and its resources.

When detecting drift on a stack, AWS CloudFormation does not detect drift on any nested stacks belonging to that stack. Perform DetectStackDrift directly on the nested stack itself.

Examples:

Request syntax with placeholder values


resp = client.detect_stack_drift({
  stack_name: "StackNameOrId", # required
  logical_resource_ids: ["LogicalResourceId"],
})

Response structure


resp.stack_drift_detection_id #=> String

Options Hash (options):

  • :stack_name (required, String)

    The name of the stack for which you want to detect drift.

  • :logical_resource_ids (Array<String>)

    The logical names of any resources you want to use as filters.

Returns:

See Also:

#detect_stack_resource_drift(options = {}) ⇒ Types::DetectStackResourceDriftOutput

Returns information about whether a resource's actual configuration differs, or has drifted, from it's expected configuration, as defined in the stack template and any values specified as template parameters. This information includes actual and expected property values for resources in which AWS CloudFormation detects drift. Only resource properties explicitly defined in the stack template are checked for drift. For more information about stack and resource drift, see Detecting Unregulated Configuration Changes to Stacks and Resources.

Use DetectStackResourceDrift to detect drift on individual resources, or DetectStackDrift to detect drift on all resources in a given stack that support drift detection.

Resources that do not currently support drift detection cannot be checked. For a list of resources that support drift detection, see Resources that Support Drift Detection.

Examples:

Request syntax with placeholder values


resp = client.detect_stack_resource_drift({
  stack_name: "StackNameOrId", # required
  logical_resource_id: "LogicalResourceId", # required
})

Response structure


resp.stack_resource_drift.stack_id #=> String
resp.stack_resource_drift.logical_resource_id #=> String
resp.stack_resource_drift.physical_resource_id #=> String
resp.stack_resource_drift.physical_resource_id_context #=> Array
resp.stack_resource_drift.physical_resource_id_context[0].key #=> String
resp.stack_resource_drift.physical_resource_id_context[0].value #=> String
resp.stack_resource_drift.resource_type #=> String
resp.stack_resource_drift.expected_properties #=> String
resp.stack_resource_drift.actual_properties #=> String
resp.stack_resource_drift.property_differences #=> Array
resp.stack_resource_drift.property_differences[0].property_path #=> String
resp.stack_resource_drift.property_differences[0].expected_value #=> String
resp.stack_resource_drift.property_differences[0].actual_value #=> String
resp.stack_resource_drift.property_differences[0].difference_type #=> String, one of "ADD", "REMOVE", "NOT_EQUAL"
resp.stack_resource_drift.stack_resource_drift_status #=> String, one of "IN_SYNC", "MODIFIED", "DELETED", "NOT_CHECKED"
resp.stack_resource_drift.timestamp #=> Time

Options Hash (options):

  • :stack_name (required, String)

    The name of the stack to which the resource belongs.

  • :logical_resource_id (required, String)

    The logical name of the resource for which to return drift information.

Returns:

See Also:

#detect_stack_set_drift(options = {}) ⇒ Types::DetectStackSetDriftOutput

Detect drift on a stack set. When CloudFormation performs drift detection on a stack set, it performs drift detection on the stack associated with each stack instance in the stack set. For more information, see How CloudFormation Performs Drift Detection on a Stack Set.

DetectStackSetDrift returns the OperationId of the stack set drift detection operation. Use this operation id with DescribeStackSetOperation to monitor the progress of the drift detection operation. The drift detection operation may take some time, depending on the number of stack instances included in the stack set, as well as the number of resources included in each stack.

Once the operation has completed, use the following actions to return drift information:

  • Use DescribeStackSet to return detailed informaiton about the stack set, including detailed information about the last completed drift operation performed on the stack set. (Information about drift operations that are in progress is not included.)

  • Use ListStackInstances to return a list of stack instances belonging to the stack set, including the drift status and last drift time checked of each instance.

  • Use DescribeStackInstance to return detailed information about a specific stack instance, including its drift status and last drift time checked.

For more information on performing a drift detection operation on a stack set, see Detecting Unmanaged Changes in Stack Sets.

You can only run a single drift detection operation on a given stack set at one time.

To stop a drift detection stack set operation, use StopStackSetOperation .

Examples:

Request syntax with placeholder values


resp = client.detect_stack_set_drift({
  stack_set_name: "StackSetNameOrId", # required
  operation_preferences: {
    region_order: ["Region"],
    failure_tolerance_count: 1,
    failure_tolerance_percentage: 1,
    max_concurrent_count: 1,
    max_concurrent_percentage: 1,
  },
  operation_id: "ClientRequestToken",
})

Response structure


resp.operation_id #=> String

Options Hash (options):

  • :stack_set_name (required, String)

    The name of the stack set on which to perform the drift detection operation.

  • :operation_preferences (Types::StackSetOperationPreferences)

    The user-specified preferences for how AWS CloudFormation performs a stack set operation.

    For more information on maximum concurrent accounts and failure tolerance, see Stack set operation options.

  • :operation_id (String)

    This parameter will be auto-filled on your behalf with a random UUIDv4 when no value is provided. The ID of the stack set operation.

Returns:

See Also:

#estimate_template_cost(options = {}) ⇒ Types::EstimateTemplateCostOutput

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.

Examples:

Request syntax with placeholder values


resp = client.estimate_template_cost({
  template_body: "TemplateBody",
  template_url: "TemplateURL",
  parameters: [
    {
      parameter_key: "ParameterKey",
      parameter_value: "ParameterValue",
      use_previous_value: false,
      resolved_value: "ParameterValue",
    },
  ],
})

Response structure


resp.url #=> String

Options Hash (options):

  • :template_body (String)

    Structure containing the template body with a minimum length of 1 byte and a maximum length of 51,200 bytes. (For more information, go to Template Anatomy in the AWS CloudFormation User Guide.)

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

  • :template_url (String)

    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 pass TemplateURL or TemplateBody. If both are passed, only TemplateBody is used.

  • :parameters (Array<Types::Parameter>)

    A list of Parameter structures that specify input parameters.

Returns:

See Also:

#execute_change_set(options = {}) ⇒ Struct

Updates a stack using the input information that was provided when the specified change set was created. After the call successfully completes, AWS CloudFormation starts updating the stack. Use the DescribeStacks action to view the status of the update.

When you execute a change set, AWS CloudFormation deletes all other change sets associated with the stack because they aren't valid for the updated stack.

If a stack policy is associated with the stack, AWS CloudFormation enforces the policy during the update. You can't specify a temporary stack policy that overrides the current policy.

To create a change set for the entire stack hierachy, IncludeNestedStacks must have been set to True.

Examples:

Request syntax with placeholder values


resp = client.execute_change_set({
  change_set_name: "ChangeSetNameOrId", # required
  stack_name: "StackNameOrId",
  client_request_token: "ClientRequestToken",
})

Options Hash (options):

  • :change_set_name (required, String)

    The name or ARN of the change set that you want use to update the specified stack.

  • :stack_name (String)

    If you specified the name of a change set, specify the stack name or ID (ARN) that is associated with the change set you want to execute.

  • :client_request_token (String)

    A unique identifier for this ExecuteChangeSet request. Specify this token if you plan to retry requests so that AWS CloudFormation knows that you\'re not attempting to execute a change set to update a stack with the same name. You might retry ExecuteChangeSet requests to ensure that AWS CloudFormation successfully received them.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#get_stack_policy(options = {}) ⇒ Types::GetStackPolicyOutput

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

Examples:

Request syntax with placeholder values


resp = client.get_stack_policy({
  stack_name: "StackName", # required
})

Response structure


resp.stack_policy_body #=> String

Options Hash (options):

  • :stack_name (required, String)

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

Returns:

See Also:

#get_template(options = {}) ⇒ Types::GetTemplateOutput

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.

If the template does not exist, a ValidationError is returned.

Examples:

Request syntax with placeholder values


resp = client.get_template({
  stack_name: "StackName",
  change_set_name: "ChangeSetNameOrId",
  template_stage: "Original", # accepts Original, Processed
})

Response structure


resp.template_body #=> String
resp.stages_available #=> Array
resp.stages_available[0] #=> String, one of "Original", "Processed"

Options Hash (options):

  • :stack_name (String)

    The name or the unique stack ID that is associated with the stack, which are not always interchangeable:

    • Running stacks: You can specify either the stack\'s name or its unique stack ID.

    • Deleted stacks: You must specify the unique stack ID.

    Default: There is no default value.

  • :change_set_name (String)

    The name or Amazon Resource Name (ARN) of a change set for which AWS CloudFormation returns the associated template. If you specify a name, you must also specify the StackName.

  • :template_stage (String)

    For templates that include transforms, the stage of the template that AWS CloudFormation returns. To get the user-submitted template, specify Original. To get the template after AWS CloudFormation has processed all transforms, specify Processed.

    If the template doesn\'t include transforms, Original and Processed return the same template. By default, AWS CloudFormation specifies Original.

Returns:

See Also:

#get_template_summary(options = {}) ⇒ Types::GetTemplateSummaryOutput

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 or stack set.

You can use the GetTemplateSummary action when you submit a template, or you can get template information for a stack set, or 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.

Examples:

Request syntax with placeholder values


resp = client.get_template_summary({
  template_body: "TemplateBody",
  template_url: "TemplateURL",
  stack_name: "StackNameOrId",
  stack_set_name: "StackSetNameOrId",
})

Response structure


resp.parameters #=> Array
resp.parameters[0].parameter_key #=> String
resp.parameters[0].default_value #=> String
resp.parameters[0].parameter_type #=> String
resp.parameters[0].no_echo #=> true/false
resp.parameters[0].description #=> String
resp.parameters[0].parameter_constraints.allowed_values #=> Array
resp.parameters[0].parameter_constraints.allowed_values[0] #=> String
resp.description #=> String
resp.capabilities #=> Array
resp.capabilities[0] #=> String, one of "CAPABILITY_IAM", "CAPABILITY_NAMED_IAM", "CAPABILITY_AUTO_EXPAND"
resp.capabilities_reason #=> String
resp.resource_types #=> Array
resp.resource_types[0] #=> String
resp.version #=> String
resp. #=> String
resp.declared_transforms #=> Array
resp.declared_transforms[0] #=> String
resp.resource_identifier_summaries #=> Array
resp.resource_identifier_summaries[0].resource_type #=> String
resp.resource_identifier_summaries[0].logical_resource_ids #=> Array
resp.resource_identifier_summaries[0].logical_resource_ids[0] #=> String
resp.resource_identifier_summaries[0].resource_identifiers #=> Array
resp.resource_identifier_summaries[0].resource_identifiers[0] #=> String

Options Hash (options):

  • :template_body (String)

    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, StackSetName, TemplateBody, or TemplateURL.

  • :template_url (String)

    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, StackSetName, TemplateBody, or TemplateURL.

  • :stack_name (String)

    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, StackSetName, TemplateBody, or TemplateURL.

  • :stack_set_name (String)

    The name or unique ID of the stack set from which the stack was created.

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

Returns:

See Also:

#list_change_sets(options = {}) ⇒ Types::ListChangeSetsOutput

Returns the ID and status of each active change set for a stack. For example, AWS CloudFormation lists change sets that are in the CREATE_IN_PROGRESS or CREATE_PENDING state.

Examples:

Request syntax with placeholder values


resp = client.list_change_sets({
  stack_name: "StackNameOrId", # required
  next_token: "NextToken",
})

Response structure


resp.summaries #=> Array
resp.summaries[0].stack_id #=> String
resp.summaries[0].stack_name #=> String
resp.summaries[0].change_set_id #=> String
resp.summaries[0].change_set_name #=> String
resp.summaries[0].execution_status #=> String, one of "UNAVAILABLE", "AVAILABLE", "EXECUTE_IN_PROGRESS", "EXECUTE_COMPLETE", "EXECUTE_FAILED", "OBSOLETE"
resp.summaries[0].status #=> String, one of "CREATE_PENDING", "CREATE_IN_PROGRESS", "CREATE_COMPLETE", "DELETE_PENDING", "DELETE_IN_PROGRESS", "DELETE_COMPLETE", "DELETE_FAILED", "FAILED"
resp.summaries[0].status_reason #=> String
resp.summaries[0].creation_time #=> Time
resp.summaries[0].description #=> String
resp.summaries[0].include_nested_stacks #=> true/false
resp.summaries[0].parent_change_set_id #=> String
resp.summaries[0].root_change_set_id #=> String
resp.next_token #=> String

Options Hash (options):

  • :stack_name (required, String)

    The name or the Amazon Resource Name (ARN) of the stack for which you want to list change sets.

  • :next_token (String)

    A string (provided by the ListChangeSets response output) that identifies the next page of change sets that you want to retrieve.

Returns:

See Also:

#list_exports(options = {}) ⇒ Types::ListExportsOutput

Lists all exported output values in the account and Region in which you call this action. Use this action to see the exported output values that you can import into other stacks. To import values, use the Fn::ImportValue function.

For more information, see AWS CloudFormation Export Stack Output Values.

Examples:

Request syntax with placeholder values


resp = client.list_exports({
  next_token: "NextToken",
})

Response structure


resp.exports #=> Array
resp.exports[0].exporting_stack_id #=> String
resp.exports[0].name #=> String
resp.exports[0].value #=> String
resp.next_token #=> String

Options Hash (options):

  • :next_token (String)

    A string (provided by the ListExports response output) that identifies the next page of exported output values that you asked to retrieve.

Returns:

See Also:

#list_imports(options = {}) ⇒ Types::ListImportsOutput

Lists all stacks that are importing an exported output value. To modify or remove an exported output value, first use this action to see which stacks are using it. To see the exported output values in your account, see ListExports.

For more information about importing an exported output value, see the Fn::ImportValue function.

Examples:

Request syntax with placeholder values


resp = client.list_imports({
  export_name: "ExportName", # required
  next_token: "NextToken",
})

Response structure


resp.imports #=> Array
resp.imports[0] #=> String
resp.next_token #=> String

Options Hash (options):

  • :export_name (required, String)

    The name of the exported output value. AWS CloudFormation returns the stack names that are importing this value.

  • :next_token (String)

    A string (provided by the ListImports response output) that identifies the next page of stacks that are importing the specified exported output value.

Returns:

See Also:

#list_stack_instances(options = {}) ⇒ Types::ListStackInstancesOutput

Returns summary information about stack instances that are associated with the specified stack set. You can filter for stack instances that are associated with a specific AWS account name or Region, or that have a specific status.

Examples:

Request syntax with placeholder values


resp = client.list_stack_instances({
  stack_set_name: "StackSetName", # required
  next_token: "NextToken",
  max_results: 1,
  filters: [
    {
      name: "DETAILED_STATUS", # accepts DETAILED_STATUS
      values: "StackInstanceFilterValues",
    },
  ],
  stack_instance_account: "Account",
  stack_instance_region: "Region",
})

Response structure


resp.summaries #=> Array
resp.summaries[0].stack_set_id #=> String
resp.summaries[0].region #=> String
resp.summaries[0]. #=> String
resp.summaries[0].stack_id #=> String
resp.summaries[0].status #=> String, one of "CURRENT", "OUTDATED", "INOPERABLE"
resp.summaries[0].status_reason #=> String
resp.summaries[0].stack_instance_status.detailed_status #=> String, one of "PENDING", "RUNNING", "SUCCEEDED", "FAILED", "CANCELLED", "INOPERABLE"
resp.summaries[0].organizational_unit_id #=> String
resp.summaries[0].drift_status #=> String, one of "DRIFTED", "IN_SYNC", "UNKNOWN", "NOT_CHECKED"
resp.summaries[0].last_drift_check_timestamp #=> Time
resp.next_token #=> String

Options Hash (options):

  • :stack_set_name (required, String)

    The name or unique ID of the stack set that you want to list stack instances for.

  • :next_token (String)

    If the previous request didn\'t return all of the remaining results, the response\'s NextToken parameter value is set to a token. To retrieve the next set of results, call ListStackInstances again and assign that token to the request object\'s NextToken parameter. If there are no remaining results, the previous response object\'s NextToken parameter is set to null.

  • :max_results (Integer)

    The maximum number of results to be returned with a single call. If the number of available results exceeds this maximum, the response includes a NextToken value that you can assign to the NextToken request parameter to get the next set of results.

  • :filters (Array<Types::StackInstanceFilter>)

    The status that stack instances are filtered by.

  • :stack_instance_account (String)

    The name of the AWS account that you want to list stack instances for.

  • :stack_instance_region (String)

    The name of the Region where you want to list stack instances.

Returns:

See Also:

#list_stack_resources(options = {}) ⇒ Types::ListStackResourcesOutput

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.

Examples:

Request syntax with placeholder values


resp = client.list_stack_resources({
  stack_name: "StackName", # required
  next_token: "NextToken",
})

Response structure


resp.stack_resource_summaries #=> Array
resp.stack_resource_summaries[0].logical_resource_id #=> String
resp.stack_resource_summaries[0].physical_resource_id #=> String
resp.stack_resource_summaries[0].resource_type #=> String
resp.stack_resource_summaries[0].last_updated_timestamp #=> Time
resp.stack_resource_summaries[0].resource_status #=> String, one of "CREATE_IN_PROGRESS", "CREATE_FAILED", "CREATE_COMPLETE", "DELETE_IN_PROGRESS", "DELETE_FAILED", "DELETE_COMPLETE", "DELETE_SKIPPED", "UPDATE_IN_PROGRESS", "UPDATE_FAILED", "UPDATE_COMPLETE", "IMPORT_FAILED", "IMPORT_COMPLETE", "IMPORT_IN_PROGRESS", "IMPORT_ROLLBACK_IN_PROGRESS", "IMPORT_ROLLBACK_FAILED", "IMPORT_ROLLBACK_COMPLETE"
resp.stack_resource_summaries[0].resource_status_reason #=> String
resp.stack_resource_summaries[0].drift_information.stack_resource_drift_status #=> String, one of "IN_SYNC", "MODIFIED", "DELETED", "NOT_CHECKED"
resp.stack_resource_summaries[0].drift_information.last_check_timestamp #=> Time
resp.next_token #=> String

Options Hash (options):

  • :stack_name (required, String)

    The name or the unique stack ID that is associated with the stack, which are not always interchangeable:

    • Running stacks: You can specify either the stack\'s name or its unique stack ID.

    • Deleted stacks: You must specify the unique stack ID.

    Default: There is no default value.

  • :next_token (String)

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

Returns:

See Also:

#list_stack_set_operation_results(options = {}) ⇒ Types::ListStackSetOperationResultsOutput

Returns summary information about the results of a stack set operation.

Examples:

Request syntax with placeholder values


resp = client.list_stack_set_operation_results({
  stack_set_name: "StackSetName", # required
  operation_id: "ClientRequestToken", # required
  next_token: "NextToken",
  max_results: 1,
})

Response structure


resp.summaries #=> Array
resp.summaries[0]. #=> String
resp.summaries[0].region #=> String
resp.summaries[0].status #=> String, one of "PENDING", "RUNNING", "SUCCEEDED", "FAILED", "CANCELLED"
resp.summaries[0].status_reason #=> String
resp.summaries[0]..status #=> String, one of "SUCCEEDED", "FAILED", "SKIPPED"
resp.summaries[0]..status_reason #=> String
resp.summaries[0].organizational_unit_id #=> String
resp.next_token #=> String

Options Hash (options):

  • :stack_set_name (required, String)

    The name or unique ID of the stack set that you want to get operation results for.

  • :operation_id (required, String)

    The ID of the stack set operation.

  • :next_token (String)

    If the previous request didn\'t return all of the remaining results, the response object\'s NextToken parameter value is set to a token. To retrieve the next set of results, call ListStackSetOperationResults again and assign that token to the request object\'s NextToken parameter. If there are no remaining results, the previous response object\'s NextToken parameter is set to null.

  • :max_results (Integer)

    The maximum number of results to be returned with a single call. If the number of available results exceeds this maximum, the response includes a NextToken value that you can assign to the NextToken request parameter to get the next set of results.

Returns:

See Also:

#list_stack_set_operations(options = {}) ⇒ Types::ListStackSetOperationsOutput

Returns summary information about operations performed on a stack set.

Examples:

Request syntax with placeholder values


resp = client.list_stack_set_operations({
  stack_set_name: "StackSetName", # required
  next_token: "NextToken",
  max_results: 1,
})

Response structure


resp.summaries #=> Array
resp.summaries[0].operation_id #=> String
resp.summaries[0].action #=> String, one of "CREATE", "UPDATE", "DELETE", "DETECT_DRIFT"
resp.summaries[0].status #=> String, one of "RUNNING", "SUCCEEDED", "FAILED", "STOPPING", "STOPPED", "QUEUED"
resp.summaries[0].creation_timestamp #=> Time
resp.summaries[0].end_timestamp #=> Time
resp.next_token #=> String

Options Hash (options):

  • :stack_set_name (required, String)

    The name or unique ID of the stack set that you want to get operation summaries for.

  • :next_token (String)

    If the previous paginated request didn\'t return all of the remaining results, the response object\'s NextToken parameter value is set to a token. To retrieve the next set of results, call ListStackSetOperations again and assign that token to the request object\'s NextToken parameter. If there are no remaining results, the previous response object\'s NextToken parameter is set to null.

  • :max_results (Integer)

    The maximum number of results to be returned with a single call. If the number of available results exceeds this maximum, the response includes a NextToken value that you can assign to the NextToken request parameter to get the next set of results.

Returns:

See Also:

#list_stack_sets(options = {}) ⇒ Types::ListStackSetsOutput

Returns summary information about stack sets that are associated with the user.

Examples:

Request syntax with placeholder values


resp = client.list_stack_sets({
  next_token: "NextToken",
  max_results: 1,
  status: "ACTIVE", # accepts ACTIVE, DELETED
})

Response structure


resp.summaries #=> Array
resp.summaries[0].stack_set_name #=> String
resp.summaries[0].stack_set_id #=> String
resp.summaries[0].description #=> String
resp.summaries[0].status #=> String, one of "ACTIVE", "DELETED"
resp.summaries[0].auto_deployment.enabled #=> true/false
resp.summaries[0].auto_deployment. #=> true/false
resp.summaries[0].permission_model #=> String, one of "SERVICE_MANAGED", "SELF_MANAGED"
resp.summaries[0].drift_status #=> String, one of "DRIFTED", "IN_SYNC", "UNKNOWN", "NOT_CHECKED"
resp.summaries[0].last_drift_check_timestamp #=> Time
resp.next_token #=> String

Options Hash (options):

  • :next_token (String)

    If the previous paginated request didn\'t return all of the remaining results, the response object\'s NextToken parameter value is set to a token. To retrieve the next set of results, call ListStackSets again and assign that token to the request object\'s NextToken parameter. If there are no remaining results, the previous response object\'s NextToken parameter is set to null.

  • :max_results (Integer)

    The maximum number of results to be returned with a single call. If the number of available results exceeds this maximum, the response includes a NextToken value that you can assign to the NextToken request parameter to get the next set of results.

  • :status (String)

    The status of the stack sets that you want to get summary information about.

Returns:

See Also:

#list_stacks(options = {}) ⇒ Types::ListStacksOutput

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

Examples:

Request syntax with placeholder values


resp = client.list_stacks({
  next_token: "NextToken",
  stack_status_filter: ["CREATE_IN_PROGRESS"], # accepts 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, REVIEW_IN_PROGRESS, IMPORT_IN_PROGRESS, IMPORT_COMPLETE, IMPORT_ROLLBACK_IN_PROGRESS, IMPORT_ROLLBACK_FAILED, IMPORT_ROLLBACK_COMPLETE
})

Response structure


resp.stack_summaries #=> Array
resp.stack_summaries[0].stack_id #=> String
resp.stack_summaries[0].stack_name #=> String
resp.stack_summaries[0].template_description #=> String
resp.stack_summaries[0].creation_time #=> Time
resp.stack_summaries[0].last_updated_time #=> Time
resp.stack_summaries[0].deletion_time #=> Time
resp.stack_summaries[0].stack_status #=> String, one of "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", "REVIEW_IN_PROGRESS", "IMPORT_IN_PROGRESS", "IMPORT_COMPLETE", "IMPORT_ROLLBACK_IN_PROGRESS", "IMPORT_ROLLBACK_FAILED", "IMPORT_ROLLBACK_COMPLETE"
resp.stack_summaries[0].stack_status_reason #=> String
resp.stack_summaries[0].parent_id #=> String
resp.stack_summaries[0].root_id #=> String
resp.stack_summaries[0].drift_information.stack_drift_status #=> String, one of "DRIFTED", "IN_SYNC", "UNKNOWN", "NOT_CHECKED"
resp.stack_summaries[0].drift_information.last_check_timestamp #=> Time
resp.next_token #=> String

Options Hash (options):

  • :next_token (String)

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

  • :stack_status_filter (Array<String>)

    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.

Returns:

See Also:

#list_type_registrations(options = {}) ⇒ Types::ListTypeRegistrationsOutput

Returns a list of registration tokens for the specified type(s).

Examples:

Request syntax with placeholder values


resp = client.list_type_registrations({
  type: "RESOURCE", # accepts RESOURCE
  type_name: "TypeName",
  type_arn: "TypeArn",
  registration_status_filter: "COMPLETE", # accepts COMPLETE, IN_PROGRESS, FAILED
  max_results: 1,
  next_token: "NextToken",
})

Response structure


resp.registration_token_list #=> Array
resp.registration_token_list[0] #=> String
resp.next_token #=> String

Options Hash (options):

  • :type (String)

    The kind of type.

    Currently the only valid value is RESOURCE.

    Conditional: You must specify either TypeName and Type, or Arn.

  • :type_name (String)

    The name of the type.

    Conditional: You must specify either TypeName and Type, or Arn.

  • :type_arn (String)

    The Amazon Resource Name (ARN) of the type.

    Conditional: You must specify either TypeName and Type, or Arn.

  • :registration_status_filter (String)

    The current status of the type registration request.

    The default is IN_PROGRESS.

  • :max_results (Integer)

    The maximum number of results to be returned with a single call. If the number of available results exceeds this maximum, the response includes a NextToken value that you can assign to the NextToken request parameter to get the next set of results.

  • :next_token (String)

    If the previous paginated request didn\'t return all of the remaining results, the response object\'s NextToken parameter value is set to a token. To retrieve the next set of results, call this action again and assign that token to the request object\'s NextToken parameter. If there are no remaining results, the previous response object\'s NextToken parameter is set to null.

Returns:

See Also:

#list_type_versions(options = {}) ⇒ Types::ListTypeVersionsOutput

Returns summary information about the versions of a type.

Examples:

Request syntax with placeholder values


resp = client.list_type_versions({
  type: "RESOURCE", # accepts RESOURCE
  type_name: "TypeName",
  arn: "PrivateTypeArn",
  max_results: 1,
  next_token: "NextToken",
  deprecated_status: "LIVE", # accepts LIVE, DEPRECATED
})

Response structure


resp.type_version_summaries #=> Array
resp.type_version_summaries[0].type #=> String, one of "RESOURCE"
resp.type_version_summaries[0].type_name #=> String
resp.type_version_summaries[0].version_id #=> String
resp.type_version_summaries[0].is_default_version #=> true/false
resp.type_version_summaries[0].arn #=> String
resp.type_version_summaries[0].time_created #=> Time
resp.type_version_summaries[0].description #=> String
resp.next_token #=> String

Options Hash (options):

  • :type (String)

    The kind of the type.

    Currently the only valid value is RESOURCE.

    Conditional: You must specify either TypeName and Type, or Arn.

  • :type_name (String)

    The name of the type for which you want version summary information.

    Conditional: You must specify either TypeName and Type, or Arn.

  • :arn (String)

    The Amazon Resource Name (ARN) of the type for which you want version summary information.

    Conditional: You must specify either TypeName and Type, or Arn.

  • :max_results (Integer)

    The maximum number of results to be returned with a single call. If the number of available results exceeds this maximum, the response includes a NextToken value that you can assign to the NextToken request parameter to get the next set of results.

  • :next_token (String)

    If the previous paginated request didn\'t return all of the remaining results, the response object\'s NextToken parameter value is set to a token. To retrieve the next set of results, call this action again and assign that token to the request object\'s NextToken parameter. If there are no remaining results, the previous response object\'s NextToken parameter is set to null.

  • :deprecated_status (String)

    The deprecation status of the type versions that you want to get summary information about.

    Valid values include:

    • LIVE: The type version is registered and can be used in CloudFormation operations, dependent on its provisioning behavior and visibility scope.

    • DEPRECATED: The type version has been deregistered and can no longer be used in CloudFormation operations.

    The default is LIVE.

Returns:

See Also:

#list_types(options = {}) ⇒ Types::ListTypesOutput

Returns summary information about types that have been registered with CloudFormation.

Examples:

Request syntax with placeholder values


resp = client.list_types({
  visibility: "PUBLIC", # accepts PUBLIC, PRIVATE
  provisioning_type: "NON_PROVISIONABLE", # accepts NON_PROVISIONABLE, IMMUTABLE, FULLY_MUTABLE
  deprecated_status: "LIVE", # accepts LIVE, DEPRECATED
  max_results: 1,
  next_token: "NextToken",
})

Response structure


resp.type_summaries #=> Array
resp.type_summaries[0].type #=> String, one of "RESOURCE"
resp.type_summaries[0].type_name #=> String
resp.type_summaries[0].default_version_id #=> String
resp.type_summaries[0].type_arn #=> String
resp.type_summaries[0].last_updated #=> Time
resp.type_summaries[0].description #=> String
resp.next_token #=> String

Options Hash (options):

  • :visibility (String)

    The scope at which the type is visible and usable in CloudFormation operations.

    Valid values include:

    • PRIVATE: The type is only visible and usable within the account in which it is registered. Currently, AWS CloudFormation marks any types you create as PRIVATE.

    • PUBLIC: The type is publically visible and usable within any Amazon account.

    The default is PRIVATE.

  • :provisioning_type (String)

    The provisioning behavior of the type. AWS CloudFormation determines the provisioning type during registration, based on the types of handlers in the schema handler package submitted.

    Valid values include:

    • FULLY_MUTABLE: The type includes an update handler to process updates to the type during stack update operations.

    • IMMUTABLE: The type does not include an update handler, so the type cannot be updated and must instead be replaced during stack update operations.

    • NON_PROVISIONABLE: The type does not include create, read, and delete handlers, and therefore cannot actually be provisioned.

  • :deprecated_status (String)

    The deprecation status of the types that you want to get summary information about.

    Valid values include:

    • LIVE: The type is registered for use in CloudFormation operations.

    • DEPRECATED: The type has been deregistered and can no longer be used in CloudFormation operations.

  • :max_results (Integer)

    The maximum number of results to be returned with a single call. If the number of available results exceeds this maximum, the response includes a NextToken value that you can assign to the NextToken request parameter to get the next set of results.

  • :next_token (String)

    If the previous paginated request didn\'t return all of the remaining results, the response object\'s NextToken parameter value is set to a token. To retrieve the next set of results, call this action again and assign that token to the request object\'s NextToken parameter. If there are no remaining results, the previous response object\'s NextToken parameter is set to null.

Returns:

See Also:

#record_handler_progress(options = {}) ⇒ Struct

Reports progress of a resource handler to CloudFormation.

Reserved for use by the CloudFormation CLI. Do not use this API in your code.

Examples:

Request syntax with placeholder values


resp = client.record_handler_progress({
  bearer_token: "ClientToken", # required
  operation_status: "PENDING", # required, accepts PENDING, IN_PROGRESS, SUCCESS, FAILED
  current_operation_status: "PENDING", # accepts PENDING, IN_PROGRESS, SUCCESS, FAILED
  status_message: "StatusMessage",
  error_code: "NotUpdatable", # accepts NotUpdatable, InvalidRequest, AccessDenied, InvalidCredentials, AlreadyExists, NotFound, ResourceConflict, Throttling, ServiceLimitExceeded, NotStabilized, GeneralServiceException, ServiceInternalError, NetworkFailure, InternalFailure
  resource_model: "ResourceModel",
  client_request_token: "ClientRequestToken",
})

Options Hash (options):

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#register_type(options = {}) ⇒ Types::RegisterTypeOutput

Registers a type with the CloudFormation service. Registering a type makes it available for use in CloudFormation templates in your AWS account, and includes:

  • Validating the resource schema

  • Determining which handlers have been specified for the resource

  • Making the resource type available for use in your account

For more information on how to develop types and ready them for registeration, see Creating Resource Providers in the CloudFormation CLI User Guide.

You can have a maximum of 50 resource type versions registered at a time. This maximum is per account and per region. Use DeregisterType to deregister specific resource type versions if necessary.

Once you have initiated a registration request using RegisterType , you can use DescribeTypeRegistration to monitor the progress of the registration request.

Examples:

Request syntax with placeholder values


resp = client.register_type({
  type: "RESOURCE", # accepts RESOURCE
  type_name: "TypeName", # required
  schema_handler_package: "S3Url", # required
  logging_config: {
    log_role_arn: "RoleArn", # required
    log_group_name: "LogGroupName", # required
  },
  execution_role_arn: "RoleArn",
  client_request_token: "RequestToken",
})

Response structure


resp.registration_token #=> String

Options Hash (options):

  • :type (String)

    The kind of type.

    Currently, the only valid value is RESOURCE.

  • :type_name (required, String)

    The name of the type being registered.

    We recommend that type names adhere to the following pattern: company_or_organization::service::type.

    The following organization namespaces are reserved and cannot be used in your resource type names:

    • Alexa

    • AMZN

    • Amazon

    • AWS

    • Custom

    • Dev

  • :schema_handler_package (required, String)

    A url to the S3 bucket containing the schema handler package that contains the schema, event handlers, and associated files for the type you want to register.

    For information on generating a schema handler package for the type you want to register, see submit in the CloudFormation CLI User Guide.

    The user registering the resource provider type must be able to access the the schema handler package in the S3 bucket. That is, the user needs to have GetObject permissions for the schema handler package. For more information, see Actions, Resources, and Condition Keys for Amazon S3 in the AWS Identity and Access Management User Guide.

  • :logging_config (Types::LoggingConfig)

    Specifies logging configuration information for a type.

  • :execution_role_arn (String)

    The Amazon Resource Name (ARN) of the IAM role for CloudFormation to assume when invoking the resource provider. If your resource type calls AWS APIs in any of its handlers, you must create an IAM execution role that includes the necessary permissions to call those AWS APIs, and provision that execution role in your account. When CloudFormation needs to invoke the resource provider handler, CloudFormation assumes this execution role to create a temporary session token, which it then passes to the resource provider handler, thereby supplying your resource provider with the appropriate credentials.

  • :client_request_token (String)

    A unique identifier that acts as an idempotency key for this registration request. Specifying a client request token prevents CloudFormation from generating more than one version of a type from the same registeration request, even if the request is submitted multiple times.

Returns:

See Also:

#set_stack_policy(options = {}) ⇒ Struct

Sets a stack policy for a specified stack.

Examples:

Request syntax with placeholder values


resp = client.set_stack_policy({
  stack_name: "StackName", # required
  stack_policy_body: "StackPolicyBody",
  stack_policy_url: "StackPolicyURL",
})

Options Hash (options):

  • :stack_name (required, String)

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

  • :stack_policy_body (String)

    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.

  • :stack_policy_url (String)

    Location of a file containing the stack policy. The URL must point to a policy (maximum size: 16 KB) 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:

  • (Struct)

    Returns an empty response.

See Also:

#set_type_default_version(options = {}) ⇒ Struct

Specify the default version of a type. The default version of a type will be used in CloudFormation operations.

Examples:

Request syntax with placeholder values


resp = client.set_type_default_version({
  arn: "PrivateTypeArn",
  type: "RESOURCE", # accepts RESOURCE
  type_name: "TypeName",
  version_id: "TypeVersionId",
})

Options Hash (options):

  • :arn (String)

    The Amazon Resource Name (ARN) of the type for which you want version summary information.

    Conditional: You must specify either TypeName and Type, or Arn.

  • :type (String)

    The kind of type.

    Conditional: You must specify either TypeName and Type, or Arn.

  • :type_name (String)

    The name of the type.

    Conditional: You must specify either TypeName and Type, or Arn.

  • :version_id (String)

    The ID of a specific version of the type. The version ID is the value at the end of the Amazon Resource Name (ARN) assigned to the type version when it is registered.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#signal_resource(options = {}) ⇒ Struct

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.

Examples:

Request syntax with placeholder values


resp = client.signal_resource({
  stack_name: "StackNameOrId", # required
  logical_resource_id: "LogicalResourceId", # required
  unique_id: "ResourceSignalUniqueId", # required
  status: "SUCCESS", # required, accepts SUCCESS, FAILURE
})

Options Hash (options):

  • :stack_name (required, String)

    The stack name or unique stack ID that includes the resource that you want to signal.

  • :logical_resource_id (required, String)

    The logical ID of the resource that you want to signal. The logical ID is the name of the resource that given in the template.

  • :unique_id (required, String)

    A unique ID of the signal. When you signal Amazon EC2 instances or Auto Scaling groups, specify the instance ID that you are signaling as the unique ID. If you send multiple signals to a single resource (such as signaling a wait condition), each signal requires a different unique ID.

  • :status (required, String)

    The status of the signal, which is either success or failure. A failure signal causes AWS CloudFormation to immediately fail the stack creation or update.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#stop_stack_set_operation(options = {}) ⇒ Struct

Stops an in-progress operation on a stack set and its associated stack instances.

Examples:

Request syntax with placeholder values


resp = client.stop_stack_set_operation({
  stack_set_name: "StackSetName", # required
  operation_id: "ClientRequestToken", # required
})

Options Hash (options):

  • :stack_set_name (required, String)

    The name or unique ID of the stack set that you want to stop the operation for.

  • :operation_id (required, String)

    The ID of the stack operation.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#update_stack(options = {}) ⇒ Types::UpdateStackOutput

Updates a stack as specified in the template. After the call completes successfully, the stack update starts. You can check the status of the stack via the DescribeStacks action.

To get a copy of the template for an existing stack, you can use the GetTemplate action.

For more information about creating an update template, updating a stack, and monitoring the progress of the update, see Updating a Stack.

Examples:

Request syntax with placeholder values


resp = client.update_stack({
  stack_name: "StackName", # required
  template_body: "TemplateBody",
  template_url: "TemplateURL",
  use_previous_template: false,
  stack_policy_during_update_body: "StackPolicyDuringUpdateBody",
  stack_policy_during_update_url: "StackPolicyDuringUpdateURL",
  parameters: [
    {
      parameter_key: "ParameterKey",
      parameter_value: "ParameterValue",
      use_previous_value: false,
      resolved_value: "ParameterValue",
    },
  ],
  capabilities: ["CAPABILITY_IAM"], # accepts CAPABILITY_IAM, CAPABILITY_NAMED_IAM, CAPABILITY_AUTO_EXPAND
  resource_types: ["ResourceType"],
  role_arn: "RoleARN",
  rollback_configuration: {
    rollback_triggers: [
      {
        arn: "Arn", # required
        type: "Type", # required
      },
    ],
    monitoring_time_in_minutes: 1,
  },
  stack_policy_body: "StackPolicyBody",
  stack_policy_url: "StackPolicyURL",
  notification_arns: ["NotificationARN"],
  tags: [
    {
      key: "TagKey", # required
      value: "TagValue", # required
    },
  ],
  client_request_token: "ClientRequestToken",
})

Response structure


resp.stack_id #=> String

Options Hash (options):

  • :stack_name (required, String)

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

  • :template_body (String)

    Structure containing the template body with a minimum length of 1 byte and a maximum length of 51,200 bytes. (For more information, go to Template Anatomy in the AWS CloudFormation User Guide.)

    Conditional: You must specify only one of the following parameters: TemplateBody, TemplateURL, or set the UsePreviousTemplate to true.

  • :template_url (String)

    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 only one of the following parameters: TemplateBody, TemplateURL, or set the UsePreviousTemplate to true.

  • :use_previous_template (Boolean)

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

    Conditional: You must specify only one of the following parameters: TemplateBody, TemplateURL, or set the UsePreviousTemplate to true.

  • :stack_policy_during_update_body (String)

    Structure containing the temporary overriding stack policy body. You can specify either the StackPolicyDuringUpdateBody or the StackPolicyDuringUpdateURL parameter, but not both.

    If you want to update protected resources, specify a temporary overriding stack policy during this update. If you do not specify a stack policy, the current policy that is associated with the stack will be used.

  • :stack_policy_during_update_url (String)

    Location of a file containing the temporary overriding stack policy. The URL must point to a policy (max size: 16KB) located in an S3 bucket in the same Region as the stack. You can specify either the StackPolicyDuringUpdateBody or the StackPolicyDuringUpdateURL parameter, but not both.

    If you want to update protected resources, specify a temporary overriding stack policy during this update. If you do not specify a stack policy, the current policy that is associated with the stack will be used.

  • :parameters (Array<Types::Parameter>)

    A list of Parameter structures that specify input parameters for the stack. For more information, see the Parameter data type.

  • :capabilities (Array<String>)

    In some cases, you must explicitly acknowledge that your stack template contains certain capabilities in order for AWS CloudFormation to update the stack.

    • CAPABILITY_IAM and CAPABILITY_NAMED_IAM

      Some stack templates might include resources that can affect permissions in your AWS account; for example, by creating new AWS Identity and Access Management (IAM) users. For those stacks, you must explicitly acknowledge this by specifying one of these capabilities.

      The following IAM resources require you to specify either the CAPABILITY_IAM or CAPABILITY_NAMED_IAM capability.

      • If you have IAM resources, you can specify either capability.

      • If you have IAM resources with custom names, you must specify CAPABILITY_NAMED_IAM.

      • If you don\'t specify either of these capabilities, AWS CloudFormation returns an InsufficientCapabilities error.

      If your stack template contains these resources, we recommend that you review all permissions associated with them and edit their permissions if necessary.

      For more information, see Acknowledging IAM Resources in AWS CloudFormation Templates.

    • CAPABILITY_AUTO_EXPAND

      Some template contain macros. Macros perform custom processing on templates; this can include simple actions like find-and-replace operations, all the way to extensive transformations of entire templates. Because of this, users typically create a change set from the processed template, so that they can review the changes resulting from the macros before actually updating the stack. If your stack template contains one or more macros, and you choose to update a stack directly from the processed template, without first reviewing the resulting changes in a change set, you must acknowledge this capability. This includes the AWS::Include and AWS::Serverless transforms, which are macros hosted by AWS CloudFormation.

      If you want to update a stack from a stack template that contains macros and nested stacks, you must update the stack directly from the template using this capability.

      You should only update stacks directly from a stack template that contains macros if you know what processing the macro performs.

      Each macro relies on an underlying Lambda service function for processing stack templates. Be aware that the Lambda function owner can update the function operation without AWS CloudFormation being notified.

      For more information, see Using AWS CloudFormation Macros to Perform Custom Processing on Templates.

  • :resource_types (Array<String>)

    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.

  • :role_arn (String)

    The Amazon Resource Name (ARN) of an AWS Identity and Access Management (IAM) role that AWS CloudFormation assumes to update the stack. AWS CloudFormation uses the role\'s credentials to make calls on your behalf. AWS CloudFormation always uses this role for all future operations on the stack. As long as users have permission to operate on the stack, AWS CloudFormation uses this role even if the users don\'t have permission to pass it. Ensure that the role grants least privilege.

    If you don\'t specify a value, AWS CloudFormation uses the role that was previously associated with the stack. If no role is available, AWS CloudFormation uses a temporary session that is generated from your user credentials.

  • :rollback_configuration (Types::RollbackConfiguration)

    The rollback triggers for AWS CloudFormation to monitor during stack creation and updating operations, and for the specified monitoring period afterwards.

  • :stack_policy_body (String)

    Structure containing a new stack policy body. You can specify either the StackPolicyBody or the StackPolicyURL parameter, but not both.

    You might update the stack policy, for example, in order to protect a new resource that you created during a stack update. If you do not specify a stack policy, the current policy that is associated with the stack is unchanged.

  • :stack_policy_url (String)

    Location of a file containing the updated stack policy. The URL must point to a policy (max size: 16KB) located in an S3 bucket in the same Region as the stack. You can specify either the StackPolicyBody or the StackPolicyURL parameter, but not both.

    You might update the stack policy, for example, in order to protect a new resource that you created during a stack update. If you do not specify a stack policy, the current policy that is associated with the stack is unchanged.

  • :notification_arns (Array<String>)

    Amazon Simple Notification Service topic Amazon Resource Names (ARNs) that AWS CloudFormation associates with the stack. Specify an empty list to remove all notification topics.

  • :tags (Array<Types::Tag>)

    Key-value pairs to associate with this stack. AWS CloudFormation also propagates these tags to supported resources in the stack. You can specify a maximum number of 50 tags.

    If you don\'t specify this parameter, AWS CloudFormation doesn\'t modify the stack\'s tags. If you specify an empty value, AWS CloudFormation removes all associated tags.

  • :client_request_token (String)

    A unique identifier for this UpdateStack request. Specify this token if you plan to retry requests so that AWS CloudFormation knows that you\'re not attempting to update a stack with the same name. You might retry UpdateStack requests to ensure that AWS CloudFormation successfully received them.

    All events triggered by a given stack operation are assigned the same client request token, which you can use to track operations. For example, if you execute a CreateStack operation with the token token1, then all the StackEvents generated by that operation will have ClientRequestToken set as token1.

    In the console, stack operations display the client request token on the Events tab. Stack operations that are initiated from the console use the token format Console-StackOperation-ID, which helps you easily identify the stack operation . For example, if you create a stack using the console, each stack event would be assigned the same token in the following format: Console-CreateStack-7f59c3cf-00d2-40c7-b2ff-e75db0987002.

Returns:

See Also:

#update_stack_instances(options = {}) ⇒ Types::UpdateStackInstancesOutput

Updates the parameter values for stack instances for the specified accounts, within the specified Regions. A stack instance refers to a stack in a specific account and Region.

You can only update stack instances in Regions and accounts where they already exist; to create additional stack instances, use CreateStackInstances.

During stack set updates, any parameters overridden for a stack instance are not updated, but retain their overridden value.

You can only update the parameter values that are specified in the stack set; to add or delete a parameter itself, use UpdateStackSet to update the stack set template. If you add a parameter to a template, before you can override the parameter value specified in the stack set you must first use UpdateStackSet to update all stack instances with the updated template and parameter value specified in the stack set. Once a stack instance has been updated with the new parameter, you can then override the parameter value using UpdateStackInstances.

Examples:

Request syntax with placeholder values


resp = client.update_stack_instances({
  stack_set_name: "StackSetNameOrId", # required
  accounts: ["Account"],
  deployment_targets: {
    accounts: ["Account"],
    organizational_unit_ids: ["OrganizationalUnitId"],
  },
  regions: ["Region"], # required
  parameter_overrides: [
    {
      parameter_key: "ParameterKey",
      parameter_value: "ParameterValue",
      use_previous_value: false,
      resolved_value: "ParameterValue",
    },
  ],
  operation_preferences: {
    region_order: ["Region"],
    failure_tolerance_count: 1,
    failure_tolerance_percentage: 1,
    max_concurrent_count: 1,
    max_concurrent_percentage: 1,
  },
  operation_id: "ClientRequestToken",
})

Response structure


resp.operation_id #=> String

Options Hash (options):

  • :stack_set_name (required, String)

    The name or unique ID of the stack set associated with the stack instances.

  • :accounts (Array<String>)

    [Self-managed permissions] The names of one or more AWS accounts for which you want to update parameter values for stack instances. The overridden parameter values will be applied to all stack instances in the specified accounts and Regions.

    You can specify Accounts or DeploymentTargets, but not both.

  • :deployment_targets (Types::DeploymentTargets)

    [Service-managed permissions] The AWS Organizations accounts for which you want to update parameter values for stack instances. If your update targets OUs, the overridden parameter values only apply to the accounts that are currently in the target OUs and their child OUs. Accounts added to the target OUs and their child OUs in the future won\'t use the overridden values.

    You can specify Accounts or DeploymentTargets, but not both.

  • :regions (required, Array<String>)

    The names of one or more Regions in which you want to update parameter values for stack instances. The overridden parameter values will be applied to all stack instances in the specified accounts and Regions.

  • :parameter_overrides (Array<Types::Parameter>)

    A list of input parameters whose values you want to update for the specified stack instances.

    Any overridden parameter values will be applied to all stack instances in the specified accounts and Regions. When specifying parameters and their values, be aware of how AWS CloudFormation sets parameter values during stack instance update operations:

    • To override the current value for a parameter, include the parameter and specify its value.

    • To leave a parameter set to its present value, you can do one of the following:

      • Do not include the parameter in the list.

      • Include the parameter and specify UsePreviousValue as true. (You cannot specify both a value and set UsePreviousValue to true.)

    • To set all overridden parameter back to the values specified in the stack set, specify a parameter list but do not include any parameters.

    • To leave all parameters set to their present values, do not specify this property at all.

    During stack set updates, any parameter values overridden for a stack instance are not updated, but retain their overridden value.

    You can only override the parameter values that are specified in the stack set; to add or delete a parameter itself, use UpdateStackSet to update the stack set template. If you add a parameter to a template, before you can override the parameter value specified in the stack set you must first use UpdateStackSet to update all stack instances with the updated template and parameter value specified in the stack set. Once a stack instance has been updated with the new parameter, you can then override the parameter value using UpdateStackInstances.

  • :operation_preferences (Types::StackSetOperationPreferences)

    Preferences for how AWS CloudFormation performs this stack set operation.

  • :operation_id (String)

    This parameter will be auto-filled on your behalf with a random UUIDv4 when no value is provided. The unique identifier for this stack set operation.

    The operation ID also functions as an idempotency token, to ensure that AWS CloudFormation performs the stack set operation only once, even if you retry the request multiple times. You might retry stack set operation requests to ensure that AWS CloudFormation successfully received them.

    If you don\'t specify an operation ID, the SDK generates one automatically.

Returns:

See Also:

#update_stack_set(options = {}) ⇒ Types::UpdateStackSetOutput

Updates the stack set, and associated stack instances in the specified accounts and Regions.

Even if the stack set operation created by updating the stack set fails (completely or partially, below or above a specified failure tolerance), the stack set is updated with your changes. Subsequent CreateStackInstances calls on the specified stack set use the updated stack set.

Examples:

Request syntax with placeholder values


resp = client.update_stack_set({
  stack_set_name: "StackSetName", # required
  description: "Description",
  template_body: "TemplateBody",
  template_url: "TemplateURL",
  use_previous_template: false,
  parameters: [
    {
      parameter_key: "ParameterKey",
      parameter_value: "ParameterValue",
      use_previous_value: false,
      resolved_value: "ParameterValue",
    },
  ],
  capabilities: ["CAPABILITY_IAM"], # accepts CAPABILITY_IAM, CAPABILITY_NAMED_IAM, CAPABILITY_AUTO_EXPAND
  tags: [
    {
      key: "TagKey", # required
      value: "TagValue", # required
    },
  ],
  operation_preferences: {
    region_order: ["Region"],
    failure_tolerance_count: 1,
    failure_tolerance_percentage: 1,
    max_concurrent_count: 1,
    max_concurrent_percentage: 1,
  },
  administration_role_arn: "RoleARN",
  execution_role_name: "ExecutionRoleName",
  deployment_targets: {
    accounts: ["Account"],
    organizational_unit_ids: ["OrganizationalUnitId"],
  },
  permission_model: "SERVICE_MANAGED", # accepts SERVICE_MANAGED, SELF_MANAGED
  auto_deployment: {
    enabled: false,
    retain_stacks_on_account_removal: false,
  },
  operation_id: "ClientRequestToken",
  accounts: ["Account"],
  regions: ["Region"],
})

Response structure


resp.operation_id #=> String

Options Hash (options):

  • :stack_set_name (required, String)

    The name or unique ID of the stack set that you want to update.

  • :description (String)

    A brief description of updates that you are making.

  • :template_body (String)

    The structure that contains the template body, with a minimum length of 1 byte and a maximum length of 51,200 bytes. For more information, see Template Anatomy in the AWS CloudFormation User Guide.

    Conditional: You must specify only one of the following parameters: TemplateBody or TemplateURL—or set UsePreviousTemplate to true.

  • :template_url (String)

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

    Conditional: You must specify only one of the following parameters: TemplateBody or TemplateURL—or set UsePreviousTemplate to true.

  • :use_previous_template (Boolean)

    Use the existing template that\'s associated with the stack set that you\'re updating.

    Conditional: You must specify only one of the following parameters: TemplateBody or TemplateURL—or set UsePreviousTemplate to true.

  • :parameters (Array<Types::Parameter>)

    A list of input parameters for the stack set template.

  • :capabilities (Array<String>)

    In some cases, you must explicitly acknowledge that your stack template contains certain capabilities in order for AWS CloudFormation to update the stack set and its associated stack instances.

    • CAPABILITY_IAM and CAPABILITY_NAMED_IAM

      Some stack templates might include resources that can affect permissions in your AWS account; for example, by creating new AWS Identity and Access Management (IAM) users. For those stacks sets, you must explicitly acknowledge this by specifying one of these capabilities.

      The following IAM resources require you to specify either the CAPABILITY_IAM or CAPABILITY_NAMED_IAM capability.

      • If you have IAM resources, you can specify either capability.

      • If you have IAM resources with custom names, you must specify CAPABILITY_NAMED_IAM.

      • If you don\'t specify either of these capabilities, AWS CloudFormation returns an InsufficientCapabilities error.

      If your stack template contains these resources, we recommend that you review all permissions associated with them and edit their permissions if necessary.

      For more information, see Acknowledging IAM Resources in AWS CloudFormation Templates.

    • CAPABILITY_AUTO_EXPAND

      Some templates contain macros. If your stack template contains one or more macros, and you choose to update a stack directly from the processed template, without first reviewing the resulting changes in a change set, you must acknowledge this capability. For more information, see Using AWS CloudFormation Macros to Perform Custom Processing on Templates.

      Stack sets do not currently support macros in stack templates. (This includes the AWS::Include and AWS::Serverless transforms, which are macros hosted by AWS CloudFormation.) Even if you specify this capability, if you include a macro in your template the stack set operation will fail.

  • :tags (Array<Types::Tag>)

    The key-value pairs to associate with this stack set and the stacks created from it. AWS CloudFormation also propagates these tags to supported resources that are created in the stacks. You can specify a maximum number of 50 tags.

    If you specify tags for this parameter, those tags replace any list of tags that are currently associated with this stack set. This means:

    • If you don\'t specify this parameter, AWS CloudFormation doesn\'t modify the stack\'s tags.

    • If you specify any tags using this parameter, you must specify all the tags that you want associated with this stack set, even tags you\'ve specifed before (for example, when creating the stack set or during a previous update of the stack set.). Any tags that you don\'t include in the updated list of tags are removed from the stack set, and therefore from the stacks and resources as well.

    • If you specify an empty value, AWS CloudFormation removes all currently associated tags.

    If you specify new tags as part of an UpdateStackSet action, AWS CloudFormation checks to see if you have the required IAM permission to tag resources. If you omit tags that are currently associated with the stack set from the list of tags you specify, AWS CloudFormation assumes that you want to remove those tags from the stack set, and checks to see if you have permission to untag resources. If you don\'t have the necessary permission(s), the entire UpdateStackSet action fails with an access denied error, and the stack set is not updated.

  • :operation_preferences (Types::StackSetOperationPreferences)

    Preferences for how AWS CloudFormation performs this stack set operation.

  • :administration_role_arn (String)

    The Amazon Resource Number (ARN) of the IAM role to use to update this stack set.

    Specify an IAM role only if you are using customized administrator roles to control which users or groups can manage specific stack sets within the same administrator account. For more information, see Granting Permissions for Stack Set Operations in the AWS CloudFormation User Guide.

    If you specified a customized administrator role when you created the stack set, you must specify a customized administrator role, even if it is the same customized administrator role used with this stack set previously.

  • :execution_role_name (String)

    The name of the IAM execution role to use to update the stack set. If you do not specify an execution role, AWS CloudFormation uses the AWSCloudFormationStackSetExecutionRole role for the stack set operation.

    Specify an IAM role only if you are using customized execution roles to control which stack resources users and groups can include in their stack sets.

    If you specify a customized execution role, AWS CloudFormation uses that role to update the stack. If you do not specify a customized execution role, AWS CloudFormation performs the update using the role previously associated with the stack set, so long as you have permissions to perform operations on the stack set.

  • :deployment_targets (Types::DeploymentTargets)

    [Service-managed permissions] The AWS Organizations accounts in which to update associated stack instances.

    To update all the stack instances associated with this stack set, do not specify DeploymentTargets or Regions.

    If the stack set update includes changes to the template (that is, if TemplateBody or TemplateURL is specified), or the Parameters, AWS CloudFormation marks all stack instances with a status of OUTDATED prior to updating the stack instances in the specified accounts and Regions. If the stack set update does not include changes to the template or parameters, AWS CloudFormation updates the stack instances in the specified accounts and Regions, while leaving all other stack instances with their existing stack instance status.

  • :permission_model (String)

    Describes how the IAM roles required for stack set operations are created. You cannot modify PermissionModel if there are stack instances associated with your stack set.

  • :auto_deployment (Types::AutoDeployment)

    [Service-managed permissions] Describes whether StackSets automatically deploys to AWS Organizations accounts that are added to a target organization or organizational unit (OU).

    If you specify AutoDeployment, do not specify DeploymentTargets or Regions.

  • :operation_id (String)

    This parameter will be auto-filled on your behalf with a random UUIDv4 when no value is provided. The unique ID for this stack set operation.

    The operation ID also functions as an idempotency token, to ensure that AWS CloudFormation performs the stack set operation only once, even if you retry the request multiple times. You might retry stack set operation requests to ensure that AWS CloudFormation successfully received them.

    If you don\'t specify an operation ID, AWS CloudFormation generates one automatically.

    Repeating this stack set operation with a new operation ID retries all stack instances whose status is OUTDATED.

  • :accounts (Array<String>)

    [Self-managed permissions] The accounts in which to update associated stack instances. If you specify accounts, you must also specify the Regions in which to update stack set instances.

    To update all the stack instances associated with this stack set, do not specify the Accounts or Regions properties.

    If the stack set update includes changes to the template (that is, if the TemplateBody or TemplateURL properties are specified), or the Parameters property, AWS CloudFormation marks all stack instances with a status of OUTDATED prior to updating the stack instances in the specified accounts and Regions. If the stack set update does not include changes to the template or parameters, AWS CloudFormation updates the stack instances in the specified accounts and Regions, while leaving all other stack instances with their existing stack instance status.

  • :regions (Array<String>)

    The Regions in which to update associated stack instances. If you specify Regions, you must also specify accounts in which to update stack set instances.

    To update all the stack instances associated with this stack set, do not specify the Accounts or Regions properties.

    If the stack set update includes changes to the template (that is, if the TemplateBody or TemplateURL properties are specified), or the Parameters property, AWS CloudFormation marks all stack instances with a status of OUTDATED prior to updating the stack instances in the specified accounts and Regions. If the stack set update does not include changes to the template or parameters, AWS CloudFormation updates the stack instances in the specified accounts and Regions, while leaving all other stack instances with their existing stack instance status.

Returns:

See Also:

#update_termination_protection(options = {}) ⇒ Types::UpdateTerminationProtectionOutput

Updates termination protection for the specified stack. If a user attempts to delete a stack with termination protection enabled, the operation fails and the stack remains unchanged. For more information, see Protecting a Stack From Being Deleted in the AWS CloudFormation User Guide.

For nested stacks, termination protection is set on the root stack and cannot be changed directly on the nested stack.

Examples:

Request syntax with placeholder values


resp = client.update_termination_protection({
  enable_termination_protection: false, # required
  stack_name: "StackNameOrId", # required
})

Response structure


resp.stack_id #=> String

Options Hash (options):

  • :enable_termination_protection (required, Boolean)

    Whether to enable termination protection on the specified stack.

  • :stack_name (required, String)

    The name or unique ID of the stack for which you want to set termination protection.

Returns:

See Also:

#validate_template(options = {}) ⇒ Types::ValidateTemplateOutput

Validates a specified template. AWS CloudFormation first checks if the template is valid JSON. If it isn't, AWS CloudFormation checks if the template is valid YAML. If both these checks fail, AWS CloudFormation returns a template validation error.

Examples:

Request syntax with placeholder values


resp = client.validate_template({
  template_body: "TemplateBody",
  template_url: "TemplateURL",
})

Response structure


resp.parameters #=> Array
resp.parameters[0].parameter_key #=> String
resp.parameters[0].default_value #=> String
resp.parameters[0].no_echo #=> true/false
resp.parameters[0].description #=> String
resp.description #=> String
resp.capabilities #=> Array
resp.capabilities[0] #=> String, one of "CAPABILITY_IAM", "CAPABILITY_NAMED_IAM", "CAPABILITY_AUTO_EXPAND"
resp.capabilities_reason #=> String
resp.declared_transforms #=> Array
resp.declared_transforms[0] #=> String

Options Hash (options):

  • :template_body (String)

    Structure containing the template body with a minimum length of 1 byte and a maximum length of 51,200 bytes. For more information, go to Template Anatomy in the AWS CloudFormation User Guide.

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

  • :template_url (String)

    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 Template Anatomy in the AWS CloudFormation User Guide.

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

Returns:

See Also:

#wait_until(waiter_name, params = {}) {|waiter| ... } ⇒ Boolean

Waiters polls an API operation until a resource enters a desired state.

Basic Usage

Waiters will poll until they are succesful, they fail by entering a terminal state, or until a maximum number of attempts are made.

# polls in a loop, sleeping between attempts client.waiter_until(waiter_name, params)

Configuration

You can configure the maximum number of polling attempts, and the delay (in seconds) between each polling attempt. You configure waiters by passing a block to #wait_until:

# poll for ~25 seconds
client.wait_until(...) do |w|
  w.max_attempts = 5
  w.delay = 5
end

Callbacks

You can be notified before each polling attempt and before each delay. If you throw :success or :failure from these callbacks, it will terminate the waiter.

started_at = Time.now
client.wait_until(...) do |w|

  # disable max attempts
  w.max_attempts = nil

  # poll for 1 hour, instead of a number of attempts
  w.before_wait do |attempts, response|
    throw :failure if Time.now - started_at > 3600
  end

end

Handling Errors

When a waiter is successful, it returns true. When a waiter fails, it raises an error. All errors raised extend from Waiters::Errors::WaiterFailed.

begin
  client.wait_until(...)
rescue Aws::Waiters::Errors::WaiterFailed
  # resource did not enter the desired state in time
end

Parameters:

  • waiter_name (Symbol)

    The name of the waiter. See #waiter_names for a full list of supported waiters.

  • params (Hash) (defaults to: {})

    Additional request parameters. See the #waiter_names for a list of supported waiters and what request they call. The called request determines the list of accepted parameters.

Yield Parameters:

Returns:

  • (Boolean)

    Returns true if the waiter was successful.

Raises:

  • (Errors::FailureStateError)

    Raised when the waiter terminates because the waiter has entered a state that it will not transition out of, preventing success.

  • (Errors::TooManyAttemptsError)

    Raised when the configured maximum number of attempts have been made, and the waiter is not yet successful.

  • (Errors::UnexpectedError)

    Raised when an error is encounted while polling for a resource that is not expected.

  • (Errors::NoSuchWaiterError)

    Raised when you request to wait for an unknown state.

#waiter_namesArray<Symbol>

Returns the list of supported waiters. The following table lists the supported waiters and the client method they call:

Waiter NameClient MethodDefault Delay:Default Max Attempts:
:change_set_create_complete#describe_change_set30120
:stack_create_complete#describe_stacks30120
:stack_delete_complete#describe_stacks30120
:stack_exists#describe_stacks520
:stack_import_complete#describe_stacks30120
:stack_rollback_complete#describe_stacks30120
:stack_update_complete#describe_stacks30120
:type_registration_complete#describe_type_registration30120

Returns:

  • (Array<Symbol>)

    the list of supported waiters.