Skip to content

Commit b000794

Browse files
committed
LB Hostname example updated
1 parent 1cb3a3a commit b000794

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

website/docs/r/load_balancer_hostname.html.markdown

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ This resource provides the Hostname resource in Oracle Cloud Infrastructure Load
1313
Adds a hostname resource to the specified load balancer. For more information, see
1414
[Managing Request Routing](https://docs.cloud.oracle.com/iaas/Content/Balance/Tasks/managingrequest.htm).
1515

16+
Set the terraform flag `lifecycle { create_before_destroy = true }` in your hostname to facilitate rotating hostnames.
17+
A hostname cannot be deleted if it is attached to another resource (a listener for example).
18+
Because hostname_names in the listener is an updatable parameter, terraform will attempt to recreate the hostname first and then update the listener but the hostname cannot be deleted while it is attached to a listener so it will fail.
19+
Setting the flag makes it so that when a hostname is recreated, the new hostname will be created first before the old one gets deleted.
1620

1721
## Example Usage
1822

@@ -22,6 +26,11 @@ resource "oci_load_balancer_hostname" "test_hostname" {
2226
hostname = "${var.hostname_hostname}"
2327
load_balancer_id = "${oci_load_balancer_load_balancer.test_load_balancer.id}"
2428
name = "${var.hostname_name}"
29+
30+
#Optional
31+
lifecycle {
32+
create_before_destroy = true
33+
}
2534
}
2635
```
2736

0 commit comments

Comments
 (0)