What a huge pain, now I need a whole separate process to validate the cert. BTW, terraform can do it.
Related discussions:
What a huge pain, now I need a whole separate process to validate the cert. BTW, terraform can do it.
Related discussions:
Check this Github: https://github.com/kounta/lambda-acm-validate . It can help you validate ACM requests with Lambda. maybe that would make life easier and can suit your needs
AWS CDK can do it - take a look at the DnsValidatedCertificate construct.
I highly encourage everyone to use CDK instead of raw CloudFormation templates - having access to complex constructs is just one of the many benefits.
Yes, so much this.
CloudFormation was clearly a transitional interface with real limitations. CDK is the only way to go, now.
I found a few examples like this that looked fairly complex, so I ended up writing a bash script using AWS cli. Thanks !
I’ll have to take a look. This is my first project using CFT, it’s just ok. I’m more used to terraform; but I see pros and cons with CFT.
Try to reuse the same cert for multiple deployments. They limit how many you can request each year.
You then figure you can build a custom resource to do it, and you do, and it works.
Then you try and create one for ALB and Cloud Front, so you have to do one in N.Virginia and one in your region, and you find out they have a long standing bug where if you try to register the same certificate name in the same account in two different regions one will fail to register. I think they have improved it since we reported it about 18 months ago but now instead of failing after 3 days it succeeds after a few hours, but by that time your CloudFormation stack has timed out and you just sigh. You have put all this work into building a Custom Resource and you get tripped up by what seems like a trivial bug that they never seem to fix.
PS. Yes we are investigating terraform. It probably will help us but it’s a big rewrite of everything. I am unsure if Terraform will handle the issue though.
Assuming I understand your situation correctly, I can report that I just did this with Terraform 0.12 about a month ago, and it worked perfectly. Two identical wildcard certs, one in Oregon for LBs, then another in N Va. a few days later for CloudFront. I don’t remember hitting any timeouts.
Yeah this is two wildcard certs. Sydney and Virginia. Can replicate it from the console so not even a CF issue. I think CF makes it worse with the timing of the request being so close. I haven’t tested it in a few months. It’s also intermittent (a race condition caused by the timing of the request)
I am guessing in terraform you could better manage the request to get around this. Thinking now it’s maybe possible to have a depends on of the second cert on the custom resource of the first request and maybe work around this as well.
https://cdkworkshop.com/ for guided CDK tutorial.