AWS Automate Cert creation and adding record to Route53 Hosted Zone.

Danushka Fernando
1 min readFeb 23, 2020

How do you create the AWS Managed Certificate in AWS Certificate Manager when you are deploying your solution in AWS ? When it comes to multi account deployments this case gets severe. Say you have a Development, Staging and Production deployments in different accounts and you want to use same host name with different prefixes. So you can create the shared account to manage Route53 Hosted Zone other shared components. But we cannot create cross account certs at the moment. So we may have to create certs in each account separately and add the record sets to Route53 Hosted Zone. Question is how can we automate this either its a single account deployment or its a multi account deployment.

I created a bash script to do this[1]. For our purpose we triggered this through a Jenkins pipeline. But this can be triggered by any manner you need. For example using some deployment tool such as Ansible or Puppet or even manual trigger also will work. My script is specialized for the multi account scenario. But without account switching you can use it for single account deployment as well. Here we use pre created hosted zone and if single account you can add the hosted zone creation step as well.

Good luck!!!

References

[1] https://github.com/danushkaf/aws_automated_cert_creation_with_central_route53/blob/master/manage-certificate.sh

--

--