Class: Aws::OpsWorks::Layer
- Inherits:
-
Object
- Object
- Aws::OpsWorks::Layer
- Extended by:
- Deprecations
- Defined in:
- sig/layer.rbs,
lib/aws-sdk-opsworks/layer.rb
Overview
Defined Under Namespace
Classes: Collection
Read-Only Attributes collapse
-
#arn ⇒ String
The Amazon Resource Number (ARN) of a layer.
-
#attributes ⇒ Hash<String,String>
The layer attributes.
-
#auto_assign_elastic_ips ⇒ Boolean
Whether to automatically assign an [Elastic IP address][1] 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
LayerCustomRecipesobject 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
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
LifeCycleEventConfigurationobject that specifies the Shutdown event configuration. -
#name ⇒ String
The layer name.
-
#packages ⇒ Array<String>
An array of
Packageobjects 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
VolumeConfigurationsobject 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
trueif this resource is loaded. -
#initialize(*args) ⇒ Layer
constructor
A new instance of Layer.
- #load ⇒ self (also: #reload)
-
#wait_until(options = {}) {|resource| ... } ⇒ Resource
deprecated
Deprecated.
Use [Aws::OpsWorks::Client] #wait_until instead
Constructor Details
Instance Method Details
#arn ⇒ String
The Amazon Resource Number (ARN) of a layer.
21 |
# File 'sig/layer.rbs', line 21
def arn: () -> ::String
|
#attributes ⇒ Hash<String,String>
The layer attributes.
For the HaproxyStatsPassword, MysqlRootPassword, and
GangliaPassword attributes, OpsWorks Stacks returns
*****FILTERED***** instead of the actual value
For an ECS Cluster layer, OpsWorks Stacks the EcsClusterArn
attribute is set to the cluster's ARN.
39 |
# File 'sig/layer.rbs', line 39
def attributes: () -> ::Hash[("EcsClusterArn" | "EnableHaproxyStats" | "HaproxyStatsUrl" | "HaproxyStatsUser" | "HaproxyStatsPassword" | "HaproxyHealthCheckUrl" | "HaproxyHealthCheckMethod" | "MysqlRootPassword" | "MysqlRootPasswordUbiquitous" | "GangliaUrl" | "GangliaUser" | "GangliaPassword" | "MemcachedMemory" | "NodejsVersion" | "RubyVersion" | "RubygemsVersion" | "ManageBundler" | "BundlerVersion" | "RailsStack" | "PassengerVersion" | "Jvm" | "JvmVersion" | "JvmOptions" | "JavaAppServer" | "JavaAppServerVersion"), ::String]
|
#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.
66 |
# File 'sig/layer.rbs', line 66
def auto_assign_elastic_ips: () -> bool
|
#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.
69 |
# File 'sig/layer.rbs', line 69
def auto_assign_public_ips: () -> bool
|
#cloud_watch_logs_configuration ⇒ Types::CloudWatchLogsConfiguration
The Amazon CloudWatch Logs configuration settings for the layer.
42 |
# File 'sig/layer.rbs', line 42
def cloud_watch_logs_configuration: () -> Types::CloudWatchLogsConfiguration
|
#created_at ⇒ String
Date when the layer was created.
78 |
# File 'sig/layer.rbs', line 78
def created_at: () -> ::String
|
#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.
45 |
# File 'sig/layer.rbs', line 45
def custom_instance_profile_arn: () -> ::String
|
#custom_json ⇒ String
A JSON formatted string containing the layer's custom stack configuration and deployment attributes.
48 |
# File 'sig/layer.rbs', line 48
def custom_json: () -> ::String
|
#custom_recipes ⇒ Types::Recipes
A LayerCustomRecipes object that specifies the layer's custom
recipes.
75 |
# File 'sig/layer.rbs', line 75
def custom_recipes: () -> Types::Recipes
|
#custom_security_group_ids ⇒ Array<String>
An array containing the layer's custom security group IDs.
51 |
# File 'sig/layer.rbs', line 51
def custom_security_group_ids: () -> ::Array[::String]
|
#data ⇒ Types::Layer
Returns the data for this Aws::OpsWorks::Layer. Calls
Client#describe_layers if #data_loaded? is false.
96 |
# File 'sig/layer.rbs', line 96
def data: () -> Types::Layer
|
#data_loaded? ⇒ Boolean
99 |
# File 'sig/layer.rbs', line 99
def data_loaded?: () -> bool
|
#default_recipes ⇒ Types::Recipes
OpsWorks Stacks supports five lifecycle events: setup,
configuration, deploy, undeploy, and shutdown. For
each layer, OpsWorks Stacks runs a set of standard recipes for each
event. You can also provide custom recipes for any or all layers and
events. 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.
72 |
# File 'sig/layer.rbs', line 72
def default_recipes: () -> Types::Recipes
|
#default_security_group_names ⇒ Array<String>
An array containing the layer's security group names.
54 |
# File 'sig/layer.rbs', line 54
def default_security_group_names: () -> ::Array[::String]
|
#delete(options = {}) ⇒ EmptyStructure
103 |
# File 'sig/layer.rbs', line 103
def delete: (
|
#enable_auto_healing ⇒ Boolean
Whether auto healing is disabled for the layer.
63 |
# File 'sig/layer.rbs', line 63
def enable_auto_healing: () -> bool
|
#id ⇒ String
18 |
# File 'sig/layer.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.
394 395 396 |
# File 'lib/aws-sdk-opsworks/layer.rb', line 394 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.
true, to ensure
that your instances have the latest security updates.
81 |
# File 'sig/layer.rbs', line 81
def install_updates_on_boot: () -> bool
|
#layer_id ⇒ String
The layer ID.
27 |
# File 'sig/layer.rbs', line 27
def layer_id: () -> ::String
|
#lifecycle_event_configuration ⇒ Types::LifecycleEventConfiguration
A LifeCycleEventConfiguration object that specifies the Shutdown
event configuration.
87 |
# File 'sig/layer.rbs', line 87
def lifecycle_event_configuration: () -> Types::LifecycleEventConfiguration
|
#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
92 |
# File 'sig/layer.rbs', line 92
def load: () -> self
|
#name ⇒ String
The layer name. Layer names can be a maximum of 32 characters.
33 |
# File 'sig/layer.rbs', line 33
def name: () -> ::String
|
#packages ⇒ Array<String>
An array of Package objects that describe the layer's packages.
57 |
# File 'sig/layer.rbs', line 57
def packages: () -> ::Array[::String]
|
#shortname ⇒ String
The layer short name.
36 |
# File 'sig/layer.rbs', line 36
def shortname: () -> ::String
|
#stack_id ⇒ String
The layer stack ID.
24 |
# File 'sig/layer.rbs', line 24
def stack_id: () -> ::String
|
#type ⇒ String
The layer type.
30 |
# File 'sig/layer.rbs', line 30
def type: () -> ("aws-flow-ruby" | "ecs-cluster" | "java-app" | "lb" | "web" | "php-app" | "rails-app" | "nodejs-app" | "memcached" | "db-master" | "monitoring-master" | "custom")
|
#use_ebs_optimized_instances ⇒ Boolean
Whether the layer uses Amazon EBS-optimized instances.
84 |
# File 'sig/layer.rbs', line 84
def use_ebs_optimized_instances: () -> bool
|
#volume_configurations ⇒ Array<Types::VolumeConfiguration>
A VolumeConfigurations object that describes the layer's Amazon EBS
volumes.
60 |
# File 'sig/layer.rbs', line 60
def volume_configurations: () -> ::Array[Types::VolumeConfiguration]
|
#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
344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 |
# File 'lib/aws-sdk-opsworks/layer.rb', line 344 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 |