GradientEdge CDK Utils
    Preparing search index...

    Provides operations on AWS CloudFront.

    • A new instance of this class is injected into CommonConstruct constructor.
    • If a custom construct extends CommonConstruct, an instance is available within the context.
    import { CommonConstruct } from '@gradientedge/cdk-utils'

    class CustomConstruct extends CommonConstruct {
    constructor(parent: Construct, id: string, props: common.CommonStackProps) {
    super(parent, id, props)
    this.props = props
    this.cloudFrontManager.createCloudFrontDistribution(
    'MyDistribution',
    this,
    siteBucket,
    logBucket,
    originAccessIdentity,
    certificate
    )
    }
    }
    Index

    Constructors

    Methods

    • Method to create a CloudFront distribution with HTTP Origin

      Parameters

      • id: string

        scoped id of the resource

      • scope: CommonConstruct

        scope in which this resource is defined

      • props: DistributionProps

        distribution properties

      • origin: HttpOrigin

        the HTTP origin for the distribution

      • domainNames: string[]

        the custom domain names for the distribution

      • OptionallogBucket: IBucket

        optional S3 bucket for access logs

      • Optionalcertificate: ICertificate

        optional ACM certificate for custom domain HTTPS

      • OptionaldefaultFunctionAssociations: FunctionAssociation[]

        optional CloudFront function associations for the default behavior

      • OptionalresponseHeadersPolicy: IResponseHeadersPolicyRef

        optional response headers policy for the default behavior

      Returns Distribution

    • Method to create a CloudFront distribution with S3 Origin

      Parameters

      • id: string

        scoped id of the resource

      • scope: CommonConstruct

        scope in which this resource is defined

      • props: DistributionProps

        distribution properties

      • siteBucket: IBucket

        the S3 bucket serving as the origin

      • OptionallogBucket: IBucket

        optional S3 bucket for access logs

      • Optionaloai: OriginAccessIdentity

        optional Origin Access Identity for S3 access

      • Optionalcertificate: ICertificate

        optional ACM certificate for custom domain HTTPS

      • Optionalaliases: string[]

        optional custom domain names for the distribution

      • OptionaldefaultFunctionAssociations: FunctionAssociation[]

        optional CloudFront function associations for the default behavior

      Returns Distribution

    • Parameters

      • id: string

        scoped id of the resource

      • scope: CommonConstruct

        scope in which this resource is defined

      • props: LambdaEdgeProps

        lambda@edge properties

      • layers: ILayerVersion[]

        the Lambda layers to attach to the function

      • code: AssetCode

        the asset code bundle for the function

      • role: Role

        the IAM role for the function execution

      • Optionalenvironment: any

        optional environment variables for the function

      • Optionalvpc: IVpc

        optional VPC to deploy the function into

      • OptionalsecurityGroups: ISecurityGroup[]

        optional security groups for VPC-connected functions

      • OptionalaccessPoint: IAccessPoint

        optional EFS access point for filesystem mounting

      • OptionalmountPath: string

        optional mount path for the EFS filesystem (defaults to /mnt/msg)

      Returns EdgeFunction

    • Parameters

      • id: string

        scoped id of the resource

      • scope: CommonConstruct

        scope in which this resource is defined

      • OptionalaccessBucket: IBucket

        optional S3 bucket to grant read access to the OAI

      Returns OriginAccessIdentity

    • Parameters

      • id: string

        scoped id of the resource

      • scope: CommonConstruct

        scope in which this resource is defined

      • dockerFilePath: string

        the path to the Dockerfile for the CodeBuild project

      • distributionId: string

        the CloudFront distribution ID to invalidate

      • Optionalpaths: string

        optional invalidation paths (defaults to /*)

      Returns void