oci_load_balancer_certificate

This resource provides the Certificate resource in Oracle Cloud Infrastructure Load Balancer service.

Creates an asynchronous request to add an SSL certificate bundle.

Set the terraform flag lifecycle { create_before_destroy = true } in your certificate to facilitate rotating certificates. A certificate cannot be deleted if it is attached to another resource (a listener or a backend set for example). Because certificate_name in the listener is an updatable parameter, terraform will attempt to recreate the certificate first and then update the listener but the certificate cannot be deleted while it is attached to a listener so it will fail. Setting the flag makes it so that when a certificate is recreated, the new certificate will be created first before the old one gets deleted. Whenever you change any values on a certificate that causes it to be recreated the certificate_name MUST also change. Otherwise you will get an error saying that a certificate with that name already exists.

Example Usage

resource "oci_load_balancer_certificate" "test_certificate" {
	#Required
	certificate_name = var.certificate_certificate_name
	load_balancer_id = oci_load_balancer_load_balancer.test_load_balancer.id

	#Optional
	ca_certificate = var.certificate_ca_certificate
	passphrase = var.certificate_passphrase
	private_key = var.certificate_private_key
	public_certificate = var.certificate_public_certificate

	lifecycle {
	    create_before_destroy = true
	}
}

Argument Reference

The following arguments are supported:

** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

Attributes Reference

The following attributes are exported:

Timeouts

The timeouts block allows you to specify timeouts for certain operations: * create - (Defaults to 20 minutes), when creating the Certificate * update - (Defaults to 20 minutes), when updating the Certificate * delete - (Defaults to 20 minutes), when destroying the Certificate

Import

Certificates can be imported using the id, e.g.

$ terraform import oci_load_balancer_certificate.test_certificate "loadBalancers/{loadBalancerId}/certificates/{certificateName}"