Skip to content
v2.278.0

DistributionGrants Facade ​

Collection of grant methods for a IDistributionRef.

Example ​

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
# 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
// 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);
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);
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): Grantdef actions(self, grantee: IGrantable, actions: typing.List[str], options: typing.Optional[PermissionsOptions] = None) -> Grantpublic Grant actions(IGrantable grantee, List<String> actions, PermissionsOptions options)public Grant Actions(IGrantable grantee, string[] actions, PermissionsOptions? options = null)func Actions(Grantee IGrantable, Actions *[]*string, Options PermissionsOptions) Grant #
Grant the given identity custom permissions.
createInvalidation(grantee: IGrantable): Grantdef create_invalidation(self, grantee: IGrantable) -> Grantpublic Grant createInvalidation(IGrantable grantee)public Grant CreateInvalidation(IGrantable grantee)func CreateInvalidation(Grantee IGrantable) Grant #
Grant to create invalidations for this bucket to an IAM principal (Role/Group/User).
fromDistribution(resource: IDistributionRef): DistributionGrants // chainable@staticmethod def from_distribution(resource: IDistributionRef) -> DistributionGrantspublic static DistributionGrants fromDistribution(IDistributionRef resource)public static DistributionGrants FromDistribution(IDistributionRef resource)func FromDistribution(Resource IDistributionRef) DistributionGrants static #
Creates grants for DistributionGrants.