Class: Aws::OpsWorks::Stack
- Inherits:
-
Object
- Object
- Aws::OpsWorks::Stack
- Extended by:
- Deprecations
- Defined in:
- sig/stack.rbs,
lib/aws-sdk-opsworks/stack.rb
Overview
Defined Under Namespace
Classes: Collection
Read-Only Attributes collapse
-
#agent_version ⇒ String
The agent version.
-
#arn ⇒ String
The stack's ARN.
-
#attributes ⇒ Hash<String,String>
The stack's attributes.
-
#chef_configuration ⇒ Types::ChefConfiguration
A
ChefConfigurationobject that specifies whether to enable Berkshelf and the Berkshelf version. -
#configuration_manager ⇒ Types::StackConfigurationManager
The configuration manager.
-
#created_at ⇒ String
The date when the stack was created.
-
#custom_cookbooks_source ⇒ Types::Source
Contains the information required to retrieve an app or cookbook from a repository.
-
#custom_json ⇒ String
A JSON object that contains user-defined attributes to be added to the stack configuration and deployment attributes.
-
#default_availability_zone ⇒ String
The stack's default Availability Zone.
-
#default_instance_profile_arn ⇒ String
The ARN of an IAM profile that is the default profile for all of the stack's EC2 instances.
-
#default_os ⇒ String
The stack's default operating system.
-
#default_root_device_type ⇒ String
The default root device type.
-
#default_ssh_key_name ⇒ String
A default Amazon EC2 key pair for the stack's instances.
-
#default_subnet_id ⇒ String
The default subnet ID; applicable only if the stack is running in a VPC.
-
#hostname_theme ⇒ String
The stack host name theme, with spaces replaced by underscores.
- #id ⇒ String
-
#name ⇒ String
The stack name.
-
#region ⇒ String
The stack Amazon Web Services Region, such as
ap-northeast-2. -
#service_role_arn ⇒ String
The stack Identity and Access Management (IAM) role.
-
#stack_id ⇒ String
The stack ID.
-
#use_custom_cookbooks ⇒ Boolean
Whether the stack uses custom cookbooks.
-
#use_opsworks_security_groups ⇒ Boolean
Whether the stack automatically associates the OpsWorks Stacks built-in security groups with the stack's layers.
-
#vpc_id ⇒ String
The VPC ID; applicable only if the stack is running in a VPC.
Actions collapse
Associations collapse
- #identifiers ⇒ Object deprecated private Deprecated.
- #layers(options = {}) ⇒ Layer::Collection
- #summary ⇒ StackSummary
Instance Method Summary collapse
- #client ⇒ Client
-
#data ⇒ Types::Stack
Returns the data for this Stack.
-
#data_loaded? ⇒ Boolean
Returns
trueif this resource is loaded. -
#initialize(*args) ⇒ Stack
constructor
A new instance of Stack.
- #load ⇒ self (also: #reload)
-
#wait_until(options = {}) {|resource| ... } ⇒ Resource
deprecated
Deprecated.
Use [Aws::OpsWorks::Client] #wait_until instead
Constructor Details
Instance Method Details
#agent_version ⇒ String
The agent version. This parameter is set to LATEST for auto-update.
or a version number for a fixed agent version.
84 |
# File 'sig/stack.rbs', line 84
def agent_version: () -> ::String
|
#arn ⇒ String
The stack's ARN.
27 |
# File 'sig/stack.rbs', line 27
def arn: () -> ::String
|
#attributes ⇒ Hash<String,String>
The stack's attributes.
36 |
# File 'sig/stack.rbs', line 36
def attributes: () -> ::Hash[("Color"), ::String]
|
#chef_configuration ⇒ Types::ChefConfiguration
A ChefConfiguration object that specifies whether to enable
Berkshelf and the Berkshelf version. For more information, see Create
a New Stack.
63 |
# File 'sig/stack.rbs', line 63
def chef_configuration: () -> Types::ChefConfiguration
|
#configuration_manager ⇒ Types::StackConfigurationManager
The configuration manager.
60 |
# File 'sig/stack.rbs', line 60
def configuration_manager: () -> Types::StackConfigurationManager
|
#created_at ⇒ String
The date when the stack was created.
78 |
# File 'sig/stack.rbs', line 78
def created_at: () -> ::String
|
#custom_cookbooks_source ⇒ Types::Source
Contains the information required to retrieve an app or cookbook from a repository. For more information, see Adding Apps or Cookbooks and Recipes.
72 |
# File 'sig/stack.rbs', line 72
def custom_cookbooks_source: () -> Types::Source
|
#custom_json ⇒ String
A JSON object that contains user-defined attributes to be added to the stack configuration and deployment attributes. You can use custom JSON to override the corresponding default stack configuration attribute values or to pass data to recipes. The string should be in the following format:
"{"key1": "value1", "key2": "value2",...}"
For more information on custom JSON, see Use Custom JSON to Modify the Stack Configuration Attributes.
57 |
# File 'sig/stack.rbs', line 57
def custom_json: () -> ::String
|
#data ⇒ Types::Stack
Returns the data for this Aws::OpsWorks::Stack. Calls
Client#describe_stacks if #data_loaded? is false.
93 |
# File 'sig/stack.rbs', line 93
def data: () -> Types::Stack
|
#data_loaded? ⇒ Boolean
96 |
# File 'sig/stack.rbs', line 96
def data_loaded?: () -> bool
|
#default_availability_zone ⇒ String
The stack's default Availability Zone. For more information, see Regions and Endpoints.
51 |
# File 'sig/stack.rbs', line 51
def default_availability_zone: () -> ::String
|
#default_instance_profile_arn ⇒ String
The ARN of an IAM profile that is the default profile for all of the stack's EC2 instances. For more information about IAM ARNs, see Using Identifiers.
42 |
# File 'sig/stack.rbs', line 42
def default_instance_profile_arn: () -> ::String
|
#default_os ⇒ String
The stack's default operating system.
45 |
# File 'sig/stack.rbs', line 45
def default_os: () -> ::String
|
#default_root_device_type ⇒ String
The default root device type. This value is used by default for all instances in the stack, but you can override it when you create an instance. For more information, see Storage for the Root Device.
81 |
# File 'sig/stack.rbs', line 81
def default_root_device_type: () -> ("ebs" | "instance-store")
|
#default_ssh_key_name ⇒ String
A default Amazon EC2 key pair for the stack's instances. You can override this value when you create or update an instance.
75 |
# File 'sig/stack.rbs', line 75
def default_ssh_key_name: () -> ::String
|
#default_subnet_id ⇒ String
The default subnet ID; applicable only if the stack is running in a VPC.
54 |
# File 'sig/stack.rbs', line 54
def default_subnet_id: () -> ::String
|
#delete(options = {}) ⇒ EmptyStructure
160 |
# File 'sig/stack.rbs', line 160
def delete: (
|
#hostname_theme ⇒ String
The stack host name theme, with spaces replaced by underscores.
48 |
# File 'sig/stack.rbs', line 48
def hostname_theme: () -> ::String
|
#id ⇒ String
18 |
# File 'sig/stack.rbs', line 18
def id: () -> String
|
#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.
581 582 583 |
# File 'lib/aws-sdk-opsworks/stack.rb', line 581 def identifiers { id: @id } end |
#load ⇒ self Also known as: reload
Loads, or reloads #data for the current Aws::OpsWorks::Stack.
Returns self making it possible to chain methods.
stack.reload.data
89 |
# File 'sig/stack.rbs', line 89
def load: () -> self
|
#name ⇒ String
The stack name. Stack names can be a maximum of 64 characters.
24 |
# File 'sig/stack.rbs', line 24
def name: () -> ::String
|
#region ⇒ String
The stack Amazon Web Services Region, such as ap-northeast-2. For
more information about Amazon Web Services Regions, see Regions and
Endpoints.
30 |
# File 'sig/stack.rbs', line 30
def region: () -> ::String
|
#service_role_arn ⇒ String
The stack Identity and Access Management (IAM) role.
39 |
# File 'sig/stack.rbs', line 39
def service_role_arn: () -> ::String
|
#stack_id ⇒ String
The stack ID.
21 |
# File 'sig/stack.rbs', line 21
def stack_id: () -> ::String
|
#use_custom_cookbooks ⇒ Boolean
Whether the stack uses custom cookbooks.
66 |
# File 'sig/stack.rbs', line 66
def use_custom_cookbooks: () -> bool
|
#use_opsworks_security_groups ⇒ Boolean
Whether the stack automatically associates the OpsWorks Stacks built-in security groups with the stack's layers.
69 |
# File 'sig/stack.rbs', line 69
def use_opsworks_security_groups: () -> bool
|
#vpc_id ⇒ String
The VPC ID; applicable only if the stack is running in a VPC.
33 |
# File 'sig/stack.rbs', line 33
def vpc_id: () -> ::String
|
#wait_until(options = {}) {|resource| ... } ⇒ Resource
Use [Aws::OpsWorks::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
339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 |
# File 'lib/aws-sdk-opsworks/stack.rb', line 339 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 |