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

Class: AWS::CloudFormation::Client

Inherits:
AWS::Core::QueryClient show all
Defined in:
lib/aws/cloud_formation/client.rb

Overview

Client class for AWS CloudFormation.

Direct Known Subclasses

V20100515

Defined Under Namespace

Classes: V20100515

Constant Summary

API_VERSION =
'2010-05-15'

Instance Attribute Summary

Attributes inherited from AWS::Core::Client

#config

Instance Method Summary collapse

Methods inherited from AWS::Core::Client

#initialize, #log_warning, #operations, #with_http_handler, #with_options

Constructor Details

This class inherits a constructor from AWS::Core::Client

Instance Method Details

#cancel_update_stack(options = {}) ⇒ Core::Response

Calls the CancelUpdateStack API operation.

Parameters:

  • options (Hash) (defaults to: {})
    • :stack_name - required - (String) The name or the unique identifier associated with the stack.

Returns:

#create_stack(options = {}) ⇒ Core::Response

Calls the CreateStack API operation.

Parameters:

  • options (Hash) (defaults to: {})
    • :stack_name - required - (String) The name associated with the stack. The name must be unique within your AWS account. Must contain only alphanumeric characters (case sensitive) and start with an alpha character. Maximum length of the name is 255 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: 307,200 bytes) located in an S3 bucket in the same region as the stack. For more information, go to the Template Anatomy in the AWS CloudFormation User Guide. Conditional: You must specify either the TemplateBody or the TemplateURL parameter, but not both.
    • :parameters - (Array<) A list of Parameter structures that specify input parameters for the stack.
      • :parameter_key - (String) The key associated with the parameter.
      • :parameter_value - (String) The value associated with the parameter.
      • :use_previous_value - (Boolean) During a stack update, use the existing parameter value that is being used for the stack.
    • :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
    • :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<) 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<) The list of capabilities that you want to allow in the stack. If your template contains certain resources, you must specify the CAPABILITY_IAM value for this parameter; otherwise, this action returns an InsufficientCapabilities error. The following resources require you to specify the capabilities parameter: AWS::CloudFormation::Stack, AWS::IAM::AccessKey, AWS::IAM::Group, AWS::IAM::InstanceProfile, AWS::IAM::Policy, AWS::IAM::Role, AWS::IAM::User, and AWS::IAM::UserToGroupAddition.
    • :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 Valid values include:
      • DO_NOTHING
      • ROLLBACK
      • DELETE
    • :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 (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.
    • :tags - (Array<) A set of user-defined Tags to associate with this stack, represented by key/value pairs. Tags defined for the stack are propagated to EC2 resources that are created as part of the stack. A maximum number of 10 tags can be specified.
      • :key - (String) Required. A string used to identify this tag. You can specify a maximum of 128 characters for a tag key. Tags owned by Amazon Web Services (AWS) have the reserved prefix: aws:.
      • :value - (String) Required. A string containing the value for this tag. You can specify a maximum of 256 characters for a tag value.

Returns:

  • (Core::Response)

    The #data method of the response object returns a hash with the following structure:

    • :stack_id - (String)

#delete_stack(options = {}) ⇒ Core::Response

Calls the DeleteStack API operation.

Parameters:

  • options (Hash) (defaults to: {})
    • :stack_name - required - (String) The name or the unique identifier associated with the stack.

Returns:

#describe_stack_events(options = {}) ⇒ Core::Response

Calls the DescribeStackEvents API operation.

Parameters:

  • options (Hash) (defaults to: {})
    • :stack_name - (String) The name or the unique identifier associated with the stack, which are not always interchangeable: Running stacks: You can specify either the stack's name or its unique stack ID. Deleted stacks: You must specify the unique stack ID. Default: There is no default value.
    • :next_token - (String) String that identifies the start of the next list of events, if there is one. Default: There is no default value.

Returns:

  • (Core::Response)

    The #data method of the response object returns a hash with the following structure:

    • :stack_events - (Array)
      • :stack_id - (String)
      • :event_id - (String)
      • :stack_name - (String)
      • :logical_resource_id - (String)
      • :physical_resource_id - (String)
      • :resource_type - (String)
      • :timestamp - (Time)
      • :resource_status - (String)
      • :resource_status_reason - (String)
      • :resource_properties - (String)
    • :next_token - (String)

#describe_stack_resource(options = {}) ⇒ Core::Response

Calls the DescribeStackResource API operation.

Parameters:

  • options (Hash) (defaults to: {})
    • :stack_name - required - (String) The name or the unique identifier associated with the stack, which are not always interchangeable: Running stacks: You can specify either the stack's name or its unique stack ID. Deleted stacks: You must specify the unique stack ID. Default: There is no default value.
    • :logical_resource_id - required - (String) The logical name of the resource as specified in the template. Default: There is no default value.

Returns:

  • (Core::Response)

    The #data method of the response object returns a hash with the following structure:

    • :stack_resource_detail - (Hash)
      • :stack_name - (String)
      • :stack_id - (String)
      • :logical_resource_id - (String)
      • :physical_resource_id - (String)
      • :resource_type - (String)
      • :last_updated_timestamp - (Time)
      • :resource_status - (String)
      • :resource_status_reason - (String)
      • :description - (String)
      • :metadata - (String)

#describe_stack_resources(options = {}) ⇒ Core::Response

Calls the DescribeStackResources API operation.

Parameters:

  • options (Hash) (defaults to: {})
    • :stack_name - (String) The name or the unique identifier associated with the stack, which are not always interchangeable: Running stacks: You can specify either the stack's name or its unique stack ID. Deleted stacks: You must specify the unique stack ID. Default: There is no default value. Required: Conditional. If you do not specify StackName, you must specify PhysicalResourceId.
    • :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:

  • (Core::Response)

    The #data method of the response object returns a hash with the following structure:

    • :stack_resources - (Array)
      • :stack_name - (String)
      • :stack_id - (String)
      • :logical_resource_id - (String)
      • :physical_resource_id - (String)
      • :resource_type - (String)
      • :timestamp - (Time)
      • :resource_status - (String)
      • :resource_status_reason - (String)
      • :description - (String)

#describe_stacks(options = {}) ⇒ Core::Response

Calls the DescribeStacks API operation.

Parameters:

  • options (Hash) (defaults to: {})
    • :stack_name - (String) The name or the unique identifier associated with the stack, which are not always interchangeable: Running stacks: You can specify either the stack's name or its unique stack ID. Deleted stacks: You must specify the unique stack ID. Default: There is no default value.
    • :next_token - (String) String that identifies the start of the next list of stacks, if there is one.

Returns:

  • (Core::Response)

    The #data method of the response object returns a hash with the following structure:

    • :stacks - (Array)
      • :stack_id - (String)
      • :stack_name - (String)
      • :description - (String)
      • :parameters - (Array)
        • :parameter_key - (String)
        • :parameter_value - (String)
        • :use_previous_value - (Boolean)
      • :creation_time - (Time)
      • :last_updated_time - (Time)
      • :stack_status - (String)
      • :stack_status_reason - (String)
      • :disable_rollback - (Boolean)
      • :notification_arns - (Array)
      • :timeout_in_minutes - (Integer)
      • :capabilities - (Array)
      • :outputs - (Array)
        • :output_key - (String)
        • :output_value - (String)
        • :description - (String)
      • :tags - (Array)
        • :key - (String)
        • :value - (String)
    • :next_token - (String)

#estimate_template_cost(options = {}) ⇒ Core::Response

Calls the EstimateTemplateCost API operation.

Parameters:

  • options (Hash) (defaults to: {})
    • :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 located in an S3 bucket in the same region as the stack. For more information, go to Template Anatomy in the AWS CloudFormation User Guide. Conditional: You must pass TemplateURL or TemplateBody. If both are passed, only TemplateBody is used.
    • :parameters - (Array<) A list of Parameter structures that specify input parameters.
      • :parameter_key - (String) The key associated with the parameter.
      • :parameter_value - (String) The value associated with the parameter.
      • :use_previous_value - (Boolean) During a stack update, use the existing parameter value that is being used for the stack.

Returns:

  • (Core::Response)

    The #data method of the response object returns a hash with the following structure:

    • :url - (String)

#get_stack_policy(options = {}) ⇒ Core::Response

Calls the GetStackPolicy API operation.

Parameters:

  • options (Hash) (defaults to: {})
    • :stack_name - required - (String) The name or stack ID that is associated with the stack whose policy you want to get.

Returns:

  • (Core::Response)

    The #data method of the response object returns a hash with the following structure:

    • :stack_policy_body - (String)

#get_template(options = {}) ⇒ Core::Response

Calls the GetTemplate API operation.

Parameters:

  • options (Hash) (defaults to: {})
    • :stack_name - required - (String) The name or the unique identifier associated with the stack, which are not always interchangeable: Running stacks: You can specify either the stack's name or its unique stack ID. Deleted stacks: You must specify the unique stack ID. Default: There is no default value.

Returns:

  • (Core::Response)

    The #data method of the response object returns a hash with the following structure:

    • :template_body - (String)

#list_stack_resources(options = {}) ⇒ Core::Response

Calls the ListStackResources API operation.

Parameters:

  • options (Hash) (defaults to: {})
    • :stack_name - required - (String) The name or the unique identifier associated with the stack, which are not always interchangeable: Running stacks: You can specify either the stack's name or its unique stack ID. Deleted stacks: You must specify the unique stack ID. Default: There is no default value.
    • :next_token - (String) String that identifies the start of the next list of stack resource summaries, if there is one. Default: There is no default value.

Returns:

  • (Core::Response)

    The #data method of the response object returns a hash with the following structure:

    • :stack_resource_summaries - (Array)
      • :logical_resource_id - (String)
      • :physical_resource_id - (String)
      • :resource_type - (String)
      • :last_updated_timestamp - (Time)
      • :resource_status - (String)
      • :resource_status_reason - (String)
    • :next_token - (String)

#list_stacks(options = {}) ⇒ Core::Response

Calls the ListStacks API operation.

Parameters:

  • options (Hash) (defaults to: {})
    • :next_token - (String) String that identifies the start of the next list of stacks, if there is one. Default: There is no default value.
    • :stack_status_filter - (Array<) 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:

  • (Core::Response)

    The #data method of the response object returns a hash with the following structure:

    • :stack_summaries - (Array)
      • :stack_id - (String)
      • :stack_name - (String)
      • :template_description - (String)
      • :creation_time - (Time)
      • :last_updated_time - (Time)
      • :deletion_time - (Time)
      • :stack_status - (String)
      • :stack_status_reason - (String)
    • :next_token - (String)

#set_stack_policy(options = {}) ⇒ Core::Response

Calls the SetStackPolicy API operation.

Parameters:

  • options (Hash) (defaults to: {})
    • :stack_name - required - (String) The name or 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 (max size: 16KB) located in an S3 bucket in the same region as the stack. You can specify either the StackPolicyBody or the StackPolicyURL parameter, but not both.

Returns:

#update_stack(options = {}) ⇒ Core::Response

Calls the UpdateStack API operation.

Parameters:

  • options (Hash) (defaults to: {})
    • :stack_name - required - (String) The name or stack ID of the stack to update. Must contain only alphanumeric characters (case sensitive) and start with an alpha character. Maximum length of the name is 255 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 located in an S3 bucket in the same region as the stack. For more information, go to Template Anatomy in the AWS CloudFormation User Guide. Conditional: You must specify either the TemplateBody or the TemplateURL parameter, but not both.
    • :use_previous_template - (Boolean) Reuse the existing template that is associated with the stack that you are updating.
    • :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<) A list of Parameter structures that specify input parameters for the stack.
      • :parameter_key - (String) The key associated with the parameter.
      • :parameter_value - (String) The value associated with the parameter.
      • :use_previous_value - (Boolean) During a stack update, use the existing parameter value that is being used for the stack.
    • :capabilities - (Array<) The list of capabilities that you want to allow in the stack. If your stack contains IAM resources, you must specify the CAPABILITY_IAM value for this parameter; otherwise, this action returns an InsufficientCapabilities error. IAM resources are the following: AWS::IAM::AccessKey, AWS::IAM::Group, AWS::IAM::Policy, AWS::IAM::User, and AWS::IAM::UserToGroupAddition.
    • :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<) Update the ARNs for the Amazon SNS topics that are associated with the stack.

Returns:

  • (Core::Response)

    The #data method of the response object returns a hash with the following structure:

    • :stack_id - (String)

#validate_template(options = {}) ⇒ Core::Response

Calls the ValidateTemplate API operation.

Parameters:

  • options (Hash) (defaults to: {})
    • :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: 307,200 bytes) located in an S3 bucket in the same region as the stack. For more information, go to Template Anatomy in the AWS CloudFormation User Guide. Conditional: You must pass TemplateURL or TemplateBody. If both are passed, only TemplateBody is used.

Returns:

  • (Core::Response)

    The #data method of the response object returns a hash with the following structure:

    • :parameters - (Array)
      • :parameter_key - (String)
      • :default_value - (String)
      • :no_echo - (Boolean)
      • :description - (String)
    • :description - (String)
    • :capabilities - (Array)
    • :capabilities_reason - (String)