# DistributionGrants

Collection of grant methods for a IDistributionRef.

Obtainable from: DistributionGrants.fromDistribution

- Source: Generated at build time
- Type last changed: v2.244.0 · 19 Mar 2026

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_cloudfront as cloudfront } from 'aws-cdk-lib';
import { aws_cloudfront as interfaces_cloudfront } from 'aws-cdk-lib/interfaces';

declare const distributionRef: interfaces_cloudfront.IDistributionRef;
const distributionGrants = cloudfront.DistributionGrants.fromDistribution(distributionRef);
```

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_cloudfront as cloudfront
from aws_cdk.interfaces import aws_cloudfront as interfaces_cloudfront

# distribution_ref: interfaces_cloudfront.IDistributionRef

distribution_grants = cloudfront.DistributionGrants.from_distribution(distribution_ref)
```

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.cloudfront.*;
import software.amazon.awscdk.interfaces.cloudfront.*;

IDistributionRef distributionRef;

DistributionGrants distributionGrants = DistributionGrants.fromDistribution(distributionRef);
```

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.CloudFront;
using Amazon.CDK.Interfaces.CloudFront;

IDistributionRef distributionRef;

var distributionGrants = DistributionGrants.FromDistribution(distributionRef);
```

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"
import "github.com/aws/aws-cdk-go/awscdk"

var distributionRef IDistributionRef

distributionGrants := awscdk.Aws_cloudfront.DistributionGrants_FromDistribution(distributionRef)
```

## Methods

- `actions(grantee: IGrantable, actions: string[], options?: PermissionsOptions): Grant` — Grant the given identity custom permissions.

- `createInvalidation(grantee: IGrantable): Grant` — Grant to create invalidations for this bucket to an IAM principal (Role/Group/User).

- `fromDistribution(resource: IDistributionRef): DistributionGrants // chainable` (static) — Creates grants for DistributionGrants.
