Class CfnLayerVersionPermission

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

@Generated(value="jsii-pacmak/1.97.0 (build 729de35)", date="2024-04-24T21:00:31.881Z") @Stability(Stable) public class CfnLayerVersionPermission extends CfnResource implements IInspectable
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();
 

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

    • CfnLayerVersionPermission

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

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

      @Stability(Stable) public CfnLayerVersionPermission(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull CfnLayerVersionPermissionProps 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()
      ID generated by service.
    • 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.
    • setAction

      @Stability(Stable) public void setAction(@NotNull String value)
      The API action that grants access to the layer.
    • 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).
    • 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).
    • 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.