Class LayerVersion.Builder

java.lang.Object
software.amazon.awscdk.services.lambda.LayerVersion.Builder
All Implemented Interfaces:
software.amazon.jsii.Builder<LayerVersion>
Enclosing class:
LayerVersion

@Stability(Stable) public static final class LayerVersion.Builder extends Object implements software.amazon.jsii.Builder<LayerVersion>
A fluent builder for LayerVersion.
  • Method Details

    • create

      @Stability(Stable) public static LayerVersion.Builder create(software.constructs.Construct scope, String id)
      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
      Returns:
      a new instance of LayerVersion.Builder.
    • description

      @Stability(Stable) public LayerVersion.Builder description(String description)
      The description the this Lambda Layer.

      Default: - No description.

      Parameters:
      description - The description the this Lambda Layer. This parameter is required.
      Returns:
      this
    • layerVersionName

      @Stability(Stable) public LayerVersion.Builder layerVersionName(String layerVersionName)
      The name of the layer.

      Default: - A name will be generated.

      Parameters:
      layerVersionName - The name of the layer. This parameter is required.
      Returns:
      this
    • license

      @Stability(Stable) public LayerVersion.Builder license(String license)
      The SPDX licence identifier or URL to the license file for this layer.

      Default: - No license information will be recorded.

      Parameters:
      license - The SPDX licence identifier or URL to the license file for this layer. This parameter is required.
      Returns:
      this
    • removalPolicy

      @Stability(Stable) public LayerVersion.Builder removalPolicy(RemovalPolicy removalPolicy)
      Whether to retain this version of the layer when a new version is added or when the stack is deleted.

      Default: RemovalPolicy.DESTROY

      Parameters:
      removalPolicy - Whether to retain this version of the layer when a new version is added or when the stack is deleted. This parameter is required.
      Returns:
      this
    • code

      @Stability(Stable) public LayerVersion.Builder code(Code code)
      The content of this Layer.

      Using Code.fromInline is not supported.

      Parameters:
      code - The content of this Layer. This parameter is required.
      Returns:
      this
    • compatibleArchitectures

      @Stability(Stable) public LayerVersion.Builder compatibleArchitectures(List<? extends Architecture> compatibleArchitectures)
      The system architectures compatible with this layer.

      Default: [Architecture.X86_64]

      Parameters:
      compatibleArchitectures - The system architectures compatible with this layer. This parameter is required.
      Returns:
      this
    • compatibleRuntimes

      @Stability(Stable) public LayerVersion.Builder compatibleRuntimes(List<? extends Runtime> compatibleRuntimes)
      The runtimes compatible with this Layer.

      Default: - All runtimes are supported.

      Parameters:
      compatibleRuntimes - The runtimes compatible with this Layer. This parameter is required.
      Returns:
      this
    • build

      @Stability(Stable) public LayerVersion build()
      Specified by:
      build in interface software.amazon.jsii.Builder<LayerVersion>
      Returns:
      a newly built instance of LayerVersion.