Use your own certificate
Add an https service with a certificate and private key you upload, and replace it before it expires.
An uploaded certificate is attached when the service is added and is never renewed by Deutsche Cloud: you replace it before it expires.
Prerequisites
- Permission for
lb:AddService; to replace the certificate later, alsolb:DeleteService. - In the console, also
lb:DescribeLoadBalancerson the load balancer; without it its page answers 404. - The certificate in PEM, leaf first, then its chain (at most 64 KiB), and its private key in PEM, not encrypted (at most 16 KiB).
- On
lb11,lb21andlb31, a load balancer that is no longerprovisioning. - On
applicationanddedicated, every name on the certificate in one of your hosted zones, at most 10 names including the load balancer's own name, and none served by another load balancer on the region's fleet.
Where the key is kept depends on the type: on lb11–lb31 it is handed to the provider and not
stored by Deutsche Cloud; on application and dedicated it is stored sealed under the KMS master key
and opened only to configure the fleet.
Add the service
- Open Load balancers, open the load balancer, then the Services tab.
- Choose Add service.
- For Protocol, choose HTTPS.
- For Certificate, choose Upload my own.
- For Certificate (PEM), paste the certificate, then its chain.
- For Private key (PEM), paste the key.
- Select or clear Redirect HTTP to HTTPS.
- Enter the Source port and the Destination port, then choose Add.
The key is not kept in the form's saved draft.
dcloud lb services add lb-id --protocol https --source-port 443 --destination-port 8080 \
--certificate-pem "$(cat fullchain.pem)" --private-key-pem "$(cat key.pem)"POST /lb/api/load-balancers/lb-id/services
{ "protocol": "https", "sourcePort": 443, "destinationPort": 8080,
"certificatePem": "-----BEGIN CERTIFICATE-----\n…", "privateKeyPem": "-----BEGIN PRIVATE KEY-----\n…" }resource "dcloud_lb_service" "https" {
load_balancer_id = dcloud_lb.web.id
protocol = "https"
source_port = 443
destination_port = 8080
certificate_pem = file("fullchain.pem")
private_key_pem = file("key.pem")
}Terraform does not read the certificate or the key back, so they are empty after an import.
Result
201 with the service, certificateSource: "uploaded", certificateStatus: "active", the names
read from the certificate in domains and its expiry in certificateNotAfter.
Replace the certificate
A certificate cannot be replaced in place: remove the service (see Add or remove a service) and add it again with the new pair. The port is not served between the two steps.
When it is refused
400certificatePem is not a PEM-encoded X.509 certificate.400privateKeyPem is not a PEM-encoded private key (it must not be encrypted).400privateKeyPem is not the key of this certificate.400when the certificate has expired.400An uploaded certificate needs both certificatePem and privateKeyPem.400Give either domains (the platform issues the certificate) or an uploaded certificate, not both.400onapplicationanddedicatedfor a name outside your hosted zones, over 10 names, or for a name another load balancer serves (Already served by another load balancer on the fleet: …).409The load balancer is still provisioning; add the https service once it is active(lb11–lb31).502when the provider refuses the certificate (lb11–lb31); the service is not added.