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.

(certificate manager): cannot use cross-region certificate, cannot get custom domain URL

See original GitHub issue

Two issues I had trying to set up a custom domain mapping for my ApiGwV2 HttpApi.

  1. I cannot use a DNS-validated cross-region certificate from us-east-1 in a different stack. I get #9608. Because I have a certificate for CloudFront and also my HttpApi it means I need to create two Certificates, one from us-east-1 and one in my current region, even though the docs strongly suggest that I can use my us-east-1 cert in another region.
    const hostedZone = HostedZone.fromLookup(this, "Zone", {
      domainName: hostedZoneDomain,
    })

    const certificate = new DnsValidatedCertificate(this, "RegionCertificate", {
      domainName: hostedZoneDomain,
      hostedZone,
      // region: "us-east-1",  <---- I want to use this so I can re-use this with my CloudFront dist
    })
  1. I cannot figure out how to get the URL with custom domain and base path
    const httpApi = new HttpApi(this, `Api${appName}`, {
      apiName: this.stackName,
      defaultDomainMapping: {
        domainName,
        mappingKey: envName,
      },
    })
    new CfnOutput(this, "ApiBase", { value: httpApi.defaultStage?.url || "unknown" }) // <--- tried httpApi.url too

This just gives me the boring old execute-api URL, not https://foo.com/dev that I want. How can I get a stack output with the custom domain URL?

Environment

  • **CDK CLI Version :1.110.0
  • Framework Version:
  • Node.js Version: 14
  • OS :
  • Language (Version):

This is 🐛 Bug Report

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
nija-atcommented, Jul 28, 2021

I’ve opened a feature request for your second request here - https://github.com/aws/aws-cdk/issues/15801

0reactions
github-actions[bot]commented, Sep 21, 2021

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Getting certificates ready in AWS Certificate Manager
For an API Gateway Regional custom domain name, you must request or import the certificate in the same Region as your API. The...
Read more >
Associating a custom domain name and securing ...
Guides you through how to associate a custom domain name and secure communication (SSL) with your Azure Cloud Service or Azure Web Apps....
Read more >
Unable to use domain after transfering to another ...
I created a hosting zone but cannot verify my SSL certificate created with certificate manager. I tried to link the domain to a...
Read more >
How to replicate SSL Certificates for a custom domain in ...
It cannot point at two different URLs at the same time. It is possible to route the requests to individual apps but the...
Read more >
Setup a CloudFront distribution with SSL, custom domain and ...
... up a CloudFront CDN, link it with our custom domain via Route 53, and secure the whole connection using an SSL certificate...
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