Skip to content
v2.274.0

CfnDistributionProps Struct ​

Properties for defining a CfnDistribution.

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';
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',
      }],
      grpcConfig: {
        enabled: false,
      },
      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'],
    anycastIpListId: 'anycastIpListId',
    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',
      }],
      grpcConfig: {
        enabled: false,
      },
      lambdaFunctionAssociations: [{
        eventType: 'eventType',
        includeBody: false,
        lambdaFunctionArn: 'lambdaFunctionArn',
      }],
      maxTtl: 123,
      minTtl: 123,
      originRequestPolicyId: 'originRequestPolicyId',
      realtimeLogConfigArn: 'realtimeLogConfigArn',
      responseHeadersPolicyId: 'responseHeadersPolicyId',
      smoothStreaming: false,
      trustedKeyGroups: ['trustedKeyGroups'],
      trustedSigners: ['trustedSigners'],
    }],
    cacheTagConfig: {
      headerName: 'headerName',
    },
    cnamEs: ['cnamEs'],
    comment: 'comment',
    connectionFunctionAssociation: {
      id: 'id',
    },
    connectionMode: 'connectionMode',
    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',
      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,
        },

        // the properties below are optional
        selectionCriteria: 'selectionCriteria',
      }],
    },
    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,
        ipAddressType: 'ipAddressType',
        originKeepaliveTimeout: 123,
        originMtlsConfig: {
          clientCertificateArn: 'clientCertificateArn',
        },
        originReadTimeout: 123,
        originSslProtocols: ['originSslProtocols'],
      },
      originAccessControlId: 'originAccessControlId',
      originCustomHeaders: [{
        headerName: 'headerName',
        headerValue: 'headerValue',
      }],
      originPath: 'originPath',
      originShield: {
        enabled: false,
        originShieldRegion: 'originShieldRegion',
      },
      responseCompletionTimeout: 123,
      s3OriginConfig: {
        originAccessIdentity: 'originAccessIdentity',
        originReadTimeout: 123,
      },
      vpcOriginConfig: {
        vpcOriginId: 'vpcOriginId',

        // the properties below are optional
        originKeepaliveTimeout: 123,
        originReadTimeout: 123,
        ownerAccountId: 'ownerAccountId',
      },
    }],
    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,
    tenantConfig: {
      parameterDefinitions: [{
        definition: {
          stringSchema: {
            required: false,

            // the properties below are optional
            comment: 'comment',
            defaultValue: 'defaultValue',
          },
        },
        name: 'name',
      }],
    },
    viewerCertificate: {
      acmCertificateArn: 'acmCertificateArn',
      cloudFrontDefaultCertificate: false,
      iamCertificateId: 'iamCertificateId',
      minimumProtocolVersion: 'minimumProtocolVersion',
      sslSupportMethod: 'sslSupportMethod',
    },
    viewerMtlsConfig: {
      mode: 'mode',
      trustStoreConfig: {
        trustStoreId: 'trustStoreId',

        // the properties below are optional
        advertiseTrustStoreCaNames: false,
        ignoreCertificateExpiry: false,
      },
    },
    webAclId: 'webAclId',
  },

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

Properties ​

distributionConfigIResolvable | CfnDistribution.DistributionConfigPropertydistribution_configtyping.Union[IResolvable, DistributionConfigProperty]distributionConfigIResolvableDistributionConfigIResolvableDistributionConfiginterface{}required#
The distribution's configuration.
tagsCfnTag[]tagstyping.List[CfnTag]tagsList<CfnTag>TagsCfnTag[]Tags*[]CfnTag#
A complex type that contains zero or more `Tag` elements.