java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.core.Construct
software.amazon.awscdk.core.Resource
software.amazon.awscdk.services.certificatemanager.Certificate
All Implemented Interfaces:
IConstruct, IDependable, IResource, ICertificate, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:30:43.065Z") @Stability(Stable) public class Certificate extends Resource implements ICertificate
A certificate managed by AWS Certificate Manager.

Example:

 UserPool pool = new UserPool(this, "Pool");
 pool.addDomain("CognitoDomain", UserPoolDomainOptions.builder()
         .cognitoDomain(CognitoDomainOptions.builder()
                 .domainPrefix("my-awesome-app")
                 .build())
         .build());
 String certificateArn = "arn:aws:acm:us-east-1:123456789012:certificate/11-3336f1-44483d-adc7-9cd375c5169d";
 ICertificate domainCert = Certificate.fromCertificateArn(this, "domainCert", certificateArn);
 pool.addDomain("CustomDomain", UserPoolDomainOptions.builder()
         .customDomain(CustomDomainOptions.builder()
                 .domainName("user.myapp.com")
                 .certificate(domainCert)
                 .build())
         .build());
 
  • Constructor Details

    • Certificate

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

      protected Certificate(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • Certificate

      @Stability(Stable) public Certificate(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull CertificateProps props)
      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
      props - This parameter is required.
  • Method Details

    • fromCertificateArn

      @Stability(Stable) @NotNull public static ICertificate fromCertificateArn(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull String certificateArn)
      Import a certificate.

      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
      certificateArn - This parameter is required.
    • metricDaysToExpiry

      @Stability(Stable) @NotNull public Metric metricDaysToExpiry(@Nullable MetricOptions props)
      Return the DaysToExpiry metric for this AWS Certificate Manager Certificate. By default, this is the minimum value over 1 day.

      This metric is no longer emitted once the certificate has effectively expired, so alarms configured on this metric should probably treat missing data as "breaching".

      Specified by:
      metricDaysToExpiry in interface ICertificate
      Parameters:
      props -
    • metricDaysToExpiry

      @Stability(Stable) @NotNull public Metric metricDaysToExpiry()
      Return the DaysToExpiry metric for this AWS Certificate Manager Certificate. By default, this is the minimum value over 1 day.

      This metric is no longer emitted once the certificate has effectively expired, so alarms configured on this metric should probably treat missing data as "breaching".

      Specified by:
      metricDaysToExpiry in interface ICertificate
    • getCertificateArn

      @Stability(Stable) @NotNull public String getCertificateArn()
      The certificate's ARN.
      Specified by:
      getCertificateArn in interface ICertificate
    • getRegion

      @Stability(Stable) @Nullable protected String getRegion()
      If the certificate is provisionned in a different region than the containing stack, this should be the region in which the certificate lives so we can correctly create Metric instances.