Class: Aws::OpsWorks::Layer
- Inherits:
-
Object
- Object
- Aws::OpsWorks::Layer
- Extended by:
- Deprecations
- Defined in:
- lib/aws-sdk-opsworks/layer.rb
Defined Under Namespace
Classes: Collection
Read-Only Attributes collapse
- #arn ⇒ String
-
#attributes ⇒ Hash<String,String>
The layer attributes.
-
#auto_assign_elastic_ips ⇒ Boolean
Whether to automatically assign an [Elastic IP address] to the layer’s instances.
-
#auto_assign_public_ips ⇒ Boolean
For stacks that are running in a VPC, whether to automatically assign a public IP address to the layer’s instances.
-
#cloud_watch_logs_configuration ⇒ Types::CloudWatchLogsConfiguration
The Amazon CloudWatch Logs configuration settings for the layer.
-
#created_at ⇒ String
Date when the layer was created.
-
#custom_instance_profile_arn ⇒ String
The ARN of the default IAM profile to be used for the layer’s EC2 instances.
-
#custom_json ⇒ String
A JSON formatted string containing the layer’s custom stack configuration and deployment attributes.
-
#custom_recipes ⇒ Types::Recipes
A ‘LayerCustomRecipes` object that specifies the layer’s custom recipes.
-
#custom_security_group_ids ⇒ Array<String>
An array containing the layer’s custom security group IDs.
-
#default_recipes ⇒ Types::Recipes
AWS OpsWorks Stacks supports five lifecycle events: setup, configuration, deploy, undeploy, and shutdown.
-
#default_security_group_names ⇒ Array<String>
An array containing the layer’s security group names.
-
#enable_auto_healing ⇒ Boolean
Whether auto healing is disabled for the layer.
- #id ⇒ String
-
#install_updates_on_boot ⇒ Boolean
Whether to install operating system and package updates when the instance boots.
-
#layer_id ⇒ String
The layer ID.
-
#lifecycle_event_configuration ⇒ Types::LifecycleEventConfiguration
A ‘LifeCycleEventConfiguration` object that specifies the Shutdown event configuration.
-
#name ⇒ String
The layer name.
-
#packages ⇒ Array<String>
An array of ‘Package` objects that describe the layer’s packages.
-
#shortname ⇒ String
The layer short name.
-
#stack_id ⇒ String
The layer stack ID.
-
#type ⇒ String
The layer type.
-
#use_ebs_optimized_instances ⇒ Boolean
Whether the layer uses Amazon EBS-optimized instances.
-
#volume_configurations ⇒ Array<Types::VolumeConfiguration>
A ‘VolumeConfigurations` object that describes the layer’s Amazon EBS volumes.
Actions collapse
Associations collapse
- #identifiers ⇒ Object deprecated private Deprecated.
- #stack ⇒ Stack?
Instance Method Summary collapse
- #client ⇒ Client
-
#data ⇒ Types::Layer
Returns the data for this Layer.
-
#data_loaded? ⇒ Boolean
Returns ‘true` if this resource is loaded.
-
#initialize(*args) ⇒ Layer
constructor
A new instance of Layer.
- #load ⇒ self (also: #reload)
Constructor Details
#initialize(id, options = {}) ⇒ Layer #initialize(options = {}) ⇒ Layer
Returns a new instance of Layer.
19 20 21 22 23 24 |
# File 'lib/aws-sdk-opsworks/layer.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
#arn ⇒ String
34 35 36 |
# File 'lib/aws-sdk-opsworks/layer.rb', line 34 def arn data.arn end |
#attributes ⇒ Hash<String,String>
The layer attributes.
For the ‘HaproxyStatsPassword`, `MysqlRootPassword`, and `GangliaPassword` attributes, AWS OpsWorks Stacks returns `*****FILTERED*****` instead of the actual value
For an ECS Cluster layer, AWS OpsWorks Stacks the ‘EcsClusterArn` attribute is set to the cluster’s ARN.
77 78 79 |
# File 'lib/aws-sdk-opsworks/layer.rb', line 77 def attributes data.attributes end |
#auto_assign_elastic_ips ⇒ Boolean
Whether to automatically assign an [Elastic IP address] to the layer’s instances. For more information, see [How to Edit a Layer].
[1]: docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html [2]: docs.aws.amazon.com/opsworks/latest/userguide/workinglayers-basics-edit.html
146 147 148 |
# File 'lib/aws-sdk-opsworks/layer.rb', line 146 def auto_assign_elastic_ips data.auto_assign_elastic_ips end |
#auto_assign_public_ips ⇒ Boolean
For stacks that are running in a VPC, whether to automatically assign a public IP address to the layer’s instances. For more information, see [How to Edit a Layer].
[1]: docs.aws.amazon.com/opsworks/latest/userguide/workinglayers-basics-edit.html
158 159 160 |
# File 'lib/aws-sdk-opsworks/layer.rb', line 158 def auto_assign_public_ips data.auto_assign_public_ips end |
#client ⇒ Client
226 227 228 |
# File 'lib/aws-sdk-opsworks/layer.rb', line 226 def client @client end |
#cloud_watch_logs_configuration ⇒ Types::CloudWatchLogsConfiguration
The Amazon CloudWatch Logs configuration settings for the layer.
83 84 85 |
# File 'lib/aws-sdk-opsworks/layer.rb', line 83 def cloud_watch_logs_configuration data.cloud_watch_logs_configuration end |
#created_at ⇒ String
Date when the layer was created.
190 191 192 |
# File 'lib/aws-sdk-opsworks/layer.rb', line 190 def created_at data.created_at end |
#custom_instance_profile_arn ⇒ String
The ARN of the default IAM profile to be used for the layer’s EC2 instances. For more information about IAM ARNs, see [Using Identifiers].
[1]: docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html
95 96 97 |
# File 'lib/aws-sdk-opsworks/layer.rb', line 95 def custom_instance_profile_arn data.custom_instance_profile_arn end |
#custom_json ⇒ String
A JSON formatted string containing the layer’s custom stack configuration and deployment attributes.
102 103 104 |
# File 'lib/aws-sdk-opsworks/layer.rb', line 102 def custom_json data.custom_json end |
#custom_recipes ⇒ Types::Recipes
A ‘LayerCustomRecipes` object that specifies the layer’s custom recipes.
184 185 186 |
# File 'lib/aws-sdk-opsworks/layer.rb', line 184 def custom_recipes data.custom_recipes end |
#custom_security_group_ids ⇒ Array<String>
An array containing the layer’s custom security group IDs.
108 109 110 |
# File 'lib/aws-sdk-opsworks/layer.rb', line 108 def custom_security_group_ids data.custom_security_group_ids end |
#data ⇒ Types::Layer
Returns the data for this Aws::OpsWorks::Layer. Calls Client#describe_layers if #data_loaded? is ‘false`.
246 247 248 249 |
# File 'lib/aws-sdk-opsworks/layer.rb', line 246 def data load unless @data @data end |
#data_loaded? ⇒ Boolean
254 255 256 |
# File 'lib/aws-sdk-opsworks/layer.rb', line 254 def data_loaded? !!@data end |
#default_recipes ⇒ Types::Recipes
AWS OpsWorks Stacks supports five lifecycle events: setup, configuration, deploy, undeploy, and shutdown. For each layer, AWS OpsWorks Stacks runs a set of standard recipes for each event. In addition, you can provide custom recipes for any or all layers and events. AWS OpsWorks Stacks runs custom event recipes after the standard recipes. ‘LayerCustomRecipes` specifies the custom recipes for a particular layer to be run in response to each of the five events.
To specify a recipe, use the cookbook’s directory name in the repository followed by two colons and the recipe name, which is the recipe’s file name without the .rb extension. For example: phpapp2::dbsetup specifies the dbsetup.rb recipe in the repository’s phpapp2 folder.
177 178 179 |
# File 'lib/aws-sdk-opsworks/layer.rb', line 177 def default_recipes data.default_recipes end |
#default_security_group_names ⇒ Array<String>
An array containing the layer’s security group names.
114 115 116 |
# File 'lib/aws-sdk-opsworks/layer.rb', line 114 def default_security_group_names data.default_security_group_names end |
#delete(options = {}) ⇒ EmptyStructure
265 266 267 268 269 |
# File 'lib/aws-sdk-opsworks/layer.rb', line 265 def delete( = {}) = .merge(layer_id: @id) resp = @client.delete_layer() resp.data end |
#enable_auto_healing ⇒ Boolean
Whether auto healing is disabled for the layer.
133 134 135 |
# File 'lib/aws-sdk-opsworks/layer.rb', line 133 def enable_auto_healing data.enable_auto_healing end |
#id ⇒ String
29 30 31 |
# File 'lib/aws-sdk-opsworks/layer.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.
287 288 289 |
# File 'lib/aws-sdk-opsworks/layer.rb', line 287 def identifiers { id: @id } end |
#install_updates_on_boot ⇒ Boolean
Whether to install operating system and package updates when the instance boots. The default value is ‘true`. If this value is set to `false`, you must then update your instances manually by using CreateDeployment to run the `update_dependencies` stack command or manually running `yum` (Amazon Linux) or `apt-get` (Ubuntu) on the instances.
<note markdown=“1”> We strongly recommend using the default value of ‘true`, to ensure that your instances have the latest security updates.
</note>
206 207 208 |
# File 'lib/aws-sdk-opsworks/layer.rb', line 206 def install_updates_on_boot data.install_updates_on_boot end |
#layer_id ⇒ String
The layer ID.
46 47 48 |
# File 'lib/aws-sdk-opsworks/layer.rb', line 46 def layer_id data.layer_id end |
#lifecycle_event_configuration ⇒ Types::LifecycleEventConfiguration
A ‘LifeCycleEventConfiguration` object that specifies the Shutdown event configuration.
219 220 221 |
# File 'lib/aws-sdk-opsworks/layer.rb', line 219 def lifecycle_event_configuration data.lifecycle_event_configuration end |
#load ⇒ self Also known as: reload
Loads, or reloads #data for the current Aws::OpsWorks::Layer. Returns ‘self` making it possible to chain methods.
layer.reload.data
236 237 238 239 240 |
# File 'lib/aws-sdk-opsworks/layer.rb', line 236 def load resp = @client.describe_layers(layer_ids: [@id]) @data = resp.layers[0] self end |
#name ⇒ String
The layer name.
58 59 60 |
# File 'lib/aws-sdk-opsworks/layer.rb', line 58 def name data.name end |
#packages ⇒ Array<String>
An array of ‘Package` objects that describe the layer’s packages.
120 121 122 |
# File 'lib/aws-sdk-opsworks/layer.rb', line 120 def packages data.packages end |
#shortname ⇒ String
The layer short name.
64 65 66 |
# File 'lib/aws-sdk-opsworks/layer.rb', line 64 def shortname data.shortname end |
#stack ⇒ Stack?
274 275 276 277 278 279 280 281 282 283 |
# File 'lib/aws-sdk-opsworks/layer.rb', line 274 def stack if data.stack_id Stack.new( id: data.stack_id, client: @client ) else nil end end |
#stack_id ⇒ String
The layer stack ID.
40 41 42 |
# File 'lib/aws-sdk-opsworks/layer.rb', line 40 def stack_id data.stack_id end |
#type ⇒ String
The layer type.
52 53 54 |
# File 'lib/aws-sdk-opsworks/layer.rb', line 52 def type data.type end |
#use_ebs_optimized_instances ⇒ Boolean
Whether the layer uses Amazon EBS-optimized instances.
212 213 214 |
# File 'lib/aws-sdk-opsworks/layer.rb', line 212 def use_ebs_optimized_instances data.use_ebs_optimized_instances end |
#volume_configurations ⇒ Array<Types::VolumeConfiguration>
A ‘VolumeConfigurations` object that describes the layer’s Amazon EBS volumes.
127 128 129 |
# File 'lib/aws-sdk-opsworks/layer.rb', line 127 def volume_configurations data.volume_configurations end |