# CfnLayerVersionPermissionProps

Properties for defining a `CfnLayerVersionPermission`.

Used as props by: [CfnLayerVersionPermission](/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.CfnLayerVersionPermission.html)

- Source: Generated at build time
- Type last changed: v2.227.0 · 21 Nov 2025

## Example

TypeScript:

```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:

```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:

```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();
```

C# / .NET:

```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"
};
```

Golang:

```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

- `action`: string (required) — The API action that grants access to the layer.

  For example, `lambda:GetLayerVersion` .

- `layerVersionArn`: string | [ILayerVersionRef](/cdk/api/v2/docs/aws-cdk-lib.interfaces.aws_lambda.ILayerVersionRef.html) (required) — The name or Amazon Resource Name (ARN) of the layer.

- `organizationId`: string — With the principal set to `*` , grant permission to all accounts in the specified organization.

- `principal`: string (required) — 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.
