Skip to main content

The CDK Construct Library for AWS::CertificateManager

Project description

AWS Certificate Manager Construct Library

---

cfn-resources: Stable

cdk-constructs: Stable


This package provides Constructs for provisioning and referencing certificates which can be used in CloudFront and ELB.

The following requests a certificate for a given domain:

# Example automatically generated. See https://github.com/aws/jsii/issues/826
cert = certmgr.Certificate(self, "Certificate",
    domain_name="example.com"
)

After requesting a certificate, you will need to prove that you own the domain in question before the certificate will be granted. The CloudFormation deployment will wait until this verification process has been completed.

Because of this wait time, when using manual validation methods, it's better to provision your certificates either in a separate stack from your main service, or provision them manually and import them into your CDK application.

Email validation

Email-validated certificates (the default) are validated by receiving an email on one of a number of predefined domains and following the instructions in the email.

See Validate with Email in the AWS Certificate Manager User Guide.

DNS validation

If Amazon Route 53 is your DNS provider for the requested domain, the DNS record can be created automatically:

# Example automatically generated without compilation. See https://github.com/aws/jsii/issues/826
Certificate(self, "Certificate",
    domain_name="hello.example.com",
    validation=CertificateValidation.from_dns(my_hosted_zone)
)

Otherwise DNS records must be added manually and the stack will not complete creating until the records are added.

# Example automatically generated without compilation. See https://github.com/aws/jsii/issues/826
Certificate(self, "Certificate",
    domain_name="hello.example.com",
    validation=CertificateValidation.from_dns()
)

See also Validate with DNS in the AWS Certificate Manager User Guide.

When working with multiple domains, use the CertificateValidation.fromDnsMultiZone():

# Example automatically generated. See https://github.com/aws/jsii/issues/826
example_com = route53.HostedZone(self, "ExampleCom",
    zone_name="example.com"
)

example_net = route53.HostedZone(self, "ExampelNet",
    zone_name="example.net"
)

cert = acm.Certificate(self, "Certificate",
    domain_name="test.example.com",
    subject_alternative_names=["cool.example.com", "test.example.net"],
    validation=acm.CertificateValidation.from_dns_multi_zone({
        "text.example.com": example_com,
        "cool.example.com": example_com,
        "test.example.net": example_net
    })
)

Use the DnsValidatedCertificate construct for cross-region certificate creation:

# Example automatically generated without compilation. See https://github.com/aws/jsii/issues/826
DnsValidatedCertificate(self, "CrossRegionCertificate",
    domain_name="hello.example.com",
    hosted_zone=my_hosted_zone,
    region="us-east-1"
)

This is useful when deploying a stack in a region other than us-east-1 with a certificate for a CloudFront distribution.

If cross-region is not needed, the recommended solution is to use the Certificate construct which uses a native CloudFormation implementation.

Importing

If you want to import an existing certificate, you can do so from its ARN:

# Example automatically generated without compilation. See https://github.com/aws/jsii/issues/826
arn = "arn:aws:..."
certificate = Certificate.from_certificate_arn(self, "Certificate", arn)

Sharing between Stacks

To share the certificate between stacks in the same CDK application, simply pass the Certificate object between the stacks.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aws-cdk.aws-certificatemanager-1.53.0.tar.gz (250.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aws_cdk.aws_certificatemanager-1.53.0-py3-none-any.whl (248.4 kB view details)

Uploaded Python 3

File details

Details for the file aws-cdk.aws-certificatemanager-1.53.0.tar.gz.

File metadata

  • Download URL: aws-cdk.aws-certificatemanager-1.53.0.tar.gz
  • Upload date:
  • Size: 250.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.6.5

File hashes

Hashes for aws-cdk.aws-certificatemanager-1.53.0.tar.gz
Algorithm Hash digest
SHA256 a708fa49b265d13f7c27648d67775273872b2d12ee44a33186966d0a2c723e0d
MD5 3edb37120f4011cd6ebefe1a9b8ee043
BLAKE2b-256 350987a0d1fcd2719f3788870911a733f8374a1212c332759eb13250391c3f0c

See more details on using hashes here.

File details

Details for the file aws_cdk.aws_certificatemanager-1.53.0-py3-none-any.whl.

File metadata

  • Download URL: aws_cdk.aws_certificatemanager-1.53.0-py3-none-any.whl
  • Upload date:
  • Size: 248.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.6.5

File hashes

Hashes for aws_cdk.aws_certificatemanager-1.53.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a39f69bea49100cd0d6c71499c890521b9a61b16c02d0949d4417ecdde84faba
MD5 907086c3c8900625425c88e50fc370aa
BLAKE2b-256 e32736f7a01602135c73c6562504a649cd0cedcfe6a3319161eb68cdfe77c8c5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page