Report this

What is the reason for this report?

Accessing Loadbalancer certificate in Terraform

Posted on July 31, 2025

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:

  • Is this possible, and if so, how?
  • If it isn’t possible, what is the best practice of managing LetsEncrypt cert renewal to avoid running to limits, especially when considering a CI/CD pipeline?


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!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

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:

https://do.co/support

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.