aws-cdk-lib.aws_cloudfront.ViewerCertificateOptions

interface ViewerCertificateOptions

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

Example

    const s3BucketSource = new s3.Bucket(this, 'Bucket');

    const distribution = new cloudfront.CloudFrontWebDistribution(this, 'AnAmazingWebsiteProbably', {
      originConfigs: [{
        s3OriginSource: { s3BucketSource },
        behaviors: [{ isDefaultBehavior: true }],
      }],
      viewerCertificate: cloudfront.ViewerCertificate.fromIamCertificate(
        'certificateId',
        {
          aliases: ['example.com'],
          securityPolicy: cloudfront.SecurityPolicyProtocol.SSL_V3, // default
          sslMethod: cloudfront.SSLMethod.SNI, // default
        },
      ),
    });

Properties

NameTypeDescription
aliases?string[]Domain names on the certificate (both main domain name and Subject Alternative names).
securityPolicy?SecurityPolicyProtocolThe minimum version of the SSL protocol that you want CloudFront to use for HTTPS connections.
sslMethod?SSLMethodHow CloudFront should serve HTTPS requests.

aliases?

Type: string[] (optional)

Domain names on the certificate (both main domain name and Subject Alternative names).


securityPolicy?

Type: SecurityPolicyProtocol (optional, default: SSLv3 if sslMethod VIP, TLSv1 if sslMethod SNI)

The minimum version of the SSL protocol that you want CloudFront to use for HTTPS connections.

CloudFront serves your objects only to browsers or devices that support at least the SSL version that you specify.


sslMethod?

Type: SSLMethod (optional, default: SSLMethod.SNI)

How CloudFront should serve HTTPS requests.

See the notes on SSLMethod if you wish to use other SSL termination types.

See also: https://docs.aws.amazon.com/cloudfront/latest/APIReference/API_ViewerCertificate.html