CDK Certificate Manager fromCertificateArn "The provided certificate does not exist"
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 behavior? I use typescript CDK to create an API gateway LambdaRestApi with a certificate in the domainName. I get the certificate using
certmanager.Certificate.fromCertificateArn
passing the entire arn, likearn:aws:acm:REGION:ACC_ID:certificate/CERT_ID
, but when deploying the stack, I get error:The provided certificate does not exist
-
What is the expected behavior (or behavior of feature suggested)? To get the certificate using the ARN and inject that to the APIGW provider.
-
Please tell us about your environment:
- CDK CLI Version: 1.3.0 (build bba9914)
- Module Version: @aws-cdk/aws-certificatemanager 1.3.0
- OS: [ OSX Mojave 10.14.6 ]
- Language: [ TypeScript ]
-
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)
Here’s a code sample:
var certArn = 'arn:aws:acm:REGION:ACCOUNT:certificate/ID'
const cert = certmanager.Certificate.fromCertificateArn(this, 'SomeCertName', certArn);
// Set up the API and its resources
const apiGW = new apigw.LambdaRestApi(this, 'RestAPIName',
{
handler: getTenantsLambdaFn,
domainName: {
domainName: 'SOMEDOMAINNAME',
certificate: cert,
},
deployOptions: {
loggingLevel: apigw.MethodLoggingLevel.INFO,
dataTraceEnabled: true
},
proxy: false
});
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:6 (2 by maintainers)
Hi @nija-at , I seem to be having the same issue.
I’m using the
LambdaRestApi
construct, and I want to add a domain to it. The certificate already exists (It’s a wildcard cert, I’ve been using it on other projects for while now, so it’s definitely valid).However, when I try to do
cdk deploy
, I get a long error message saying that the certificate does not exist:I’m using cdk version 1.67.0
Just to be clear, the domain I’m adding will be a brand new subdomain. I don’t need to do any additional setup anywhere else do I? My understanding is that the
addDomainName
call will set all that stuff up for me (i.e. messing with Route53 and such), is that correct?Here is the relevant output from
cdk synth
.Let me know if you need any more information.
It looks like we’ve fixed this issue. Closing now; re-open if your issue was not addressed.