This resource allows you to configure the SSL certificate and key for your Portainer instance.
It supports toggling HTTP access and providing the certificate and key as strings (e.g., using the file() function).
⚠️ This resource requires administrator access.
resource "portainer_ssl" "cert_update" {
cert = file("certs/server.crt")
key = file("certs/server.key")
http_enabled = false
}SSL of Portainer are modify if any of the arguments/files change by run:
terraform apply$ mkdir certs
$ openssl req -x509 -newkey rsa:4096 -keyout certs/server.key -out certs/server.crt -days 365 -nodes -subj "/CN=localhost"| Name | Type | Required | Description |
|---|---|---|---|
cert |
string | ✅ yes | Contents of the SSL certificate (e.g., file("certs/server.crt")) |
key |
string | ✅ yes | Contents of the private key (e.g., file("certs/server.key")) |
client_cert |
string | 🚫 optional | Contents of the client certificate, if required for mutual TLS |
http_enabled |
bool | 🚫 optional | Whether to keep HTTP access enabled (default: false) |
| Name | Description |
|---|---|
id |
Always "portainer-settings" |