The CDK Construct Library for AWS::CertificateManager
Project description
Amazon Certificate Manager Construct Library
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:
const cert = new certmgr.Certificate(this, 'Certificate', {
domainName: '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, 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.
The CDK also provides a custom resource which can be used for automatic validation if the DNS records for the domain are managed through Route53 (see below).
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 Amazon Certificate Manager User Guide.
DNS validation
DNS-validated certificates are validated by configuring appropriate DNS records for your domain.
See Validate with DNS in the Amazon Certificate Manager User Guide.
Automatic DNS-validated certificates using Route53
The DnsValidatedCertificateRequest
class provides a Custom Resource by which
you can request a TLS certificate from AWS Certificate Manager that is
automatically validated using a cryptographically secure DNS record. For this to
work, there must be a Route 53 public zone that is responsible for serving
records under the Domain Name of the requested certificate. For example, if you
request a certificate for www.example.com
, there must be a Route 53 public
zone example.com
that provides authoritative records for the domain.
Example:
const hostedZone = route53.HostedZone.fromLookup(this, 'HostedZone', {
domainName: 'example.com',
privateZone: false
});
const certificate = new certmgr.DnsValidatedCertificate(this, 'TestCertificate', {
domainName: 'test.example.com',
hostedZone,
});
Importing
If you want to import an existing certificate, you can do so from its ARN:
const arn = "arn:aws:...";
const certificate = Certificate.fromCertificateArn(this, '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
Built Distribution
Hashes for aws-cdk.aws-certificatemanager-1.10.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5a85c0f6294afce653bfee3dbb964447796021dfe510f70d27a26b0ac4a0a6a1 |
|
MD5 | c208b0e4560bd7b67acb1ded7bc990cf |
|
BLAKE2b-256 | abe806866eddf37ce01e9d1ad8b3bec01090b4cc9f5e2a9d842aa7f55da6ded6 |
Hashes for aws_cdk.aws_certificatemanager-1.10.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bdae7273a2a6d4fcee53e5baef0bfc596bcc9306bbdc43b86596a16b23a9e389 |
|
MD5 | cd3fbe0f389396c2e737ba51550664e3 |
|
BLAKE2b-256 | 0e676ebc1eb6c41733373e5c92a0a643c11016ba1556d4810c8e6b0f86842f32 |