java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
All Implemented Interfaces:
IInspectable, ITaggable, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct, software.constructs.IDependable

@Generated(value="jsii-pacmak/1.98.0 (build 00b106d)", date="2024-05-08T21:35:10.329Z") @Stability(Stable) public class CfnLayer extends CfnResource implements IInspectable, 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:
  • Field Details

    • CFN_RESOURCE_TYPE_NAME

      @Stability(Stable) public static final String 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)
      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

    • inspect

      @Stability(Stable) public void inspect(@NotNull TreeInspector inspector)
      Examines the CloudFormation resource and discloses attributes.

      Specified by:
      inspect in interface IInspectable
      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:
      renderProperties in class CfnResource
      Parameters:
      props - This parameter is required.
    • getAttrId

      @Stability(Stable) @NotNull public String getAttrId()
    • getCfnProperties

      @Stability(Stable) @NotNull protected Map<String,Object> getCfnProperties()
      Overrides:
      getCfnProperties in class CfnResource
    • getTags

      @Stability(Stable) @NotNull public TagManager getTags()
      Tag Manager which manages the tags for this resource.
      Specified by:
      getTags in interface ITaggable
    • getAutoAssignElasticIps

      @Stability(Stable) @NotNull public Object getAutoAssignElasticIps()
      Whether to automatically assign an Elastic IP address to the layer's instances. For more information, see How to Edit a Layer .
    • setAutoAssignElasticIps

      @Stability(Stable) public void setAutoAssignElasticIps(@NotNull Boolean value)
      Whether to automatically assign an Elastic IP address to the layer's instances. For more information, see How to Edit a Layer .
    • setAutoAssignElasticIps

      @Stability(Stable) public void setAutoAssignElasticIps(@NotNull IResolvable value)
      Whether to automatically assign an Elastic IP address to the layer's instances. For more information, see How to Edit a Layer .
    • getAutoAssignPublicIps

      @Stability(Stable) @NotNull public Object getAutoAssignPublicIps()
      For stacks that are running in a VPC, whether to automatically assign a public IP address to the layer's instances.
    • setAutoAssignPublicIps

      @Stability(Stable) public void setAutoAssignPublicIps(@NotNull Boolean value)
      For stacks that are running in a VPC, whether to automatically assign a public IP address to the layer's instances.
    • setAutoAssignPublicIps

      @Stability(Stable) public void setAutoAssignPublicIps(@NotNull IResolvable value)
      For stacks that are running in a VPC, whether to automatically assign a public IP address to the layer's instances.
    • getEnableAutoHealing

      @Stability(Stable) @NotNull public Object getEnableAutoHealing()
      Whether to disable auto healing for the layer.
    • setEnableAutoHealing

      @Stability(Stable) public void setEnableAutoHealing(@NotNull Boolean value)
      Whether to disable auto healing for the layer.
    • setEnableAutoHealing

      @Stability(Stable) public void setEnableAutoHealing(@NotNull IResolvable value)
      Whether to disable auto healing for the layer.
    • getName

      @Stability(Stable) @NotNull public String getName()
      The layer name, which is used by the console.
    • setName

      @Stability(Stable) public void setName(@NotNull String value)
      The layer name, which is used by the console.
    • getShortname

      @Stability(Stable) @NotNull public 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.
    • setShortname

      @Stability(Stable) public void setShortname(@NotNull 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.
    • getStackId

      @Stability(Stable) @NotNull public String getStackId()
      The layer stack ID.
    • setStackId

      @Stability(Stable) public void setStackId(@NotNull String value)
      The layer stack ID.
    • getType

      @Stability(Stable) @NotNull public String getType()
      The layer type.
    • setType

      @Stability(Stable) public void setType(@NotNull String value)
      The layer type.
    • getAttributes

      @Stability(Stable) @Nullable public Object getAttributes()
      One or more user-defined key-value pairs to be added to the stack attributes.
    • setAttributes

      @Stability(Stable) public void setAttributes(@Nullable IResolvable value)
      One or more user-defined key-value pairs to be added to the stack attributes.
    • setAttributes

      @Stability(Stable) public void setAttributes(@Nullable Map<String,String> value)
      One or more user-defined key-value pairs to be added to the stack attributes.
    • getCustomInstanceProfileArn

      @Stability(Stable) @Nullable public String getCustomInstanceProfileArn()
      The ARN of an IAM profile to be used for the layer's EC2 instances.
    • setCustomInstanceProfileArn

      @Stability(Stable) public void setCustomInstanceProfileArn(@Nullable String value)
      The ARN of an IAM profile to be used for the layer's EC2 instances.
    • getCustomJson

      @Stability(Stable) @Nullable public Object getCustomJson()
      A JSON-formatted string containing custom stack configuration and deployment attributes to be installed on the layer's instances.
    • setCustomJson

      @Stability(Stable) public void setCustomJson(@Nullable Object value)
      A JSON-formatted string containing custom stack configuration and deployment attributes to be installed on the layer's instances.
    • getCustomRecipes

      @Stability(Stable) @Nullable public Object getCustomRecipes()
      A LayerCustomRecipes object that specifies the layer custom recipes.
    • setCustomRecipes

      @Stability(Stable) public void setCustomRecipes(@Nullable IResolvable value)
      A LayerCustomRecipes object that specifies the layer custom recipes.
    • setCustomRecipes

      @Stability(Stable) public void setCustomRecipes(@Nullable CfnLayer.RecipesProperty value)
      A LayerCustomRecipes object that specifies the layer custom recipes.
    • getCustomSecurityGroupIds

      @Stability(Stable) @Nullable public List<String> getCustomSecurityGroupIds()
      An array containing the layer custom security group IDs.
    • setCustomSecurityGroupIds

      @Stability(Stable) public void setCustomSecurityGroupIds(@Nullable List<String> value)
      An array containing the layer custom security group IDs.
    • getInstallUpdatesOnBoot

      @Stability(Stable) @Nullable public Object getInstallUpdatesOnBoot()
      Whether to install operating system and package updates when the instance boots.
    • setInstallUpdatesOnBoot

      @Stability(Stable) public void setInstallUpdatesOnBoot(@Nullable Boolean value)
      Whether to install operating system and package updates when the instance boots.
    • setInstallUpdatesOnBoot

      @Stability(Stable) public void setInstallUpdatesOnBoot(@Nullable IResolvable value)
      Whether to install operating system and package updates when the instance boots.
    • getLifecycleEventConfiguration

      @Stability(Stable) @Nullable public 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.
    • setLifecycleEventConfiguration

      @Stability(Stable) public void setLifecycleEventConfiguration(@Nullable 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.
    • setLifecycleEventConfiguration

      @Stability(Stable) public void setLifecycleEventConfiguration(@Nullable 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.
    • getLoadBasedAutoScaling

      @Stability(Stable) @Nullable public Object getLoadBasedAutoScaling()
      The load-based scaling configuration for the AWS OpsWorks layer.
    • setLoadBasedAutoScaling

      @Stability(Stable) public void setLoadBasedAutoScaling(@Nullable IResolvable value)
      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

      @Stability(Stable) @Nullable public List<String> getPackages()
      An array of Package objects that describes the layer packages.
    • setPackages

      @Stability(Stable) public void setPackages(@Nullable List<String> value)
      An array of Package objects that describes the layer packages.
    • getTagsRaw

      @Stability(Stable) @Nullable public List<CfnTag> getTagsRaw()
      Specifies one or more sets of tags (key–value pairs) to associate with this AWS OpsWorks layer.
    • setTagsRaw

      @Stability(Stable) public void setTagsRaw(@Nullable List<CfnTag> value)
      Specifies one or more sets of tags (key–value pairs) to associate with this AWS OpsWorks layer.
    • getUseEbsOptimizedInstances

      @Stability(Stable) @Nullable public Object getUseEbsOptimizedInstances()
      Whether to use Amazon EBS-optimized instances.
    • setUseEbsOptimizedInstances

      @Stability(Stable) public void setUseEbsOptimizedInstances(@Nullable Boolean value)
      Whether to use Amazon EBS-optimized instances.
    • setUseEbsOptimizedInstances

      @Stability(Stable) public void setUseEbsOptimizedInstances(@Nullable IResolvable value)
      Whether to use Amazon EBS-optimized instances.
    • getVolumeConfigurations

      @Stability(Stable) @Nullable public Object getVolumeConfigurations()
      A VolumeConfigurations object that describes the layer's Amazon EBS volumes.
    • setVolumeConfigurations

      @Stability(Stable) public void setVolumeConfigurations(@Nullable IResolvable value)
      A VolumeConfigurations object that describes the layer's Amazon EBS volumes.
    • setVolumeConfigurations

      @Stability(Stable) public void setVolumeConfigurations(@Nullable List<Object> value)
      A VolumeConfigurations object that describes the layer's Amazon EBS volumes.