Class ViewerCertificate

java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.services.cloudfront.ViewerCertificate
All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable

@Generated(value="jsii-pacmak/1.94.0 (build b380f01)", date="2024-02-14T19:10:13.788Z") @Stability(Stable) public class ViewerCertificate extends software.amazon.jsii.JsiiObject
Viewer certificate configuration class.

Example:

 Bucket s3BucketSource = new Bucket(this, "Bucket");
 CloudFrontWebDistribution distribution = CloudFrontWebDistribution.Builder.create(this, "AnAmazingWebsiteProbably")
         .originConfigs(List.of(SourceConfiguration.builder()
                 .s3OriginSource(S3OriginConfig.builder().s3BucketSource(s3BucketSource).build())
                 .behaviors(List.of(Behavior.builder().isDefaultBehavior(true).build()))
                 .build()))
         .viewerCertificate(ViewerCertificate.fromIamCertificate("certificateId", ViewerCertificateOptions.builder()
                 .aliases(List.of("example.com"))
                 .securityPolicy(SecurityPolicyProtocol.SSL_V3) // default
                 .sslMethod(SSLMethod.SNI)
                 .build()))
         .build();
 
  • Constructor Details

    • ViewerCertificate

      protected ViewerCertificate(software.amazon.jsii.JsiiObjectRef objRef)
    • ViewerCertificate

      protected ViewerCertificate(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
  • Method Details

    • fromAcmCertificate

      @Stability(Stable) @NotNull public static ViewerCertificate fromAcmCertificate(@NotNull ICertificate certificate, @Nullable ViewerCertificateOptions options)
      Generate an AWS Certificate Manager (ACM) viewer certificate configuration.

      Parameters:
      certificate - AWS Certificate Manager (ACM) certificate. This parameter is required.
      options - certificate configuration options.
    • fromAcmCertificate

      @Stability(Stable) @NotNull public static ViewerCertificate fromAcmCertificate(@NotNull ICertificate certificate)
      Generate an AWS Certificate Manager (ACM) viewer certificate configuration.

      Parameters:
      certificate - AWS Certificate Manager (ACM) certificate. This parameter is required.
    • fromCloudFrontDefaultCertificate

      @Stability(Stable) @NotNull public static ViewerCertificate fromCloudFrontDefaultCertificate(@NotNull @NotNull String... aliases)
      Generate a viewer certificate configuration using the CloudFront default certificate (e.g. d111111abcdef8.cloudfront.net) and a SecurityPolicyProtocol.TLS_V1 security policy.

      Parameters:
      aliases - Alternative CNAME aliases You also must create a CNAME record with your DNS service to route queries. This parameter is required.
    • fromIamCertificate

      @Stability(Stable) @NotNull public static ViewerCertificate fromIamCertificate(@NotNull String iamCertificateId, @Nullable ViewerCertificateOptions options)
      Generate an IAM viewer certificate configuration.

      Parameters:
      iamCertificateId - Identifier of the IAM certificate. This parameter is required.
      options - certificate configuration options.
    • fromIamCertificate

      @Stability(Stable) @NotNull public static ViewerCertificate fromIamCertificate(@NotNull String iamCertificateId)
      Generate an IAM viewer certificate configuration.

      Parameters:
      iamCertificateId - Identifier of the IAM certificate. This parameter is required.
    • getAliases

      @Stability(Stable) @NotNull public List<String> getAliases()
    • getProps

      @Stability(Stable) @NotNull public CfnDistribution.ViewerCertificateProperty getProps()