@Generated(value="jsii-pacmak/1.63.2 (build a8a8833)", date="2022-08-09T19:16:34.264Z") public class CfnLayer extends CfnResource implements IInspectable
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();
Modifier and Type | Class and Description |
---|---|
static interface |
CfnLayer.AutoScalingThresholdsProperty
Describes a load-based auto scaling upscaling or downscaling threshold configuration, which specifies when AWS OpsWorks Stacks starts or stops load-based instances.
|
static class |
CfnLayer.Builder
A fluent builder for
CfnLayer . |
static interface |
CfnLayer.LifecycleEventConfigurationProperty
Specifies the lifecycle event configuration.
|
static interface |
CfnLayer.LoadBasedAutoScalingProperty
Describes a layer's load-based auto scaling configuration.
|
static interface |
CfnLayer.RecipesProperty
AWS OpsWorks Stacks supports five lifecycle events: *setup* , *configuration* , *deploy* , *undeploy* , and *shutdown* .
|
static interface |
CfnLayer.ShutdownEventConfigurationProperty
The Shutdown event configuration.
|
static interface |
CfnLayer.VolumeConfigurationProperty
Describes an Amazon EBS volume configuration.
|
IInspectable.Jsii$Default, IInspectable.Jsii$Proxy
IConstruct.Jsii$Default
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
|
Modifier | Constructor and Description |
---|---|
|
CfnLayer(Construct scope,
java.lang.String id,
CfnLayerProps props)
Create a new `AWS::OpsWorks::Layer`.
|
protected |
CfnLayer(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
CfnLayer(software.amazon.jsii.JsiiObjectRef objRef) |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
getAttributes()
One or more user-defined key-value pairs to be added to the stack attributes.
|
java.lang.Object |
getAutoAssignElasticIps()
Whether to automatically assign an [Elastic IP address](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html) to the layer's instances.
|
java.lang.Object |
getAutoAssignPublicIps()
For stacks that are running in a VPC, whether to automatically assign a public IP address to the layer's instances.
|
protected java.util.Map<java.lang.String,java.lang.Object> |
getCfnProperties() |
java.lang.String |
getCustomInstanceProfileArn()
The ARN of an IAM profile to be used for the layer's EC2 instances.
|
java.lang.Object |
getCustomJson()
A JSON-formatted string containing custom stack configuration and deployment attributes to be installed on the layer's instances.
|
java.lang.Object |
getCustomRecipes()
A `LayerCustomRecipes` object that specifies the layer custom recipes.
|
java.util.List<java.lang.String> |
getCustomSecurityGroupIds()
An array containing the layer custom security group IDs.
|
java.lang.Object |
getEnableAutoHealing()
Whether to disable auto healing for the layer.
|
java.lang.Object |
getInstallUpdatesOnBoot()
Whether to install operating system and package updates when the instance boots.
|
java.lang.Object |
getLifecycleEventConfiguration()
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.
|
java.lang.Object |
getLoadBasedAutoScaling()
The load-based scaling configuration for the AWS OpsWorks layer.
|
java.lang.String |
getName()
The layer name, which is used by the console.
|
java.util.List<java.lang.String> |
getPackages()
An array of `Package` objects that describes the layer packages.
|
java.lang.String |
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.
|
java.lang.String |
getStackId()
The layer stack ID.
|
TagManager |
getTags()
Specifies one or more sets of tags (key–value pairs) to associate with this AWS OpsWorks layer.
|
java.lang.String |
getType()
The layer type.
|
java.lang.Object |
getUseEbsOptimizedInstances()
Whether to use Amazon EBS-optimized instances.
|
java.lang.Object |
getVolumeConfigurations()
A `VolumeConfigurations` object that describes the layer's Amazon EBS volumes.
|
void |
inspect(TreeInspector inspector)
Examines the CloudFormation resource and discloses attributes.
|
protected java.util.Map<java.lang.String,java.lang.Object> |
renderProperties(java.util.Map<java.lang.String,java.lang.Object> props) |
void |
setAttributes(IResolvable value)
One or more user-defined key-value pairs to be added to the stack attributes.
|
void |
setAttributes(java.util.Map<java.lang.String,java.lang.String> value)
One or more user-defined key-value pairs to be added to the stack attributes.
|
void |
setAutoAssignElasticIps(java.lang.Boolean value)
Whether to automatically assign an [Elastic IP address](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html) to the layer's instances.
|
void |
setAutoAssignElasticIps(IResolvable value)
Whether to automatically assign an [Elastic IP address](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html) to the layer's instances.
|
void |
setAutoAssignPublicIps(java.lang.Boolean value)
For stacks that are running in a VPC, whether to automatically assign a public IP address to the layer's instances.
|
void |
setAutoAssignPublicIps(IResolvable value)
For stacks that are running in a VPC, whether to automatically assign a public IP address to the layer's instances.
|
void |
setCustomInstanceProfileArn(java.lang.String value)
The ARN of an IAM profile to be used for the layer's EC2 instances.
|
void |
setCustomJson(java.lang.Object value)
A JSON-formatted string containing custom stack configuration and deployment attributes to be installed on the layer's instances.
|
void |
setCustomRecipes(CfnLayer.RecipesProperty value)
A `LayerCustomRecipes` object that specifies the layer custom recipes.
|
void |
setCustomRecipes(IResolvable value)
A `LayerCustomRecipes` object that specifies the layer custom recipes.
|
void |
setCustomSecurityGroupIds(java.util.List<java.lang.String> value)
An array containing the layer custom security group IDs.
|
void |
setEnableAutoHealing(java.lang.Boolean value)
Whether to disable auto healing for the layer.
|
void |
setEnableAutoHealing(IResolvable value)
Whether to disable auto healing for the layer.
|
void |
setInstallUpdatesOnBoot(java.lang.Boolean value)
Whether to install operating system and package updates when the instance boots.
|
void |
setInstallUpdatesOnBoot(IResolvable value)
Whether to install operating system and package updates when the instance boots.
|
void |
setLifecycleEventConfiguration(CfnLayer.LifecycleEventConfigurationProperty value)
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.
|
void |
setLifecycleEventConfiguration(IResolvable value)
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.
|
void |
setLoadBasedAutoScaling(CfnLayer.LoadBasedAutoScalingProperty value)
The load-based scaling configuration for the AWS OpsWorks layer.
|
void |
setLoadBasedAutoScaling(IResolvable value)
The load-based scaling configuration for the AWS OpsWorks layer.
|
void |
setName(java.lang.String value)
The layer name, which is used by the console.
|
void |
setPackages(java.util.List<java.lang.String> value)
An array of `Package` objects that describes the layer packages.
|
void |
setShortname(java.lang.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.
|
void |
setStackId(java.lang.String value)
The layer stack ID.
|
void |
setType(java.lang.String value)
The layer type.
|
void |
setUseEbsOptimizedInstances(java.lang.Boolean value)
Whether to use Amazon EBS-optimized instances.
|
void |
setUseEbsOptimizedInstances(IResolvable value)
Whether to use Amazon EBS-optimized instances.
|
void |
setVolumeConfigurations(IResolvable value)
A `VolumeConfigurations` object that describes the layer's Amazon EBS volumes.
|
void |
setVolumeConfigurations(java.util.List<java.lang.Object> value)
A `VolumeConfigurations` object that describes the layer's Amazon EBS volumes.
|
addDeletionOverride, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, isCfnResource, shouldSynthesize, toString, validateProperties
getRef
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalId
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validate
public static final java.lang.String CFN_RESOURCE_TYPE_NAME
protected CfnLayer(software.amazon.jsii.JsiiObjectRef objRef)
protected CfnLayer(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
public CfnLayer(Construct scope, java.lang.String id, CfnLayerProps props)
scope
- - scope in which this resource is defined. This parameter is required.id
- - scoped id of the resource. This parameter is required.props
- - resource properties. This parameter is required.public void inspect(TreeInspector inspector)
inspect
in interface IInspectable
inspector
- - tree inspector to collect and process attributes. This parameter is required.protected java.util.Map<java.lang.String,java.lang.Object> renderProperties(java.util.Map<java.lang.String,java.lang.Object> props)
renderProperties
in class CfnResource
props
- This parameter is required.protected java.util.Map<java.lang.String,java.lang.Object> getCfnProperties()
getCfnProperties
in class CfnResource
public TagManager getTags()
Use tags to manage your resources.
public java.lang.Object getAutoAssignElasticIps()
public void setAutoAssignElasticIps(java.lang.Boolean value)
public void setAutoAssignElasticIps(IResolvable value)
public java.lang.Object getAutoAssignPublicIps()
For more information, see How to Edit a Layer .
public void setAutoAssignPublicIps(java.lang.Boolean value)
For more information, see How to Edit a Layer .
public void setAutoAssignPublicIps(IResolvable value)
For more information, see How to Edit a Layer .
public java.lang.Object getCustomJson()
For more information, see Using Custom JSON . This feature is supported as of version 1.7.42 of the AWS CLI .
public void setCustomJson(java.lang.Object value)
For more information, see Using Custom JSON . This feature is supported as of version 1.7.42 of the AWS CLI .
public java.lang.Object getEnableAutoHealing()
public void setEnableAutoHealing(java.lang.Boolean value)
public void setEnableAutoHealing(IResolvable value)
public java.lang.String getName()
Layer names can be a maximum of 32 characters.
public void setName(java.lang.String value)
Layer names can be a maximum of 32 characters.
public java.lang.String getShortname()
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 .
public void setShortname(java.lang.String value)
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 .
public java.lang.String getStackId()
public void setStackId(java.lang.String value)
public java.lang.String getType()
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.
public void setType(java.lang.String value)
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.
public java.lang.Object getAttributes()
To create a cluster layer, set the EcsClusterArn
attribute to the cluster's ARN.
public void setAttributes(IResolvable value)
To create a cluster layer, set the EcsClusterArn
attribute to the cluster's ARN.
public void setAttributes(java.util.Map<java.lang.String,java.lang.String> value)
To create a cluster layer, set the EcsClusterArn
attribute to the cluster's ARN.
public java.lang.String getCustomInstanceProfileArn()
For more information about IAM ARNs, see Using Identifiers .
public void setCustomInstanceProfileArn(java.lang.String value)
For more information about IAM ARNs, see Using Identifiers .
public java.lang.Object getCustomRecipes()
public void setCustomRecipes(IResolvable value)
public void setCustomRecipes(CfnLayer.RecipesProperty value)
public java.util.List<java.lang.String> getCustomSecurityGroupIds()
public void setCustomSecurityGroupIds(java.util.List<java.lang.String> value)
public java.lang.Object getInstallUpdatesOnBoot()
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
.
public void setInstallUpdatesOnBoot(java.lang.Boolean value)
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
.
public void setInstallUpdatesOnBoot(IResolvable value)
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
.
public java.lang.Object getLifecycleEventConfiguration()
public void setLifecycleEventConfiguration(IResolvable value)
public void setLifecycleEventConfiguration(CfnLayer.LifecycleEventConfigurationProperty value)
public java.lang.Object getLoadBasedAutoScaling()
public void setLoadBasedAutoScaling(IResolvable value)
public void setLoadBasedAutoScaling(CfnLayer.LoadBasedAutoScalingProperty value)
public java.util.List<java.lang.String> getPackages()
public void setPackages(java.util.List<java.lang.String> value)
public java.lang.Object getUseEbsOptimizedInstances()
public void setUseEbsOptimizedInstances(java.lang.Boolean value)
public void setUseEbsOptimizedInstances(IResolvable value)
public java.lang.Object getVolumeConfigurations()
public void setVolumeConfigurations(IResolvable value)
public void setVolumeConfigurations(java.util.List<java.lang.Object> value)