Class CfnLayer
java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.CfnElement
software.amazon.awscdk.CfnRefElement
software.amazon.awscdk.CfnResource
software.amazon.awscdk.services.opsworks.CfnLayer
- All Implemented Interfaces:
IInspectable,IEnvironmentAware,ILayerRef,ITaggable,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct,software.constructs.IDependable
@Generated(value="jsii-pacmak/1.121.0 (build d7af9b9)",
date="2025-12-18T18:20:14.244Z")
@Stability(Stable)
public class CfnLayer
extends CfnResource
implements IInspectable, ILayerRef, ITaggable
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-opsworks-layer.html.
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();
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceExample:static final classA fluent builder forCfnLayer.static interfaceExample:static interfaceExample:static interfaceExample:static interfaceExample:static interfaceExample:Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.interfaces.opsworks.ILayerRef
ILayerRef.Jsii$Default, ILayerRef.Jsii$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.ITaggable
ITaggable.Jsii$Default, ITaggable.Jsii$Proxy -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe CloudFormation resource type name for this resource class. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCfnLayer(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedCfnLayer(software.amazon.jsii.JsiiObjectRef objRef) CfnLayer(software.constructs.Construct scope, String id, CfnLayerProps props) Create a newAWS::OpsWorks::Layer. -
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.A reference to a Layer resource.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 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 OpsWorks Stacks and by Chef recipes.The layer stack ID.getTags()Tag Manager which manages the tags for this resource.Specifies one or more sets of tags (key–value pairs) to associate with this 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.static BooleanisCfnLayer(Object x) Checks whether the given object is a CfnLayer.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 OpsWorks layer.voidThe load-based scaling configuration for the 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 OpsWorks Stacks and by Chef recipes.voidsetStackId(String value) The layer stack ID.voidsetTagsRaw(List<CfnTag> value) Specifies one or more sets of tags (key–value pairs) to associate with this OpsWorks layer.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.CfnResource
addDeletionOverride, addDependency, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getAtt, getCfnOptions, getCfnResourceType, getEnv, getMetadata, getUpdatedProperites, getUpdatedProperties, isCfnResource, obtainDependencies, obtainResourceDependencies, removeDependency, replaceDependency, shouldSynthesize, toString, validatePropertiesMethods inherited from class software.amazon.awscdk.CfnRefElement
getRefMethods inherited from class software.amazon.awscdk.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalIdMethods inherited from class software.constructs.Construct
getNode, isConstructMethods 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.constructs.IConstruct
getNodeMethods inherited from interface software.amazon.awscdk.interfaces.IEnvironmentAware
getEnvMethods 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 software.constructs.Construct scope, @NotNull String id, @NotNull CfnLayerProps props) Create a newAWS::OpsWorks::Layer.- Parameters:
scope- Scope in which this resource is defined. This parameter is required.id- Construct identifier for this resource (unique in its scope). This parameter is required.props- Resource properties. This parameter is required.
-
-
Method Details
-
isCfnLayer
Checks whether the given object is a CfnLayer.- Parameters:
x- This parameter is required.
-
inspect
Examines the CloudFormation resource and discloses attributes.- Specified by:
inspectin interfaceIInspectable- Parameters:
inspector- tree inspector to collect and process attributes. This parameter is required.
-
renderProperties
@Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String, Object> props) - Overrides:
renderPropertiesin classCfnResource- Parameters:
props- This parameter is required.
-
getAttrId
-
getCfnProperties
- Overrides:
getCfnPropertiesin classCfnResource
-
getLayerRef
A reference to a Layer resource.- Specified by:
getLayerRefin interfaceILayerRef
-
getTags
Tag Manager which manages the tags for this resource. -
getAutoAssignElasticIps
Whether to automatically assign an Elastic IP address to the layer's instances. For more information, see How to Edit a Layer .Returns union: either
BooleanorIResolvable -
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.Returns union: either
BooleanorIResolvable -
setAutoAssignPublicIps
For stacks that are running in a VPC, whether to automatically assign a public IP address to the layer's instances. -
setAutoAssignPublicIps
For stacks that are running in a VPC, whether to automatically assign a public IP address to the layer's instances. -
getEnableAutoHealing
Whether to disable auto healing for the layer.Returns union: either
BooleanorIResolvable -
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. -
setName
The layer name, which is used by the console. -
getShortname
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. -
setShortname
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. -
getStackId
The layer stack ID. -
setStackId
The layer stack ID. -
getType
The layer type. -
setType
The layer type. -
getAttributes
One or more user-defined key-value pairs to be added to the stack attributes.Returns union: either Mapinvalid input: '<'String,
String> orIResolvable -
setAttributes
One or more user-defined key-value pairs to be added to the stack attributes. -
setAttributes
One or more user-defined key-value pairs to be added to the stack attributes. -
getCustomInstanceProfileArn
The ARN of an IAM profile to be used for the layer's EC2 instances. -
setCustomInstanceProfileArn
The ARN of an IAM profile to be used for the layer's EC2 instances. -
getCustomJson
A JSON-formatted string containing custom stack configuration and deployment attributes to be installed on the layer's instances. -
setCustomJson
A JSON-formatted string containing custom stack configuration and deployment attributes to be installed on the layer's instances. -
getCustomRecipes
ALayerCustomRecipesobject that specifies the layer custom recipes.Returns union: either
IResolvableorCfnLayer.RecipesProperty -
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.Returns union: either
BooleanorIResolvable -
setInstallUpdatesOnBoot
Whether to install operating system and package updates when the instance boots. -
setInstallUpdatesOnBoot
Whether to install operating system and package updates when the instance boots. -
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.Returns union: either
IResolvableorCfnLayer.LifecycleEventConfigurationProperty -
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 OpsWorks layer.Returns union: either
IResolvableorCfnLayer.LoadBasedAutoScalingProperty -
setLoadBasedAutoScaling
The load-based scaling configuration for the OpsWorks layer. -
setLoadBasedAutoScaling
@Stability(Stable) public void setLoadBasedAutoScaling(@Nullable CfnLayer.LoadBasedAutoScalingProperty value) The load-based scaling configuration for the OpsWorks layer. -
getPackages
An array ofPackageobjects that describes the layer packages. -
setPackages
An array ofPackageobjects that describes the layer packages. -
getTagsRaw
Specifies one or more sets of tags (key–value pairs) to associate with this OpsWorks layer. -
setTagsRaw
Specifies one or more sets of tags (key–value pairs) to associate with this OpsWorks layer. -
getUseEbsOptimizedInstances
Whether to use Amazon EBS-optimized instances.Returns union: either
BooleanorIResolvable -
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.Returns union: either
IResolvableor Listinvalid input: '<'eitherIResolvableorCfnLayer.VolumeConfigurationProperty> -
setVolumeConfigurations
AVolumeConfigurationsobject that describes the layer's Amazon EBS volumes. -
setVolumeConfigurations
AVolumeConfigurationsobject that describes the layer's Amazon EBS volumes.
-