I’m working on deploying a docker container to a DO droplet via terrafrom, and using LetsEncrypt for my SSL certificates. After I ran into the LetsEncrypt renewal limit I found DO can manage the certificate renewal in the panel. However, I can’t seem to access it via Terraform. My questions are:
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Heya, @dom77a6e2e9d3a2
I believe this is available only if you use the App Platform and not directly on a droplet.
Suppose you’re deploying a Docker container to a Droplet and want robust, automated Let’s Encrypt cert renewal without hitting rate limits. In that case, you can use a reverse proxy container like Nginx or Caddy.
Regards
Hi there,
You can manage SSL certs in Terraform using the digitalocean_certificate
resource, but only if you’re providing your own cert and key (e.g. from Let’s Encrypt via Certbot).
As far as I can tell, the DigitalOcean’s auto-managed Let’s Encrypt certs from the control panel aren’t currently exposed to the Terraform provider, so you can’t attach or manage those directly in Terraform.
If you want to see support for that, definitely worth opening a feature request on the Terraform provider repo: https://github.com/digitalocean/terraform-provider-digitalocean/issues
If I am not missing anythiung, for now, your best bet for CI/CD is to either manage certs outside Terraform with something like Certbot or Caddy, or let DigitalOcean handle the cert via the panel and exclude it from your infra-as-code setup but maybe worth also reaching out to support to verify if this is the case:
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.