oci_load_balancer_load_balancer

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

Creates a new load balancer in the specified compartment. For general information about load balancers, see Overview of the Load Balancing Service.

For the purposes of access control, you must provide the OCID of the compartment where you want the load balancer to reside. Notice that the load balancer doesn’t have to be in the same compartment as the VCN or backend set. If you’re not sure which compartment to use, put the load balancer in the same compartment as the VCN. For information about access control and compartments, see Overview of the IAM Service.

You must specify a display name for the load balancer. It does not have to be unique, and you can change it.

For information about Availability Domains, see Regions and Availability Domains. To get a list of Availability Domains, use the ListAvailabilityDomains operation in the Identity and Access Management Service API.

All Oracle Cloud Infrastructure resources, including load balancers, get an Oracle-assigned, unique ID called an Oracle Cloud Identifier (OCID). When you create a resource, you can find its OCID in the response. You can also retrieve a resource’s OCID by using a List API operation on that resource type, or by viewing the resource in the Console. Fore more information, see Resource Identifiers.

When you create a load balancer, the system assigns an IP address. To get the IP address, use the GetLoadBalancer operation.

Supported Aliases

Example Usage

resource "oci_load_balancer_load_balancer" "test_load_balancer" {
	#Required
	compartment_id = var.compartment_id
	display_name = var.load_balancer_display_name
	shape = var.load_balancer_shape
	subnet_ids = var.load_balancer_subnet_ids

	#Optional
	defined_tags = {"Operations.CostCenter"= "42"}
	freeform_tags = {"Department"= "Finance"}
	ip_mode = var.load_balancer_ip_mode
	is_private = var.load_balancer_is_private
	network_security_group_ids = var.load_balancer_network_security_group_ids
	reserved_ips {

		#Optional
		id = var.load_balancer_reserved_ips_id
	}
	shape_details {
		#Required
		maximum_bandwidth_in_mbps = var.load_balancer_shape_details_maximum_bandwidth_in_mbps
		minimum_bandwidth_in_mbps = var.load_balancer_shape_details_minimum_bandwidth_in_mbps
	}
}

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 Load Balancer * update - (Defaults to 20 minutes), when updating the Load Balancer * delete - (Defaults to 20 minutes), when destroying the Load Balancer

Import

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

$ terraform import oci_load_balancer_load_balancer.test_load_balancer "id"