Skip to content
v2.277.0

CfnLayerVersionPermissionProps Struct ​

Properties for defining a CfnLayerVersionPermission.

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_lambda as lambda } from 'aws-cdk-lib';
const cfnLayerVersionPermissionProps: lambda.CfnLayerVersionPermissionProps = {
  action: 'action',
  layerVersionArn: 'layerVersionArn',
  principal: 'principal',

  // the properties below are optional
  organizationId: 'organizationId',
};
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_lambda as lambda_

cfn_layer_version_permission_props = lambda.CfnLayerVersionPermissionProps(
    action="action",
    layer_version_arn="layerVersionArn",
    principal="principal",

    # the properties below are optional
    organization_id="organizationId"
)
java
// 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.*;

CfnLayerVersionPermissionProps cfnLayerVersionPermissionProps = CfnLayerVersionPermissionProps.builder()
        .action("action")
        .layerVersionArn("layerVersionArn")
        .principal("principal")

        // the properties below are optional
        .organizationId("organizationId")
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.Lambda;

var cfnLayerVersionPermissionProps = new CfnLayerVersionPermissionProps {
    Action = "action",
    LayerVersionArn = "layerVersionArn",
    Principal = "principal",

    // the properties below are optional
    OrganizationId = "organizationId"
};
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

cfnLayerVersionPermissionProps := &CfnLayerVersionPermissionProps{
	Action: jsii.String("action"),
	LayerVersionArn: jsii.String("layerVersionArn"),
	Principal: jsii.String("principal"),

	// the properties below are optional
	OrganizationId: jsii.String("organizationId"),
}

Properties ​

actionstringactionstractionStringActionstringAction*stringrequired#
The API action that grants access to the layer.

For example, lambda:GetLayerVersion .

layerVersionArnstring | ILayerVersionReflayer_version_arntyping.Union[str, ILayerVersionRef]layerVersionArnStringLayerVersionArnstringLayerVersionArninterface{}required#
The name or Amazon Resource Name (ARN) of the layer.
organizationIdoptionalstringorganization_idoptionalstrorganizationIdoptionalStringOrganizationIdoptionalstringOrganizationIdoptional*string#
With the principal set to `*` , grant permission to all accounts in the specified organization.
principalstringprincipalstrprincipalStringPrincipalstringPrincipal*stringrequired#
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.