Class: Aws::OpsWorks::Stack
- Inherits:
-
Object
- Object
- Aws::OpsWorks::Stack
- Extended by:
- Deprecations
- Defined in:
- lib/aws-sdk-opsworks/stack.rb
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 ‘ChefConfiguration` object 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 AWS region, such as “ap-northeast-2”.
-
#service_role_arn ⇒ String
The stack AWS 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 AWS 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 ‘true` if this resource is loaded.
-
#initialize(*args) ⇒ Stack
constructor
A new instance of Stack.
- #load ⇒ self (also: #reload)
Constructor Details
#initialize(id, options = {}) ⇒ Stack #initialize(options = {}) ⇒ Stack
Returns a new instance of Stack.
19 20 21 22 23 24 |
# File 'lib/aws-sdk-opsworks/stack.rb', line 19 def initialize(*args) = Hash === args.last ? args.pop.dup : {} @id = extract_id(args, ) @data = .delete(:data) @client = .delete(:client) || Client.new() end |
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.
213 214 215 |
# File 'lib/aws-sdk-opsworks/stack.rb', line 213 def agent_version data.agent_version end |
#arn ⇒ String
The stack’s ARN.
47 48 49 |
# File 'lib/aws-sdk-opsworks/stack.rb', line 47 def arn data.arn end |
#attributes ⇒ Hash<String,String>
The stack’s attributes.
70 71 72 |
# File 'lib/aws-sdk-opsworks/stack.rb', line 70 def attributes data.attributes end |
#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].
[1]: docs.aws.amazon.com/opsworks/latest/userguide/workingstacks-creating.html
155 156 157 |
# File 'lib/aws-sdk-opsworks/stack.rb', line 155 def chef_configuration data.chef_configuration end |
#client ⇒ Client
220 221 222 |
# File 'lib/aws-sdk-opsworks/stack.rb', line 220 def client @client end |
#configuration_manager ⇒ Types::StackConfigurationManager
The configuration manager.
143 144 145 |
# File 'lib/aws-sdk-opsworks/stack.rb', line 143 def configuration_manager data.configuration_manager end |
#create_layer(options = {}) ⇒ Layer
407 408 409 410 411 412 413 414 |
# File 'lib/aws-sdk-opsworks/stack.rb', line 407 def create_layer( = {}) = .merge(stack_id: @id) resp = @client.create_layer() Layer.new( id: resp.data.layer_id, client: @client ) end |
#created_at ⇒ String
The date when the stack was created.
194 195 196 |
# File 'lib/aws-sdk-opsworks/stack.rb', line 194 def created_at data.created_at end |
#custom_cookbooks_source ⇒ Types::Source
Contains the information required to retrieve an app or cookbook from a repository. For more information, see [Creating Apps] or [Custom Recipes and Cookbooks].
[1]: docs.aws.amazon.com/opsworks/latest/userguide/workingapps-creating.html [2]: docs.aws.amazon.com/opsworks/latest/userguide/workingcookbook.html
181 182 183 |
# File 'lib/aws-sdk-opsworks/stack.rb', line 181 def custom_cookbooks_source data.custom_cookbooks_source end |
#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:
‘“”value1“, ”key2“: ”value2“,…”`
For more information on custom JSON, see [Use Custom JSON to Modify the Stack Configuration Attributes].
[1]: docs.aws.amazon.com/opsworks/latest/userguide/workingstacks-json.html
137 138 139 |
# File 'lib/aws-sdk-opsworks/stack.rb', line 137 def custom_json data.custom_json end |
#data ⇒ Types::Stack
Returns the data for this Aws::OpsWorks::Stack. Calls Client#describe_stacks if #data_loaded? is ‘false`.
240 241 242 243 |
# File 'lib/aws-sdk-opsworks/stack.rb', line 240 def data load unless @data @data end |
#data_loaded? ⇒ Boolean
248 249 250 |
# File 'lib/aws-sdk-opsworks/stack.rb', line 248 def data_loaded? !!@data end |
#default_availability_zone ⇒ String
The stack’s default Availability Zone. For more information, see [Regions and Endpoints].
111 112 113 |
# File 'lib/aws-sdk-opsworks/stack.rb', line 111 def default_availability_zone data.default_availability_zone end |
#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].
[1]: docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html
88 89 90 |
# File 'lib/aws-sdk-opsworks/stack.rb', line 88 def default_instance_profile_arn data.default_instance_profile_arn end |
#default_os ⇒ String
The stack’s default operating system.
94 95 96 |
# File 'lib/aws-sdk-opsworks/stack.rb', line 94 def default_os data.default_os end |
#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].
[1]: docs.aws.amazon.com/AWSEC2/latest/UserGuide/ComponentsAMIs.html#storage-for-the-root-device
206 207 208 |
# File 'lib/aws-sdk-opsworks/stack.rb', line 206 def default_root_device_type data.default_root_device_type end |
#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.
188 189 190 |
# File 'lib/aws-sdk-opsworks/stack.rb', line 188 def default_ssh_key_name data.default_ssh_key_name end |
#default_subnet_id ⇒ String
The default subnet ID; applicable only if the stack is running in a VPC.
118 119 120 |
# File 'lib/aws-sdk-opsworks/stack.rb', line 118 def default_subnet_id data.default_subnet_id end |
#delete(options = {}) ⇒ EmptyStructure
421 422 423 424 425 |
# File 'lib/aws-sdk-opsworks/stack.rb', line 421 def delete( = {}) = .merge(stack_id: @id) resp = @client.delete_stack() resp.data end |
#hostname_theme ⇒ String
The stack host name theme, with spaces replaced by underscores.
100 101 102 |
# File 'lib/aws-sdk-opsworks/stack.rb', line 100 def hostname_theme data.hostname_theme end |
#id ⇒ String
29 30 31 |
# File 'lib/aws-sdk-opsworks/stack.rb', line 29 def id @id end |
#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.
467 468 469 |
# File 'lib/aws-sdk-opsworks/stack.rb', line 467 def identifiers { id: @id } end |
#layers(options = {}) ⇒ Layer::Collection
440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 |
# File 'lib/aws-sdk-opsworks/stack.rb', line 440 def layers( = {}) batches = Enumerator.new do |y| batch = [] = .merge(stack_id: @id) resp = @client.describe_layers() resp.data.layers.each do |l| batch << Layer.new( id: l.layer_id, data: l, client: @client ) end y.yield(batch) end Layer::Collection.new(batches) 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
230 231 232 233 234 |
# File 'lib/aws-sdk-opsworks/stack.rb', line 230 def load resp = @client.describe_stacks(stack_ids: [@id]) @data = resp.stacks[0] self end |
#name ⇒ String
The stack name.
41 42 43 |
# File 'lib/aws-sdk-opsworks/stack.rb', line 41 def name data.name end |
#region ⇒ String
The stack AWS region, such as “ap-northeast-2”. For more information about AWS regions, see [Regions and Endpoints].
58 59 60 |
# File 'lib/aws-sdk-opsworks/stack.rb', line 58 def region data.region end |
#service_role_arn ⇒ String
The stack AWS Identity and Access Management (IAM) role.
76 77 78 |
# File 'lib/aws-sdk-opsworks/stack.rb', line 76 def service_role_arn data.service_role_arn end |
#stack_id ⇒ String
The stack ID.
35 36 37 |
# File 'lib/aws-sdk-opsworks/stack.rb', line 35 def stack_id data.stack_id end |
#summary ⇒ StackSummary
458 459 460 461 462 463 |
# File 'lib/aws-sdk-opsworks/stack.rb', line 458 def summary StackSummary.new( stack_id: @id, client: @client ) end |
#use_custom_cookbooks ⇒ Boolean
Whether the stack uses custom cookbooks.
161 162 163 |
# File 'lib/aws-sdk-opsworks/stack.rb', line 161 def use_custom_cookbooks data.use_custom_cookbooks end |
#use_opsworks_security_groups ⇒ Boolean
Whether the stack automatically associates the AWS OpsWorks Stacks built-in security groups with the stack’s layers.
168 169 170 |
# File 'lib/aws-sdk-opsworks/stack.rb', line 168 def use_opsworks_security_groups data.use_opsworks_security_groups end |
#vpc_id ⇒ String
The VPC ID; applicable only if the stack is running in a VPC.
64 65 66 |
# File 'lib/aws-sdk-opsworks/stack.rb', line 64 def vpc_id data.vpc_id end |