Class: AWSCDK::OpsWorks::CfnLayerProps

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
ops_works/cfn_layer_props.rb

Overview

Properties for defining a CfnLayer.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(auto_assign_elastic_ips:, auto_assign_public_ips:, enable_auto_healing:, name:, shortname:, stack_id:, type:, attributes: nil, custom_instance_profile_arn: nil, custom_json: nil, custom_recipes: nil, custom_security_group_ids: nil, install_updates_on_boot: nil, lifecycle_event_configuration: nil, load_based_auto_scaling: nil, packages: nil, tags: nil, use_ebs_optimized_instances: nil, volume_configurations: nil) ⇒ CfnLayerProps

Returns a new instance of CfnLayerProps.

Parameters:

  • auto_assign_elastic_ips (Boolean, AWSCDK::IResolvable)

    Whether to automatically assign an Elastic IP address to the layer's instances. For more information, see How to Edit a Layer .

  • auto_assign_public_ips (Boolean, AWSCDK::IResolvable)

    For stacks that are running in a VPC, whether to automatically assign a public IP address to the layer's instances.

  • enable_auto_healing (Boolean, AWSCDK::IResolvable)

    Whether to disable auto healing for the layer.

  • name (String)

    The layer name, which is used by the console.

  • shortname (String)

    For custom layers only, use this parameter to specify the layer's short name, which is used internally by OpsWorks Stacks and by Chef recipes.

  • stack_id (String)

    The layer stack ID.

  • type (String)

    The layer type.

  • attributes (AWSCDK::IResolvable, Hash{String => String}, nil) (defaults to: nil)

    One or more user-defined key-value pairs to be added to the stack attributes.

  • custom_instance_profile_arn (String, nil) (defaults to: nil)

    The ARN of an IAM profile to be used for the layer's EC2 instances.

  • custom_json (Object, nil) (defaults to: nil)

    A JSON-formatted string containing custom stack configuration and deployment attributes to be installed on the layer's instances.

  • custom_recipes (AWSCDK::IResolvable, AWSCDK::OpsWorks::CfnLayer::RecipesProperty, nil) (defaults to: nil)

    A LayerCustomRecipes object that specifies the layer custom recipes.

  • custom_security_group_ids (Array<String>, nil) (defaults to: nil)

    An array containing the layer custom security group IDs.

  • install_updates_on_boot (Boolean, AWSCDK::IResolvable, nil) (defaults to: nil)

    Whether to install operating system and package updates when the instance boots.

  • lifecycle_event_configuration (AWSCDK::IResolvable, AWSCDK::OpsWorks::CfnLayer::LifecycleEventConfigurationProperty, nil) (defaults to: nil)

    A LifeCycleEventConfiguration object that you can use to configure the Shutdown event to specify an execution timeout and enable or disable Elastic Load Balancer connection draining.

  • load_based_auto_scaling (AWSCDK::IResolvable, AWSCDK::OpsWorks::CfnLayer::LoadBasedAutoScalingProperty, nil) (defaults to: nil)

    The load-based scaling configuration for the OpsWorks layer.

  • packages (Array<String>, nil) (defaults to: nil)

    An array of Package objects that describes the layer packages.

  • tags (Array<AWSCDK::CfnTag>, nil) (defaults to: nil)

    Specifies one or more sets of tags (key–value pairs) to associate with this OpsWorks layer.

  • use_ebs_optimized_instances (Boolean, AWSCDK::IResolvable, nil) (defaults to: nil)

    Whether to use Amazon EBS-optimized instances.

  • volume_configurations (AWSCDK::IResolvable, Array<AWSCDK::IResolvable, AWSCDK::OpsWorks::CfnLayer::VolumeConfigurationProperty>, nil) (defaults to: nil)

    A VolumeConfigurations object that describes the layer's Amazon EBS volumes.



28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# File 'ops_works/cfn_layer_props.rb', line 28

