oci_load_balancer_backend_set

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

Adds a backend set to a load balancer.

Supported Aliases

Example Usage

resource "oci_load_balancer_backend_set" "test_backend_set" {
    #Required
    health_checker {
        #Required
        protocol = var.backend_set_health_checker_protocol

        #Optional
        interval_ms = var.backend_set_health_checker_interval_ms
        is_force_plain_text = var.backend_set_health_checker_is_force_plain_text
        port = var.backend_set_health_checker_port
        response_body_regex = var.backend_set_health_checker_response_body_regex
        retries = var.backend_set_health_checker_retries
        return_code = var.backend_set_health_checker_return_code
        timeout_in_millis = var.backend_set_health_checker_timeout_in_millis
        url_path = var.backend_set_health_checker_url_path
    }
    load_balancer_id = oci_load_balancer_load_balancer.test_load_balancer.id
    name = var.backend_set_name
    policy = var.backend_set_policy

    #Optional
    backend_max_connections = var.backend_set_backend_max_connections
    lb_cookie_session_persistence_configuration {

        #Optional
        cookie_name = var.backend_set_lb_cookie_session_persistence_configuration_cookie_name
        disable_fallback = var.backend_set_lb_cookie_session_persistence_configuration_disable_fallback
        domain = var.backend_set_lb_cookie_session_persistence_configuration_domain
        is_http_only = var.backend_set_lb_cookie_session_persistence_configuration_is_http_only
        is_secure = var.backend_set_lb_cookie_session_persistence_configuration_is_secure
        max_age_in_seconds = var.backend_set_lb_cookie_session_persistence_configuration_max_age_in_seconds
        path = var.backend_set_lb_cookie_session_persistence_configuration_path
    }
    session_persistence_configuration {
        #Required
        cookie_name = var.backend_set_session_persistence_configuration_cookie_name

        #Optional
        disable_fallback = var.backend_set_session_persistence_configuration_disable_fallback
    }
    ssl_configuration {

        #Optional
        certificate_ids = var.backend_set_ssl_configuration_certificate_ids
        certificate_name = oci_load_balancer_certificate.test_certificate.name
        cipher_suite_name = var.backend_set_ssl_configuration_cipher_suite_name
        protocols = var.backend_set_ssl_configuration_protocols
        server_order_preference = var.backend_set_ssl_configuration_server_order_preference
        trusted_certificate_authority_ids = var.backend_set_ssl_configuration_trusted_certificate_authority_ids
        verify_depth = var.backend_set_ssl_configuration_verify_depth
        verify_peer_certificate = var.backend_set_ssl_configuration_verify_peer_certificate
    }
}

Note: The sessionPersistenceConfiguration (application cookie stickiness) and lbCookieSessionPersistenceConfiguration (LB cookie stickiness) attributes are mutually exclusive. To avoid returning an error, configure only one of these two attributes per backend set.

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: md5-b5aab424929d81f2d744c96a00d97c90

If the value of the Domain attribute is example.com in the Set-cookie header, the client includes the same cookie in the Cookie header when making HTTP requests to example.com, www.example.com, and www.abc.example.com. If the Domain attribute is not present, the client returns the cookie only for the domain to which the original request was made.

Example: example.com

  • is_http_only - Whether the Set-cookie header should contain the HttpOnly attribute. If true, the Set-cookie header inserted by the load balancer contains the HttpOnly attribute, which limits the scope of the cookie to HTTP requests. This attribute directs the client or browser to omit the cookie when providing access to cookies through non-HTTP APIs. For example, it restricts the cookie from JavaScript channels. Example: true
  • is_secure - Whether the Set-cookie header should contain the Secure attribute. If true, the Set-cookie header inserted by the load balancer contains the Secure attribute, which directs the client or browser to send the cookie only using a secure protocol.

    Note: If you set this field to true, you cannot associate the corresponding backend set with an HTTP listener.

    Example: true

  • max_age_in_seconds - The amount of time the cookie remains valid. The Set-cookie header inserted by the load balancer contains a Max-Age attribute with the specified value.

    The specified value must be at least one second. There is no default value for this attribute. If you do not specify a value, the load balancer does not include the Max-Age attribute in the Set-cookie header. In most cases, the client or browser retains the cookie until the current session ends, as defined by the client.

    Example: 3600

  • path - The path in which the cookie is valid. The Set-cookie header inserted by the load balancer contains a Path attribute with the specified value.

    Clients include the cookie in an HTTP request only if the path portion of the request-uri matches, or is a subdirectory of, the cookie's Path attribute.

    The default value is /.

    Example: /example

  • name - A friendly name for the backend set. It must be unique and it cannot be changed.

    Valid backend set names include only alphanumeric characters, dashes, and underscores. Backend set names cannot contain spaces. Avoid entering confidential information.

    Example: example_backend_set

  • policy - The load balancer policy for the backend set. To get a list of available policies, use the ListPolicies operation. Example: LEAST_CONNECTIONS
  • session_persistence_configuration - The configuration details for implementing session persistence based on a user-specified cookie name (application cookie stickiness).

    Session persistence enables the Load Balancing service to direct any number of requests that originate from a single logical client to a single backend web server. For more information, see Session Persistence.

    With application cookie stickiness, the load balancer enables session persistence only when the response from a backend application server includes a Set-cookie header with the user-specified cookie name.

    To disable application cookie stickiness on a running load balancer, use the UpdateBackendSet operation and specify null for the SessionPersistenceConfigurationDetails object.

    Example: SessionPersistenceConfigurationDetails: null

    Note: SessionPersistenceConfigurationDetails (application cookie stickiness) and LBCookieSessionPersistenceConfigurationDetails (LB cookie stickiness) are mutually exclusive. An error results if you try to enable both types of session persistence.

    Warning: Oracle recommends that you avoid using any confidential information when you supply string values using the API.

  • ssl_configuration - A listener's SSL handling configuration.

    To use SSL, a listener must be associated with a certificate bundle.

    Warning: Oracle recommends that you avoid using any confidential information when you supply string values using the API.

  • Timeouts

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

    Import

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

    $ terraform import oci_load_balancer_backend_set.test_backend_set "loadBalancers/{loadBalancerId}/backendSets/{backendSetName}"