Class: Aws::CloudFormation::Stack
- Inherits:
-
Object
- Object
- Aws::CloudFormation::Stack
- Extended by:
- Deprecations
- Defined in:
- sig/stack.rbs,
lib/aws-sdk-cloudformation/stack.rb
Overview
Defined Under Namespace
Classes: Collection
Read-Only Attributes collapse
-
#capabilities ⇒ Array<String>
The capabilities allowed in the stack.
-
#change_set_id ⇒ String
The unique ID of the change set.
-
#creation_time ⇒ Time
The time at which the stack was created.
-
#deletion_mode ⇒ String
Specifies the deletion mode for the stack.
-
#deletion_time ⇒ Time
The time the stack was deleted.
-
#deployment_config ⇒ Types::DeploymentConfig
The deployment configuration for the stack, including the deployment mode used for stack operations.
-
#description ⇒ String
A user-defined description associated with the stack.
-
#detailed_status ⇒ String
The detailed status of the resource or stack.
-
#disable_rollback ⇒ Boolean
Boolean to enable or disable rollback on stack creation failures:.
-
#drift_information ⇒ Types::StackDriftInformation
Information about whether a stack's actual configuration differs, or has drifted, from its expected configuration, as defined in the stack template and any values specified as template parameters.
-
#enable_termination_protection ⇒ Boolean
Whether termination protection is enabled for the stack.
-
#last_operations ⇒ Array<Types::OperationEntry>
Information about the most recent operations performed on this stack.
-
#last_updated_time ⇒ Time
The time the stack was last updated.
- #name ⇒ String (also: #stack_name)
-
#notification_arns ⇒ Array<String>
Amazon SNS topic Amazon Resource Names (ARNs) to which stack related events are published.
-
#outputs ⇒ Array<Types::Output>
A list of output structures.
-
#parameters ⇒ Array<Types::Parameter>
A list of
Parameterstructures. -
#parent_id ⇒ String
For nested stacks, the stack ID of the direct parent of this stack.
-
#retain_except_on_create ⇒ Boolean
When set to
true, newly created resources are deleted when the operation rolls back. -
#role_arn ⇒ String
The Amazon Resource Name (ARN) of an IAM role that's associated with the stack.
-
#rollback_configuration ⇒ Types::RollbackConfiguration
The rollback triggers for CloudFormation to monitor during stack creation and updating operations, and for the specified monitoring period afterwards.
-
#root_id ⇒ String
For nested stacks, the stack ID of the top-level stack to which the nested stack ultimately belongs.
-
#stack_id ⇒ String
Unique identifier of the stack.
-
#stack_status ⇒ String
Current status of the stack.
-
#stack_status_reason ⇒ String
Success/failure message associated with the stack status.
-
#tags ⇒ Array<Types::Tag>
A list of
Tags that specify information about the stack. -
#timeout_in_minutes ⇒ Integer
The amount of time within which stack creation should complete.
Actions collapse
- #cancel_update(options = {}) ⇒ EmptyStructure
- #create(options = {}) ⇒ Types::CreateStackOutput
- #delete(options = {}) ⇒ EmptyStructure
- #update(options = {}) ⇒ Types::UpdateStackOutput
Associations collapse
- #events(options = {}) ⇒ Event::Collection
- #identifiers ⇒ Object deprecated private Deprecated.
- #resource(logical_id) ⇒ StackResource
- #resource_summaries(options = {}) ⇒ StackResourceSummary::Collection
Instance Method Summary collapse
- #client ⇒ Client
-
#data ⇒ Types::Stack
Returns the data for this Stack.
-
#data_loaded? ⇒ Boolean
Returns
trueif this resource is loaded. -
#exists?(options = {}) ⇒ Boolean
Returns
trueif the Stack exists. -
#initialize(*args) ⇒ Stack
constructor
A new instance of Stack.
- #load ⇒ self (also: #reload)
-
#wait_until(options = {}) {|resource| ... } ⇒ Resource
deprecated
Deprecated.
Use [Aws::CloudFormation::Client] #wait_until instead
- #wait_until_exists(options = {}, &block) ⇒ Stack
Constructor Details
Instance Method Details
#cancel_update(options = {}) ⇒ EmptyStructure
120 |
# File 'sig/stack.rbs', line 120
def cancel_update: (
|
#capabilities ⇒ Array<String>
The capabilities allowed in the stack.
64 |
# File 'sig/stack.rbs', line 64
def capabilities: () -> ::Array[("CAPABILITY_IAM" | "CAPABILITY_NAMED_IAM" | "CAPABILITY_AUTO_EXPAND")]
|
#change_set_id ⇒ String
The unique ID of the change set.
25 |
# File 'sig/stack.rbs', line 25
def change_set_id: () -> ::String
|
#client ⇒ Client
263 |
# File 'lib/aws-sdk-cloudformation/stack.rb', line 263
def client: () -> Client
|
#creation_time ⇒ Time
The time at which the stack was created.
34 |
# File 'sig/stack.rbs', line 34
def creation_time: () -> ::Time
|
#data ⇒ Types::Stack
Returns the data for this Aws::CloudFormation::Stack. Calls
Client#describe_stacks if #data_loaded? is false.
106 |
# File 'sig/stack.rbs', line 106
def data: () -> Types::Stack
|
#data_loaded? ⇒ Boolean
109 |
# File 'sig/stack.rbs', line 109
def data_loaded?: () -> bool
|
#delete(options = {}) ⇒ EmptyStructure
173 |
# File 'sig/stack.rbs', line 173
def delete: (
|
#deletion_mode ⇒ String
Specifies the deletion mode for the stack. Possible values are:
-
STANDARD- Use the standard behavior. Specifying this value is the same as not specifying this parameter. -
FORCE_DELETE_STACK- Delete the stack if it's stuck in aDELETE_FAILEDstate due to resource deletion failure.
91 |
# File 'sig/stack.rbs', line 91
def deletion_mode: () -> ("STANDARD" | "FORCE_DELETE_STACK")
|
#deletion_time ⇒ Time
The time the stack was deleted.
37 |
# File 'sig/stack.rbs', line 37
def deletion_time: () -> ::Time
|
#deployment_config ⇒ Types::DeploymentConfig
The deployment configuration for the stack, including the deployment mode used for stack operations.
55 |
# File 'sig/stack.rbs', line 55
def deployment_config: () -> Types::DeploymentConfig
|
#description ⇒ String
A user-defined description associated with the stack.
28 |
# File 'sig/stack.rbs', line 28
def description: () -> ::String
|
#detailed_status ⇒ String
The detailed status of the resource or stack. If
CONFIGURATION_COMPLETE is present, the resource or resource
configuration phase has completed and the stabilization of the
resources is in progress. The StackSets CONFIGURATION_COMPLETE when
all of the resources in the stack have reached that event. For more
information, see Understand CloudFormation stack creation events
in the CloudFormation User Guide.
94 |
# File 'sig/stack.rbs', line 94
def detailed_status: () -> ("CONFIGURATION_COMPLETE" | "VALIDATION_FAILED")
|
#disable_rollback ⇒ Boolean
Boolean to enable or disable rollback on stack creation failures:
-
true: disable rollback. -
false: enable rollback.
52 |
# File 'sig/stack.rbs', line 52
def disable_rollback: () -> bool
|
#drift_information ⇒ Types::StackDriftInformation
Information about whether a stack's actual configuration differs, or has drifted, from its expected configuration, as defined in the stack template and any values specified as template parameters. For more information, see Detect unmanaged configuration changes to stacks and resources with drift detection.
85 |
# File 'sig/stack.rbs', line 85
def drift_information: () -> Types::StackDriftInformation
|
#enable_termination_protection ⇒ Boolean
Whether termination protection is enabled for the stack.
For nested stacks, termination protection is set on the root stack and can't be changed directly on the nested stack. For more information, see Protect a CloudFormation stack from being deleted in the CloudFormation User Guide.
76 |
# File 'sig/stack.rbs', line 76
def enable_termination_protection: () -> bool
|
#exists?(options = {}) ⇒ Boolean
Returns true if the Stack exists.
112 113 |
# File 'sig/stack.rbs', line 112
def exists?: (?max_attempts: Integer, ?delay: Numeric, ?before_attempt: (^(Integer attempts) -> void), ?before_wait: (^(Integer attempts, untyped response) -> void)) -> bool
| (?Hash[Symbol, untyped]) -> bool
|
#identifiers ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
1215 1216 1217 |
# File 'lib/aws-sdk-cloudformation/stack.rb', line 1215 def identifiers { name: @name } end |
#last_operations ⇒ Array<Types::OperationEntry>
Information about the most recent operations performed on this stack.
97 |
# File 'sig/stack.rbs', line 97
def last_operations: () -> ::Array[Types::OperationEntry]
|
#last_updated_time ⇒ Time
The time the stack was last updated. This field will only be returned if the stack has been updated at least once.
40 |
# File 'sig/stack.rbs', line 40
def last_updated_time: () -> ::Time
|
#load ⇒ self Also known as: reload
Loads, or reloads #data for the current Aws::CloudFormation::Stack.
Returns self making it possible to chain methods.
stack.reload.data
102 |
# File 'sig/stack.rbs', line 102
def load: () -> self
|
#name ⇒ String Also known as: stack_name
18 |
# File 'sig/stack.rbs', line 18
def name: () -> String
|
#notification_arns ⇒ Array<String>
Amazon SNS topic Amazon Resource Names (ARNs) to which stack related events are published.
58 |
# File 'sig/stack.rbs', line 58
def notification_arns: () -> ::Array[::String]
|
#outputs ⇒ Array<Types::Output>
A list of output structures.
67 |
# File 'sig/stack.rbs', line 67
def outputs: () -> ::Array[Types::Output]
|
#parameters ⇒ Array<Types::Parameter>
A list of Parameter structures.
31 |
# File 'sig/stack.rbs', line 31
def parameters: () -> ::Array[Types::Parameter]
|
#parent_id ⇒ String
For nested stacks, the stack ID of the direct parent of this stack. For the first level of nested stacks, the root stack is also the parent stack.
For more information, see Nested stacks in the CloudFormation User Guide.
79 |
# File 'sig/stack.rbs', line 79
def parent_id: () -> ::String
|
#resource(logical_id) ⇒ StackResource
238 |
# File 'sig/stack.rbs', line 238
def resource: (String logical_id) -> StackResource
|
#resource_summaries(options = {}) ⇒ StackResourceSummary::Collection
241 |
# File 'sig/stack.rbs', line 241
def resource_summaries: (
|
#retain_except_on_create ⇒ Boolean
When set to true, newly created resources are deleted when the
operation rolls back. This includes newly created resources marked
with a deletion policy of Retain.
Default: false
88 |
# File 'sig/stack.rbs', line 88
def retain_except_on_create: () -> bool
|
#role_arn ⇒ String
The Amazon Resource Name (ARN) of an IAM role that's associated with the stack. During a stack operation, CloudFormation uses this role's credentials to make calls on your behalf.
70 |
# File 'sig/stack.rbs', line 70
def role_arn: () -> ::String
|
#rollback_configuration ⇒ Types::RollbackConfiguration
The rollback triggers for CloudFormation to monitor during stack creation and updating operations, and for the specified monitoring period afterwards.
43 |
# File 'sig/stack.rbs', line 43
def rollback_configuration: () -> Types::RollbackConfiguration
|
#root_id ⇒ String
For nested stacks, the stack ID of the top-level stack to which the nested stack ultimately belongs.
For more information, see Nested stacks in the CloudFormation User Guide.
82 |
# File 'sig/stack.rbs', line 82
def root_id: () -> ::String
|
#stack_id ⇒ String
Unique identifier of the stack.
22 |
# File 'sig/stack.rbs', line 22
def stack_id: () -> ::String
|
#stack_status ⇒ String
Current status of the stack.
46 |
# File 'sig/stack.rbs', line 46
def stack_status: () -> ("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_FAILED" | "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")
|
#stack_status_reason ⇒ String
Success/failure message associated with the stack status.
49 |
# File 'sig/stack.rbs', line 49
def stack_status_reason: () -> ::String
|
#tags ⇒ Array<Types::Tag>
A list of Tags that specify information about the stack.
73 |
# File 'sig/stack.rbs', line 73
def tags: () -> ::Array[Types::Tag]
|
#timeout_in_minutes ⇒ Integer
The amount of time within which stack creation should complete.
61 |
# File 'sig/stack.rbs', line 61
def timeout_in_minutes: () -> ::Integer
|
#wait_until(options = {}) {|resource| ... } ⇒ Resource
Use [Aws::CloudFormation::Client] #wait_until instead
The waiting operation is performed on a copy. The original resource remains unchanged.
Waiter polls an API operation until a resource enters a desired state.
Basic Usage
Waiter will polls until it is successful, it fails by entering a terminal state, or until a maximum number of attempts are made.
# polls in a loop until condition is true
resource.wait_until() {|resource| condition}
Example
instance.wait_until(max_attempts:10, delay:5) do |instance|
instance.state.name == 'running'
end
Configuration
You can configure the maximum number of polling attempts, and the delay (in seconds) between each polling attempt. The waiting condition is set by passing a block to #wait_until:
# poll for ~25 seconds
resource.wait_until(max_attempts:5,delay:5) {|resource|...}
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
# poll for 1 hour, instead of a number of attempts
proc = Proc.new do |attempts, response|
throw :failure if Time.now - started_at > 3600
end
# disable max attempts
instance.wait_until(before_wait:proc, max_attempts:nil) {...}
Handling Errors
When a waiter is successful, it returns the Resource. When a waiter fails, it raises an error.
begin
resource.wait_until(...)
rescue Aws::Waiters::Errors::WaiterFailed
# resource did not enter the desired state in time
end
attempts attempt in seconds invoked before each attempt invoked before each wait
410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 |
# File 'lib/aws-sdk-cloudformation/stack.rb', line 410 def wait_until( = {}, &block) self_copy = self.dup attempts = 0 [:max_attempts] = 10 unless .key?(:max_attempts) [:delay] ||= 10 [:poller] = Proc.new do attempts += 1 if block.call(self_copy) [:success, self_copy] else self_copy.reload unless attempts == [:max_attempts] :retry end end Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do Aws::Waiters::Waiter.new().wait({}) end end |
#wait_until_exists(options = {}, &block) ⇒ Stack
116 117 |
# File 'sig/stack.rbs', line 116
def wait_until_exists: (?max_attempts: Integer, ?delay: Numeric, ?before_attempt: (^(Integer attempts) -> void), ?before_wait: (^(Integer attempts, untyped response) -> void)) ?{ (untyped waiter) -> void } -> Stack
| (?Hash[Symbol, untyped]) ?{ (untyped waiter) -> void } -> Stack
|