def initialize(auto_assign_elastic_ips:, auto_assign_public_ips:, enable_auto_healing:, name:, shortname:, stack_id:, type:, attributes: nil, custom_instance_profile_arn: nil, custom_json: nil, custom_recipes: nil, custom_security_group_ids: nil, install_updates_on_boot: nil, lifecycle_event_configuration: nil, load_based_auto_scaling: nil, packages: nil, tags: nil, use_ebs_optimized_instances: nil, volume_configurations: nil)
  @auto_assign_elastic_ips = auto_assign_elastic_ips
  Jsii::Type.check_type(@auto_assign_elastic_ips, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoiYm9vbGVhbiJ9LHsiZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifV19fQ==")), "autoAssignElasticIps")
  @auto_assign_public_ips = auto_assign_public_ips
  Jsii::Type.check_type(@auto_assign_public_ips, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoiYm9vbGVhbiJ9LHsiZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifV19fQ==")), "autoAssignPublicIps")
  @enable_auto_healing = enable_auto_healing
  Jsii::Type.check_type(@enable_auto_healing, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoiYm9vbGVhbiJ9LHsiZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifV19fQ==")), "enableAutoHealing")
  @name = name
  Jsii::Type.check_type(@name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "name")
  @shortname = shortname
  Jsii::Type.check_type(@shortname, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "shortname")
  @stack_id = stack_id
  Jsii::Type.check_type(@stack_id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "stackId")
  @type = type
  Jsii::Type.check_type(@type, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "type")
  @attributes = attributes
  Jsii::Type.check_type(@attributes, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsicHJpbWl0aXZlIjoic3RyaW5nIn0sImtpbmQiOiJtYXAifX1dfX0=")), "attributes") unless @attributes.nil?
  @custom_instance_profile_arn = custom_instance_profile_arn
  Jsii::Type.check_type(@custom_instance_profile_arn, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "customInstanceProfileArn") unless @custom_instance_profile_arn.nil?
  @custom_json = custom_json
  Jsii::Type.check_type(@custom_json, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJhbnkifQ==")), "customJson") unless @custom_json.nil?
  @custom_recipes = custom_recipes.is_a?(Hash) ? ::AWSCDK::OpsWorks::CfnLayer::RecipesProperty.new(**custom_recipes.transform_keys(&:to_sym)) : custom_recipes
  Jsii::Type.check_type(@custom_recipes, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19vcHN3b3Jrcy5DZm5MYXllci5SZWNpcGVzUHJvcGVydHkifV19fQ==")), "customRecipes") unless @custom_recipes.nil?
  @custom_security_group_ids = custom_security_group_ids
  Jsii::Type.check_type(@custom_security_group_ids, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "customSecurityGroupIds") unless @custom_security_group_ids.nil?
  @install_updates_on_boot = install_updates_on_boot
  Jsii::Type.check_type(@install_updates_on_boot, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoiYm9vbGVhbiJ9LHsiZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifV19fQ==")), "installUpdatesOnBoot") unless @install_updates_on_boot.nil?
  @lifecycle_event_configuration = lifecycle_event_configuration.is_a?(Hash) ? ::AWSCDK::OpsWorks::CfnLayer::LifecycleEventConfigurationProperty.new(**lifecycle_event_configuration.transform_keys(&:to_sym)) : lifecycle_event_configuration
  Jsii::Type.check_type(@lifecycle_event_configuration, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19vcHN3b3Jrcy5DZm5MYXllci5MaWZlY3ljbGVFdmVudENvbmZpZ3VyYXRpb25Qcm9wZXJ0eSJ9XX19")), "lifecycleEventConfiguration") unless @lifecycle_event_configuration.nil?
  @load_based_auto_scaling = load_based_auto_scaling.is_a?(Hash) ? ::AWSCDK::OpsWorks::CfnLayer::LoadBasedAutoScalingProperty.new(**load_based_auto_scaling.transform_keys(&:to_sym)) : load_based_auto_scaling
  Jsii::Type.check_type(@load_based_auto_scaling, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19vcHN3b3Jrcy5DZm5MYXllci5Mb2FkQmFzZWRBdXRvU2NhbGluZ1Byb3BlcnR5In1dfX0=")), "loadBasedAutoScaling") unless @load_based_auto_scaling.nil?
  @packages = packages
  Jsii::Type.check_type(@packages, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "packages") unless @packages.nil?
  @tags = tags.is_a?(Array) ? tags.map { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::CfnTag.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : tags
  Jsii::Type.check_type(@tags, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLkNmblRhZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "tags") unless @tags.nil?
  @use_ebs_optimized_instances = use_ebs_optimized_instances
  Jsii::Type.check_type(@use_ebs_optimized_instances, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoiYm9vbGVhbiJ9LHsiZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifV19fQ==")), "useEbsOptimizedInstances") unless @use_ebs_optimized_instances.nil?
  @volume_configurations = volume_configurations
  Jsii::Type.check_type(@volume_configurations, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3Nfb3Bzd29ya3MuQ2ZuTGF5ZXIuVm9sdW1lQ29uZmlndXJhdGlvblByb3BlcnR5In1dfX0sImtpbmQiOiJhcnJheSJ9fV19fQ==")), "volumeConfigurations") unless @volume_configurations.nil?
end

Instance Attribute Details

#attributesAWSCDK::IResolvable, ... (readonly)

One or more user-defined key-value pairs to be added to the stack attributes.

To create a cluster layer, set the EcsClusterArn attribute to the cluster's ARN.



120
121
122
# File 'ops_works/cfn_layer_props.rb', line 120

def attributes
  @attributes
end

#auto_assign_elastic_ipsBoolean, AWSCDK::IResolvable (readonly)

Whether to automatically assign an Elastic IP address to the layer's instances. For more information, see How to Edit a Layer .



73
74
75
# File 'ops_works/cfn_layer_props.rb', line 73

def auto_assign_elastic_ips
  @auto_assign_elastic_ips
end

#auto_assign_public_ipsBoolean, AWSCDK::IResolvable (readonly)

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 .



80
81
82
# File 'ops_works/cfn_layer_props.rb', line 80

def auto_assign_public_ips
  @auto_assign_public_ips
end

#custom_instance_profile_arnString? (readonly)

The ARN of an IAM profile to be used for the layer's EC2 instances.

For more information about IAM ARNs, see Using Identifiers .



127
128
129
# File 'ops_works/cfn_layer_props.rb', line 127

def custom_instance_profile_arn
  @custom_instance_profile_arn
end

#custom_jsonObject? (readonly)

A JSON-formatted string containing custom stack configuration and deployment attributes to be installed on the layer's instances.

For more information, see Using Custom JSON . This feature is supported as of version 1.7.42 of the AWS CLI .



134
135
136
# File 'ops_works/cfn_layer_props.rb', line 134

def custom_json
  @custom_json
end

#custom_recipesAWSCDK::IResolvable, ... (readonly)

A LayerCustomRecipes object that specifies the layer custom recipes.



139
140
141
# File 'ops_works/cfn_layer_props.rb', line 139

def custom_recipes
  @custom_recipes
end

#custom_security_group_idsArray<String>? (readonly)

An array containing the layer custom security group IDs.



144
145
146
# File 'ops_works/cfn_layer_props.rb', line 144

def custom_security_group_ids
  @custom_security_group_ids
end

#enable_auto_healingBoolean, AWSCDK::IResolvable (readonly)

Whether to disable auto healing for the layer.



85
86
87
# File 'ops_works/cfn_layer_props.rb', line 85

def enable_auto_healing
  @enable_auto_healing
end

#install_updates_on_bootBoolean, ... (readonly)

Whether to install operating system and package updates when the instance boots.

The default value is true . To control when updates are installed, set this value to false . You must then update your instances manually by using CreateDeployment to run the update_dependencies stack command or by manually running yum (Amazon Linux) or apt-get (Ubuntu) on the instances.

To ensure that your instances have the latest security updates, we strongly recommend using the default value of true .



153
154
155
# File 'ops_works/cfn_layer_props.rb', line 153

def install_updates_on_boot
  @install_updates_on_boot
end

#lifecycle_event_configurationAWSCDK::IResolvable, ... (readonly)

A LifeCycleEventConfiguration object that you can use to configure the Shutdown event to specify an execution timeout and enable or disable Elastic Load Balancer connection draining.



158
159
160
# File 'ops_works/cfn_layer_props.rb', line 158

def lifecycle_event_configuration
  @lifecycle_event_configuration
end

#load_based_auto_scalingAWSCDK::IResolvable, ... (readonly)

The load-based scaling configuration for the OpsWorks layer.



163
164
165
# File 'ops_works/cfn_layer_props.rb', line 163

def load_based_auto_scaling
  @load_based_auto_scaling
end

#nameString (readonly)

The layer name, which is used by the console.

Layer names can be a maximum of 32 characters.



92
93
94
# File 'ops_works/cfn_layer_props.rb', line 92

def name
  @name
end

#packagesArray<String>? (readonly)

An array of Package objects that describes the layer packages.



168
169
170
# File 'ops_works/cfn_layer_props.rb', line 168

def packages
  @packages
end

#shortnameString (readonly)

For custom layers only, use this parameter to specify the layer's short name, which is used internally by OpsWorks Stacks and by Chef recipes.

The short name is also used as the name for the directory where your app files are installed. It can have a maximum of 32 characters, which are limited to the alphanumeric characters, '-', '_', and '.'.

Built-in layer short names are defined by OpsWorks Stacks. For more information, see the Layer Reference .



101
102
103
# File 'ops_works/cfn_layer_props.rb', line 101

def shortname
  @shortname
end

#stack_idString (readonly)

The layer stack ID.



106
107
108
# File 'ops_works/cfn_layer_props.rb', line 106

def stack_id
  @stack_id
end

#tagsArray<AWSCDK::CfnTag>? (readonly)

Specifies one or more sets of tags (key–value pairs) to associate with this OpsWorks layer.

Use tags to manage your resources.



175
176
177
# File 'ops_works/cfn_layer_props.rb', line 175

def tags
  @tags
end

#typeString (readonly)

The layer type.

A stack cannot have more than one built-in layer of the same type. It can have any number of custom layers. Built-in layers are not available in Chef 12 stacks.



113
114
115
# File 'ops_works/cfn_layer_props.rb', line 113

def type
  @type
end

#use_ebs_optimized_instancesBoolean, ... (readonly)

Whether to use Amazon EBS-optimized instances.



180
181
182
# File 'ops_works/cfn_layer_props.rb', line 180

def use_ebs_optimized_instances
  @use_ebs_optimized_instances
end

#volume_configurationsAWSCDK::IResolvable, ... (readonly)

A VolumeConfigurations object that describes the layer's Amazon EBS volumes.



185
186
187
# File 'ops_works/cfn_layer_props.rb', line 185

def volume_configurations
  @volume_configurations
end

Class Method Details

.jsii_propertiesObject



187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
# File 'ops_works/cfn_layer_props.rb', line 187

def self.jsii_properties
  {
    :auto_assign_elastic_ips => "autoAssignElasticIps",
    :auto_assign_public_ips => "autoAssignPublicIps",
    :enable_auto_healing => "enableAutoHealing",
    :name => "name",
    :shortname => "shortname",
    :stack_id => "stackId",
    :type => "type",
    :attributes => "attributes",
    :custom_instance_profile_arn => "customInstanceProfileArn",
    :custom_json => "customJson",
    :custom_recipes => "customRecipes",
    :custom_security_group_ids => "customSecurityGroupIds",
    :install_updates_on_boot => "installUpdatesOnBoot",
    :lifecycle_event_configuration => "lifecycleEventConfiguration",
    :load_based_auto_scaling => "loadBasedAutoScaling",
    :packages => "packages",
    :tags => "tags",
    :use_ebs_optimized_instances => "useEbsOptimizedInstances",
    :volume_configurations => "volumeConfigurations",
  }
end

Instance Method Details

#to_jsiiObject



211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
# File 'ops_works/cfn_layer_props.rb', line 211

def to_jsii
  result = {}
  result.merge!({
    "autoAssignElasticIps" => @auto_assign_elastic_ips,
    "autoAssignPublicIps" => @auto_assign_public_ips,
    "enableAutoHealing" => @enable_auto_healing,
    "name" => @name,
    "shortname" => @shortname,
    "stackId" => @stack_id,
    "type" => @type,
    "attributes" => @attributes,
    "customInstanceProfileArn" => @custom_instance_profile_arn,
    "customJson" => @custom_json,
    "customRecipes" => @custom_recipes,
    "customSecurityGroupIds" => @custom_security_group_ids,
    "installUpdatesOnBoot" => @install_updates_on_boot,
    "lifecycleEventConfiguration" => @lifecycle_event_configuration,
    "loadBasedAutoScaling" => @load_based_auto_scaling,
    "packages" => @packages,
    "tags" => @tags,
    "useEbsOptimizedInstances" => @use_ebs_optimized_instances,
    "volumeConfigurations" => @volume_configurations,
  })
  result.compact
end