question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

@aws-cdk/aws-certificatemanager.Certification to support Global certificate creation

See original GitHub issue
  • I’m submitting a …

    • 🪲 bug report
    • 🚀 feature request
    • 📚 construct library gap
    • ☎️ security issue or vulnerability => Please see policy
    • ❓ support request => Please see note at the top of this template.
  • What is the current behaviour?

When creating a certificate like:

const certificate = new certificatemanager.Certificate(this, `${domain}-cert`, {
  domainName: domain,
  validationMethod: certificatemanager.ValidationMethod.DNS,
  subjectAlternativeNames: [`www.${domain}`]
})

The certificate is created in the region specified in the profile.

  • What is the expected behavior (or behavior of feature suggested)?

As is with the ability to specify whether the certificate should be global - i.e. for CloudFront - or adding the ability to customise the region, though this option seems overkill.

  • What is the motivation / use case for changing the behaviour or adding this feature?

Would like to create an ACM Certificate for a domain not yet managed via Route53 - so not able to leverage DnsValidatedCertificate, where region can be specified - in order to provision CloudFront in front of an S3 bucket.

  • Please tell us about your environment:

    • CDK CLI Version: 1.3.0
    • Module Version: 1.3.0
    • OS: OSX Mojave
    • Language: JavaScript
  • Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. associated pull-request, stackoverflow, gitter, etc)

Related to https://github.com/aws/aws-cdk/issues/3464

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
rix0rrrcommented, Aug 28, 2019

We are unfortunately not able to create regular Certificates in a different region. The only reason we can in DnsValidatedCertificate is because that is a custom resource.

You could automate this by writing your own custom resource, and you could share your implementation with others via NPM, but I’m not sure the base construct library is a place for a resource that does this.

1reaction
mattiLeBlanccommented, Oct 28, 2020

So I find this really weird, I do everything via CDK, in region AP-southeast-2, and now I noticed that creating the Certificate and linking it to my cloudfront doesnt work, because the CDK will create the certificate in the region of the profile used during deploy. But it needs to be US-EAST-1.

 const hostedZone = HostedZone.fromLookup(this, `${this.props.rootName}HostedZone`, {
      domainName: hostedZoneUrl
    });

    const acmCertificate = new Certificate(this, 'Certificate', {
      domainName: certificateUrl,
     
      validation: CertificateValidation.fromDns(hostedZone),
    });

Since I do all this in CDK, it doesn’t make sense to give this example in https://docs.aws.amazon.com/cdk/api/latest/docs/aws-certificatemanager-readme.html. This would only for for customers working in US-EAST-1 region, not the rest of the world.

Is it an idea to add a region property to the new Certificate class so that we can automate it and create the certificate in the correct region? I now have to manually issue the certificate 😦

Read more comments on GitHub >

github_iconTop Results From Across the Web

aws-cdk/aws-certificatemanager module - AWS Documentation
The DnsValidatedCertificate construct exists to facilitate creating these certificates cross-region. This resource can only be used with Route53-based DNS ...
Read more >
@aws-cdk/aws-certificatemanager - npm
AWS Certificate Manager (ACM) handles the complexity of creating, ... main service, or provision them manually and import them into your CDK ......
Read more >
CDK DnsValidatedCertificate: Can create a certificate in a ...
// Executed with `cdk deploy --profile profileForLinkedAwsAccount` const certificate = new certificatemanager.Certificate(this, ' ...
Read more >
@aws-cdk/aws-certificatemanager | Yarn - Package Manager
AWS Certificate Manager (ACM) handles the complexity of creating, storing, and renewing public and private SSL/TLS X.509 certificates and keys that protect ...
Read more >
AWS CDK — Create domain into route53 HostedZone ...
AWS CDK — Create domain into route53 HostedZone, request SSL certificate with Certificate Manager, create an alarm when the SSL is expired, and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found