aws-cdk-lib.aws_cloudfront.CfnDistributionProps

interface CfnDistributionProps

LanguageType name
.NETAmazon.CDK.AWS.CloudFront.CfnDistributionProps
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awscloudfront#CfnDistributionProps
Javasoftware.amazon.awscdk.services.cloudfront.CfnDistributionProps
Pythonaws_cdk.aws_cloudfront.CfnDistributionProps
TypeScript aws-cdk-lib » aws_cloudfront » CfnDistributionProps

Properties for defining a CfnDistribution.

Example

// 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';
const cfnDistributionProps: cloudfront.CfnDistributionProps = {
  distributionConfig: {
    defaultCacheBehavior: {
      targetOriginId: 'targetOriginId',
      viewerProtocolPolicy: 'viewerProtocolPolicy',

      // the properties below are optional
      allowedMethods: ['allowedMethods'],
      cachedMethods: ['cachedMethods'],
      cachePolicyId: 'cachePolicyId',
      compress: false,
      defaultTtl: 123,
      fieldLevelEncryptionId: 'fieldLevelEncryptionId',
      forwardedValues: {
        queryString: false,

        // the properties below are optional
        cookies: {
          forward: 'forward',

          // the properties below are optional
          whitelistedNames: ['whitelistedNames'],
        },
        headers: ['headers'],
        queryStringCacheKeys: ['queryStringCacheKeys'],
      },
      functionAssociations: [{
        eventType: 'eventType',
        functionArn: 'functionArn',
      }],
      lambdaFunctionAssociations: [{
        eventType: 'eventType',
        includeBody: false,
        lambdaFunctionArn: 'lambdaFunctionArn',
      }],
      maxTtl: 123,
      minTtl: 123,
      originRequestPolicyId: 'originRequestPolicyId',
      realtimeLogConfigArn: 'realtimeLogConfigArn',
      responseHeadersPolicyId: 'responseHeadersPolicyId',
      smoothStreaming: false,
      trustedKeyGroups: ['trustedKeyGroups'],
      trustedSigners: ['trustedSigners'],
    },
    enabled: false,

    // the properties below are optional
    aliases: ['aliases'],
    cacheBehaviors: [{
      pathPattern: 'pathPattern',
      targetOriginId: 'targetOriginId',
      viewerProtocolPolicy: 'viewerProtocolPolicy',

      // the properties below are optional
      allowedMethods: ['allowedMethods'],
      cachedMethods: ['cachedMethods'],
      cachePolicyId: 'cachePolicyId',
      compress: false,
      defaultTtl: 123,
      fieldLevelEncryptionId: 'fieldLevelEncryptionId',
      forwardedValues: {
        queryString: false,

        // the properties below are optional
        cookies: {
          forward: 'forward',

          // the properties below are optional
          whitelistedNames: ['whitelistedNames'],
        },
        headers: ['headers'],
        queryStringCacheKeys: ['queryStringCacheKeys'],
      },
      functionAssociations: [{
        eventType: 'eventType',
        functionArn: 'functionArn',
      }],
      lambdaFunctionAssociations: [{
        eventType: 'eventType',
        includeBody: false,
        lambdaFunctionArn: 'lambdaFunctionArn',
      }],
      maxTtl: 123,
      minTtl: 123,
      originRequestPolicyId: 'originRequestPolicyId',
      realtimeLogConfigArn: 'realtimeLogConfigArn',
      responseHeadersPolicyId: 'responseHeadersPolicyId',
      smoothStreaming: false,
      trustedKeyGroups: ['trustedKeyGroups'],
      trustedSigners: ['trustedSigners'],
    }],
    cnamEs: ['cnamEs'],
    comment: 'comment',
    continuousDeploymentPolicyId: 'continuousDeploymentPolicyId',
    customErrorResponses: [{
      errorCode: 123,

      // the properties below are optional
      errorCachingMinTtl: 123,
      responseCode: 123,
      responsePagePath: 'responsePagePath',
    }],
    customOrigin: {
      dnsName: 'dnsName',
      originProtocolPolicy: 'originProtocolPolicy',
      originSslProtocols: ['originSslProtocols'],

      // the properties below are optional
      httpPort: 123,
      httpsPort: 123,
    },
    defaultRootObject: 'defaultRootObject',
    httpVersion: 'httpVersion',
    ipv6Enabled: false,
    logging: {
      bucket: 'bucket',

      // the properties below are optional
      includeCookies: false,
      prefix: 'prefix',
    },
    originGroups: {
      quantity: 123,

      // the properties below are optional
      items: [{
        failoverCriteria: {
          statusCodes: {
            items: [123],
            quantity: 123,
          },
        },
        id: 'id',
        members: {
          items: [{
            originId: 'originId',
          }],
          quantity: 123,
        },
      }],
    },
    origins: [{
      domainName: 'domainName',
      id: 'id',

      // the properties below are optional
      connectionAttempts: 123,
      connectionTimeout: 123,
      customOriginConfig: {
        originProtocolPolicy: 'originProtocolPolicy',

        // the properties below are optional
        httpPort: 123,
        httpsPort: 123,
        originKeepaliveTimeout: 123,
        originReadTimeout: 123,
        originSslProtocols: ['originSslProtocols'],
      },
      originAccessControlId: 'originAccessControlId',
      originCustomHeaders: [{
        headerName: 'headerName',
        headerValue: 'headerValue',
      }],
      originPath: 'originPath',
      originShield: {
        enabled: false,
        originShieldRegion: 'originShieldRegion',
      },
      s3OriginConfig: {
        originAccessIdentity: 'originAccessIdentity',
      },
    }],
    priceClass: 'priceClass',
    restrictions: {
      geoRestriction: {
        restrictionType: 'restrictionType',

        // the properties below are optional
        locations: ['locations'],
      },
    },
    s3Origin: {
      dnsName: 'dnsName',

      // the properties below are optional
      originAccessIdentity: 'originAccessIdentity',
    },
    staging: false,
    viewerCertificate: {
      acmCertificateArn: 'acmCertificateArn',
      cloudFrontDefaultCertificate: false,
      iamCertificateId: 'iamCertificateId',
      minimumProtocolVersion: 'minimumProtocolVersion',
      sslSupportMethod: 'sslSupportMethod',
    },
    webAclId: 'webAclId',
  },

  // the properties below are optional
  tags: [{
    key: 'key',
    value: 'value',
  }],
};

Properties

NameTypeDescription
distributionConfigIResolvable | DistributionConfigPropertyThe distribution's configuration.
tags?CfnTag[]A complex type that contains zero or more Tag elements.

distributionConfig

Type: IResolvable | DistributionConfigProperty

The distribution's configuration.


tags?

Type: CfnTag[] (optional)

A complex type that contains zero or more Tag elements.