Class CfnLayer
- All Implemented Interfaces:
IConstruct,IDependable,IInspectable,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct
AWS::OpsWorks::Layer.
Creates a layer. For more information, see How to Create a Layer .
You should use CreateLayer for noncustom layer types such as PHP App Server only if the stack does not have an existing layer of that type. A stack can have at most one instance of each noncustom layer; if you attempt to create a second instance, CreateLayer fails. A stack can have an arbitrary number of custom layers, so you can call CreateLayer as many times as you like for that layer type.
Required Permissions : To use this action, an IAM user must have a Manage permissions level for the stack, or an attached policy that explicitly grants permissions. For more information on user permissions, see Managing User Permissions .
Example:
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.opsworks.*;
Object customJson;
CfnLayer cfnLayer = CfnLayer.Builder.create(this, "MyCfnLayer")
.autoAssignElasticIps(false)
.autoAssignPublicIps(false)
.enableAutoHealing(false)
.name("name")
.shortname("shortname")
.stackId("stackId")
.type("type")
// the properties below are optional
.attributes(Map.of(
"attributesKey", "attributes"))
.customInstanceProfileArn("customInstanceProfileArn")
.customJson(customJson)
.customRecipes(RecipesProperty.builder()
.configure(List.of("configure"))
.deploy(List.of("deploy"))
.setup(List.of("setup"))
.shutdown(List.of("shutdown"))
.undeploy(List.of("undeploy"))
.build())
.customSecurityGroupIds(List.of("customSecurityGroupIds"))
.installUpdatesOnBoot(false)
.lifecycleEventConfiguration(LifecycleEventConfigurationProperty.builder()
.shutdownEventConfiguration(ShutdownEventConfigurationProperty.builder()
.delayUntilElbConnectionsDrained(false)
.executionTimeout(123)
.build())
.build())
.loadBasedAutoScaling(LoadBasedAutoScalingProperty.builder()
.downScaling(AutoScalingThresholdsProperty.builder()
.cpuThreshold(123)
.ignoreMetricsTime(123)
.instanceCount(123)
.loadThreshold(123)
.memoryThreshold(123)
.thresholdsWaitTime(123)
.build())
.enable(false)
.upScaling(AutoScalingThresholdsProperty.builder()
.cpuThreshold(123)
.ignoreMetricsTime(123)
.instanceCount(123)
.loadThreshold(123)
.memoryThreshold(123)
.thresholdsWaitTime(123)
.build())
.build())
.packages(List.of("packages"))
.tags(List.of(CfnTag.builder()
.key("key")
.value("value")
.build()))
.useEbsOptimizedInstances(false)
.volumeConfigurations(List.of(VolumeConfigurationProperty.builder()
.encrypted(false)
.iops(123)
.mountPoint("mountPoint")
.numberOfDisks(123)
.raidLevel(123)
.size(123)
.volumeType("volumeType")
.build()))
.build();
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceDescribes a load-based auto scaling upscaling or downscaling threshold configuration, which specifies when AWS OpsWorks Stacks starts or stops load-based instances.static final classA fluent builder forCfnLayer.static interfaceSpecifies the lifecycle event configuration.static interfaceDescribes a layer's load-based auto scaling configuration.static interfaceAWS OpsWorks Stacks supports five lifecycle events: setup , configuration , deploy , undeploy , and shutdown .static interfaceThe Shutdown event configuration.static interfaceDescribes an Amazon EBS volume configuration.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.amazon.awscdk.core.IConstruct
IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.core.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$Proxy -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe CloudFormation resource type name for this resource class. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionOne or more user-defined key-value pairs to be added to the stack attributes.Whether to automatically assign an Elastic IP address to the layer's instances.For stacks that are running in a VPC, whether to automatically assign a public IP address to the layer's instances.The ARN of an IAM profile to be used for the layer's EC2 instances.A JSON-formatted string containing custom stack configuration and deployment attributes to be installed on the layer's instances.ALayerCustomRecipesobject that specifies the layer custom recipes.An array containing the layer custom security group IDs.Whether to disable auto healing for the layer.Whether to install operating system and package updates when the instance boots.ALifeCycleEventConfigurationobject that you can use to configure the Shutdown event to specify an execution timeout and enable or disable Elastic Load Balancer connection draining.The load-based scaling configuration for the AWS OpsWorks layer.getName()The layer name, which is used by the console.An array ofPackageobjects that describes the layer packages.For custom layers only, use this parameter to specify the layer's short name, which is used internally by AWS OpsWorks Stacks and by Chef recipes.The layer stack ID.getTags()Specifies one or more sets of tags (key–value pairs) to associate with this AWS OpsWorks layer.getType()The layer type.Whether to use Amazon EBS-optimized instances.AVolumeConfigurationsobject that describes the layer's Amazon EBS volumes.voidinspect(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.renderProperties(Map<String, Object> props) voidsetAttributes(Map<String, String> value) One or more user-defined key-value pairs to be added to the stack attributes.voidsetAttributes(IResolvable value) One or more user-defined key-value pairs to be added to the stack attributes.voidsetAutoAssignElasticIps(Boolean value) Whether to automatically assign an Elastic IP address to the layer's instances.voidWhether to automatically assign an Elastic IP address to the layer's instances.voidsetAutoAssignPublicIps(Boolean value) For stacks that are running in a VPC, whether to automatically assign a public IP address to the layer's instances.voidFor stacks that are running in a VPC, whether to automatically assign a public IP address to the layer's instances.voidThe ARN of an IAM profile to be used for the layer's EC2 instances.voidsetCustomJson(Object value) A JSON-formatted string containing custom stack configuration and deployment attributes to be installed on the layer's instances.voidsetCustomRecipes(IResolvable value) ALayerCustomRecipesobject that specifies the layer custom recipes.voidALayerCustomRecipesobject that specifies the layer custom recipes.voidsetCustomSecurityGroupIds(List<String> value) An array containing the layer custom security group IDs.voidsetEnableAutoHealing(Boolean value) Whether to disable auto healing for the layer.voidsetEnableAutoHealing(IResolvable value) Whether to disable auto healing for the layer.voidsetInstallUpdatesOnBoot(Boolean value) Whether to install operating system and package updates when the instance boots.voidWhether to install operating system and package updates when the instance boots.voidALifeCycleEventConfigurationobject that you can use to configure the Shutdown event to specify an execution timeout and enable or disable Elastic Load Balancer connection draining.voidALifeCycleEventConfigurationobject that you can use to configure the Shutdown event to specify an execution timeout and enable or disable Elastic Load Balancer connection draining.voidThe load-based scaling configuration for the AWS OpsWorks layer.voidThe load-based scaling configuration for the AWS OpsWorks layer.voidThe layer name, which is used by the console.voidsetPackages(List<String> value) An array ofPackageobjects that describes the layer packages.voidsetShortname(String value) For custom layers only, use this parameter to specify the layer's short name, which is used internally by AWS OpsWorks Stacks and by Chef recipes.voidsetStackId(String value) The layer stack ID.voidThe layer type.voidWhether to use Amazon EBS-optimized instances.voidWhether to use Amazon EBS-optimized instances.voidsetVolumeConfigurations(List<Object> value) AVolumeConfigurationsobject that describes the layer's Amazon EBS volumes.voidAVolumeConfigurationsobject that describes the layer's Amazon EBS volumes.Methods inherited from class software.amazon.awscdk.core.CfnResource
addDeletionOverride, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, isCfnResource, shouldSynthesize, toString, validatePropertiesMethods inherited from class software.amazon.awscdk.core.CfnRefElement
getRefMethods inherited from class software.amazon.awscdk.core.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalIdMethods inherited from class software.amazon.awscdk.core.Construct
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validateMethods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
-
-
Constructor Details
-
CfnLayer
protected CfnLayer(software.amazon.jsii.JsiiObjectRef objRef) -
CfnLayer
protected CfnLayer(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
CfnLayer
@Stability(Stable) public CfnLayer(@NotNull Construct scope, @NotNull String id, @NotNull CfnLayerProps props) Create a newAWS::OpsWorks::Layer.- Parameters:
scope-- scope in which this resource is defined.
id-- scoped id of the resource.
props-- resource properties.
-
-
Method Details
-
inspect
Examines the CloudFormation resource and discloses attributes.- Specified by:
inspectin interfaceIInspectable- Parameters:
inspector-- tree inspector to collect and process attributes.
-
renderProperties
@Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String, Object> props) - Overrides:
renderPropertiesin classCfnResource- Parameters:
props- This parameter is required.
-
getCfnProperties
- Overrides:
getCfnPropertiesin classCfnResource
-
getTags
Specifies one or more sets of tags (key–value pairs) to associate with this AWS OpsWorks layer.Use tags to manage your resources.
-
getAutoAssignElasticIps
Whether to automatically assign an Elastic IP address to the layer's instances. For more information, see How to Edit a Layer . -
setAutoAssignElasticIps
Whether to automatically assign an Elastic IP address to the layer's instances. For more information, see How to Edit a Layer . -
setAutoAssignElasticIps
Whether to automatically assign an Elastic IP address to the layer's instances. For more information, see How to Edit a Layer . -
getAutoAssignPublicIps
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 .
-
setAutoAssignPublicIps
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 .
-
setAutoAssignPublicIps
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 .
-
getCustomJson
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 .
-
setCustomJson
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 .
-
getEnableAutoHealing
Whether to disable auto healing for the layer. -
setEnableAutoHealing
Whether to disable auto healing for the layer. -
setEnableAutoHealing
Whether to disable auto healing for the layer. -
getName
The layer name, which is used by the console.Layer names can be a maximum of 32 characters.
-
setName
The layer name, which is used by the console.Layer names can be a maximum of 32 characters.
-
getShortname
For custom layers only, use this parameter to specify the layer's short name, which is used internally by AWS 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 AWS OpsWorks Stacks. For more information, see the Layer Reference .
-
setShortname
For custom layers only, use this parameter to specify the layer's short name, which is used internally by AWS 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 AWS OpsWorks Stacks. For more information, see the Layer Reference .
-
getStackId
The layer stack ID. -
setStackId
The layer stack ID. -
getType
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.
-
setType
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.
-
getAttributes
One or more user-defined key-value pairs to be added to the stack attributes.To create a cluster layer, set the
EcsClusterArnattribute to the cluster's ARN. -
setAttributes
One or more user-defined key-value pairs to be added to the stack attributes.To create a cluster layer, set the
EcsClusterArnattribute to the cluster's ARN. -
setAttributes
One or more user-defined key-value pairs to be added to the stack attributes.To create a cluster layer, set the
EcsClusterArnattribute to the cluster's ARN. -
getCustomInstanceProfileArn
The ARN of an IAM profile to be used for the layer's EC2 instances.For more information about IAM ARNs, see Using Identifiers .
-
setCustomInstanceProfileArn
The ARN of an IAM profile to be used for the layer's EC2 instances.For more information about IAM ARNs, see Using Identifiers .
-
getCustomRecipes
ALayerCustomRecipesobject that specifies the layer custom recipes. -
setCustomRecipes
ALayerCustomRecipesobject that specifies the layer custom recipes. -
setCustomRecipes
ALayerCustomRecipesobject that specifies the layer custom recipes. -
getCustomSecurityGroupIds
An array containing the layer custom security group IDs. -
setCustomSecurityGroupIds
An array containing the layer custom security group IDs. -
getInstallUpdatesOnBoot
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 tofalse. You must then update your instances manually by using CreateDeployment to run theupdate_dependenciesstack command or by manually runningyum(Amazon Linux) orapt-get(Ubuntu) on the instances.To ensure that your instances have the latest security updates, we strongly recommend using the default value of
true. -
setInstallUpdatesOnBoot
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 tofalse. You must then update your instances manually by using CreateDeployment to run theupdate_dependenciesstack command or by manually runningyum(Amazon Linux) orapt-get(Ubuntu) on the instances.To ensure that your instances have the latest security updates, we strongly recommend using the default value of
true. -
setInstallUpdatesOnBoot
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 tofalse. You must then update your instances manually by using CreateDeployment to run theupdate_dependenciesstack command or by manually runningyum(Amazon Linux) orapt-get(Ubuntu) on the instances.To ensure that your instances have the latest security updates, we strongly recommend using the default value of
true. -
getLifecycleEventConfiguration
ALifeCycleEventConfigurationobject that you can use to configure the Shutdown event to specify an execution timeout and enable or disable Elastic Load Balancer connection draining. -
setLifecycleEventConfiguration
ALifeCycleEventConfigurationobject that you can use to configure the Shutdown event to specify an execution timeout and enable or disable Elastic Load Balancer connection draining. -
setLifecycleEventConfiguration
@Stability(Stable) public void setLifecycleEventConfiguration(@Nullable CfnLayer.LifecycleEventConfigurationProperty value) ALifeCycleEventConfigurationobject that you can use to configure the Shutdown event to specify an execution timeout and enable or disable Elastic Load Balancer connection draining. -
getLoadBasedAutoScaling
The load-based scaling configuration for the AWS OpsWorks layer. -
setLoadBasedAutoScaling
The load-based scaling configuration for the AWS OpsWorks layer. -
setLoadBasedAutoScaling
@Stability(Stable) public void setLoadBasedAutoScaling(@Nullable CfnLayer.LoadBasedAutoScalingProperty value) The load-based scaling configuration for the AWS OpsWorks layer. -
getPackages
An array ofPackageobjects that describes the layer packages. -
setPackages
An array ofPackageobjects that describes the layer packages. -
getUseEbsOptimizedInstances
Whether to use Amazon EBS-optimized instances. -
setUseEbsOptimizedInstances
Whether to use Amazon EBS-optimized instances. -
setUseEbsOptimizedInstances
Whether to use Amazon EBS-optimized instances. -
getVolumeConfigurations
AVolumeConfigurationsobject that describes the layer's Amazon EBS volumes. -
setVolumeConfigurations
AVolumeConfigurationsobject that describes the layer's Amazon EBS volumes. -
setVolumeConfigurations
AVolumeConfigurationsobject that describes the layer's Amazon EBS volumes.
-