Class CfnLayerVersionPermission

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

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:30:40.662Z") @Stability(Stable) public class CfnLayerVersionPermission extends CfnResource implements IInspectable
A CloudFormation AWS::Lambda::LayerVersionPermission.

The AWS::Lambda::LayerVersionPermission resource adds permissions to the resource-based policy of a version of an Lambda layer . Use this action to grant layer usage permission to other accounts. You can grant permission to a single account, all AWS accounts, or all accounts in an organization.

Since the release of the UpdateReplacePolicy both UpdateReplacePolicy and DeletionPolicy are required to protect your Resources/LayerPermissions from deletion.

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.lambda.*;
 CfnLayerVersionPermission cfnLayerVersionPermission = CfnLayerVersionPermission.Builder.create(this, "MyCfnLayerVersionPermission")
         .action("action")
         .layerVersionArn("layerVersionArn")
         .principal("principal")
         // the properties below are optional
         .organizationId("organizationId")
         .build();
 
  • 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

    • CfnLayerVersionPermission

      protected CfnLayerVersionPermission(software.amazon.jsii.JsiiObjectRef objRef)
    • CfnLayerVersionPermission

      protected CfnLayerVersionPermission(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • CfnLayerVersionPermission

      @Stability(Stable) public CfnLayerVersionPermission(@NotNull Construct scope, @NotNull String id, @NotNull CfnLayerVersionPermissionProps props)
      Create a new AWS::Lambda::LayerVersionPermission.

      Parameters:
      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.
  • 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.
    • getCfnProperties

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

      @Stability(Stable) @NotNull public String getAction()
      The API action that grants access to the layer.

      For example, lambda:GetLayerVersion .

    • setAction

      @Stability(Stable) public void setAction(@NotNull String value)
      The API action that grants access to the layer.

      For example, lambda:GetLayerVersion .

    • getLayerVersionArn

      @Stability(Stable) @NotNull public String getLayerVersionArn()
      The name or Amazon Resource Name (ARN) of the layer.
    • setLayerVersionArn

      @Stability(Stable) public void setLayerVersionArn(@NotNull String value)
      The name or Amazon Resource Name (ARN) of the layer.
    • getPrincipal

      @Stability(Stable) @NotNull public String getPrincipal()
      An account ID, or * to grant layer usage permission to all accounts in an organization, or all AWS accounts (if organizationId is not specified).

      For the last case, make sure that you really do want all AWS accounts to have usage permission to this layer.

    • setPrincipal

      @Stability(Stable) public void setPrincipal(@NotNull String value)
      An account ID, or * to grant layer usage permission to all accounts in an organization, or all AWS accounts (if organizationId is not specified).

      For the last case, make sure that you really do want all AWS accounts to have usage permission to this layer.

    • getOrganizationId

      @Stability(Stable) @Nullable public String getOrganizationId()
      With the principal set to * , grant permission to all accounts in the specified organization.
    • setOrganizationId

      @Stability(Stable) public void setOrganizationId(@Nullable String value)
      With the principal set to * , grant permission to all accounts in the specified organization.