Oracle Cloud Infrastructure

v0.5.0 published on Monday, Sep 12, 2022 by Pulumi

getBackends

This data source provides the list of Backends in Oracle Cloud Infrastructure Load Balancer service.

Lists the backend servers for a given load balancer and backend set.

Example Usage

using System.Collections.Generic;
using Pulumi;
using Oci = Pulumi.Oci;

return await Deployment.RunAsync(() => 
{
    var testBackends = Oci.LoadBalancer.GetBackends.Invoke(new()
    {
        BackendsetName = oci_load_balancer_backend_set.Test_backend_set.Name,
        LoadBalancerId = oci_load_balancer_load_balancer.Test_load_balancer.Id,
    });

});
package main

import (
	"github.com/pulumi/pulumi-oci/sdk/go/oci/LoadBalancer"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := LoadBalancer.GetBackends(ctx, &loadbalancer.GetBackendsArgs{
			BackendsetName: oci_load_balancer_backend_set.Test_backend_set.Name,
			LoadBalancerId: oci_load_balancer_load_balancer.Test_load_balancer.Id,
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.oci.LoadBalancer.LoadBalancerFunctions;
import com.pulumi.oci.LoadBalancer.inputs.GetBackendsArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        final var testBackends = LoadBalancerFunctions.getBackends(GetBackendsArgs.builder()
            .backendsetName(oci_load_balancer_backend_set.test_backend_set().name())
            .loadBalancerId(oci_load_balancer_load_balancer.test_load_balancer().id())
            .build());

    }
}
import pulumi
import pulumi_oci as oci

test_backends = oci.LoadBalancer.get_backends(backendset_name=oci_load_balancer_backend_set["test_backend_set"]["name"],
    load_balancer_id=oci_load_balancer_load_balancer["test_load_balancer"]["id"])
import * as pulumi from "@pulumi/pulumi";
import * as oci from "@pulumi/oci";

const testBackends = oci.LoadBalancer.getBackends({
    backendsetName: oci_load_balancer_backend_set.test_backend_set.name,
    loadBalancerId: oci_load_balancer_load_balancer.test_load_balancer.id,
});
variables:
  testBackends:
    Fn::Invoke:
      Function: oci:LoadBalancer:getBackends
      Arguments:
        backendsetName: ${oci_load_balancer_backend_set.test_backend_set.name}
        loadBalancerId: ${oci_load_balancer_load_balancer.test_load_balancer.id}

Using getBackends

Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

function getBackends(args: GetBackendsArgs, opts?: InvokeOptions): Promise<GetBackendsResult>
function getBackendsOutput(args: GetBackendsOutputArgs, opts?: InvokeOptions): Output<GetBackendsResult>
def get_backends(backendset_name: Optional[str] = None,
                 filters: Optional[Sequence[_loadbalancer.GetBackendsFilter]] = None,
                 load_balancer_id: Optional[str] = None,
                 opts: Optional[InvokeOptions] = None) -> GetBackendsResult
def get_backends_output(backendset_name: Optional[pulumi.Input[str]] = None,
                 filters: Optional[pulumi.Input[Sequence[pulumi.Input[_loadbalancer.GetBackendsFilterArgs]]]] = None,
                 load_balancer_id: Optional[pulumi.Input[str]] = None,
                 opts: Optional[InvokeOptions] = None) -> Output[GetBackendsResult]
func GetBackends(ctx *Context, args *GetBackendsArgs, opts ...InvokeOption) (*GetBackendsResult, error)
func GetBackendsOutput(ctx *Context, args *GetBackendsOutputArgs, opts ...InvokeOption) GetBackendsResultOutput

> Note: This function is named GetBackends in the Go SDK.

public static class GetBackends 
{
    public static Task<GetBackendsResult> InvokeAsync(GetBackendsArgs args, InvokeOptions? opts = null)
    public static Output<GetBackendsResult> Invoke(GetBackendsInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetBackendsResult> getBackends(GetBackendsArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
  function: oci:LoadBalancer/getBackends:getBackends
  arguments:
    # arguments dictionary

The following arguments are supported:

BackendsetName string

The name of the backend set associated with the backend servers. Example: example_backend_set

LoadBalancerId string

The OCID of the load balancer associated with the backend set and servers.

Filters List<GetBackendsFilter>
BackendsetName string

The name of the backend set associated with the backend servers. Example: example_backend_set

LoadBalancerId string

The OCID of the load balancer associated with the backend set and servers.

Filters []GetBackendsFilter
backendsetName String

The name of the backend set associated with the backend servers. Example: example_backend_set

loadBalancerId String

The OCID of the load balancer associated with the backend set and servers.

filters List<GetBackendsFilter>
backendsetName string

The name of the backend set associated with the backend servers. Example: example_backend_set

loadBalancerId string

The OCID of the load balancer associated with the backend set and servers.

filters GetBackendsFilter[]
backendset_name str

The name of the backend set associated with the backend servers. Example: example_backend_set

load_balancer_id str

The OCID of the load balancer associated with the backend set and servers.

filters GetBackendsFilter]
backendsetName String

The name of the backend set associated with the backend servers. Example: example_backend_set

loadBalancerId String

The OCID of the load balancer associated with the backend set and servers.

filters List<Property Map>

getBackends Result

The following output properties are available:

Backends List<GetBackendsBackend>

The list of backends.

BackendsetName string
Id string

The provider-assigned unique ID for this managed resource.

LoadBalancerId string
Filters List<GetBackendsFilter>
Backends []GetBackendsBackend

The list of backends.

BackendsetName string
Id string

The provider-assigned unique ID for this managed resource.

LoadBalancerId string
Filters []GetBackendsFilter
backends List<GetBackendsBackend>

The list of backends.

backendsetName String
id String

The provider-assigned unique ID for this managed resource.

loadBalancerId String
filters List<GetBackendsFilter>
backends GetBackendsBackend[]

The list of backends.

backendsetName string
id string

The provider-assigned unique ID for this managed resource.

loadBalancerId string
filters GetBackendsFilter[]
backends GetBackendsBackend]

The list of backends.

backendset_name str
id str

The provider-assigned unique ID for this managed resource.

load_balancer_id str
filters GetBackendsFilter]
backends List<Property Map>

The list of backends.

backendsetName String
id String

The provider-assigned unique ID for this managed resource.

loadBalancerId String
filters List<Property Map>

Supporting Types

GetBackendsBackend

BackendsetName string

The name of the backend set associated with the backend servers. Example: example_backend_set

Drain bool

Whether the load balancer should drain this server. Servers marked "drain" receive no new incoming traffic. Example: false

IpAddress string

The IP address of the backend server. Example: 10.0.0.3

LoadBalancerId string

The OCID of the load balancer associated with the backend set and servers.

Name string

A read-only field showing the IP address and port that uniquely identify this backend server in the backend set. Example: 10.0.0.3:8080

Offline bool

Whether the load balancer should treat this server as offline. Offline servers receive no incoming traffic. Example: false

Port int

The communication port for the backend server. Example: 8080

State string
Weight int

The load balancing policy weight assigned to the server. Backend servers with a higher weight receive a larger proportion of incoming traffic. For example, a server weighted '3' receives 3 times the number of new connections as a server weighted '1'. For more information on load balancing policies, see How Load Balancing Policies Work. Example: 3

Backup bool

Whether the load balancer should treat this server as a backup unit. If true, the load balancer forwards no ingress traffic to this backend server unless all other backend servers not marked as "backup" fail the health check policy.

BackendsetName string

The name of the backend set associated with the backend servers. Example: example_backend_set

Drain bool

Whether the load balancer should drain this server. Servers marked "drain" receive no new incoming traffic. Example: false

IpAddress string

The IP address of the backend server. Example: 10.0.0.3

LoadBalancerId string

The OCID of the load balancer associated with the backend set and servers.

Name string

A read-only field showing the IP address and port that uniquely identify this backend server in the backend set. Example: 10.0.0.3:8080

Offline bool

Whether the load balancer should treat this server as offline. Offline servers receive no incoming traffic. Example: false

Port int

The communication port for the backend server. Example: 8080

State string
Weight int

The load balancing policy weight assigned to the server. Backend servers with a higher weight receive a larger proportion of incoming traffic. For example, a server weighted '3' receives 3 times the number of new connections as a server weighted '1'. For more information on load balancing policies, see How Load Balancing Policies Work. Example: 3

Backup bool

Whether the load balancer should treat this server as a backup unit. If true, the load balancer forwards no ingress traffic to this backend server unless all other backend servers not marked as "backup" fail the health check policy.

backendsetName String

The name of the backend set associated with the backend servers. Example: example_backend_set

drain Boolean

Whether the load balancer should drain this server. Servers marked "drain" receive no new incoming traffic. Example: false

ipAddress String

The IP address of the backend server. Example: 10.0.0.3

loadBalancerId String

The OCID of the load balancer associated with the backend set and servers.

name String

A read-only field showing the IP address and port that uniquely identify this backend server in the backend set. Example: 10.0.0.3:8080

offline Boolean

Whether the load balancer should treat this server as offline. Offline servers receive no incoming traffic. Example: false

port Integer

The communication port for the backend server. Example: 8080

state String
weight Integer

The load balancing policy weight assigned to the server. Backend servers with a higher weight receive a larger proportion of incoming traffic. For example, a server weighted '3' receives 3 times the number of new connections as a server weighted '1'. For more information on load balancing policies, see How Load Balancing Policies Work. Example: 3

backup Boolean

Whether the load balancer should treat this server as a backup unit. If true, the load balancer forwards no ingress traffic to this backend server unless all other backend servers not marked as "backup" fail the health check policy.

backendsetName string

The name of the backend set associated with the backend servers. Example: example_backend_set

drain boolean

Whether the load balancer should drain this server. Servers marked "drain" receive no new incoming traffic. Example: false

ipAddress string

The IP address of the backend server. Example: 10.0.0.3

loadBalancerId string

The OCID of the load balancer associated with the backend set and servers.

name string

A read-only field showing the IP address and port that uniquely identify this backend server in the backend set. Example: 10.0.0.3:8080

offline boolean

Whether the load balancer should treat this server as offline. Offline servers receive no incoming traffic. Example: false

port number

The communication port for the backend server. Example: 8080

state string
weight number

The load balancing policy weight assigned to the server. Backend servers with a higher weight receive a larger proportion of incoming traffic. For example, a server weighted '3' receives 3 times the number of new connections as a server weighted '1'. For more information on load balancing policies, see How Load Balancing Policies Work. Example: 3

backup boolean

Whether the load balancer should treat this server as a backup unit. If true, the load balancer forwards no ingress traffic to this backend server unless all other backend servers not marked as "backup" fail the health check policy.

backendset_name str

The name of the backend set associated with the backend servers. Example: example_backend_set

drain bool

Whether the load balancer should drain this server. Servers marked "drain" receive no new incoming traffic. Example: false

ip_address str

The IP address of the backend server. Example: 10.0.0.3

load_balancer_id str

The OCID of the load balancer associated with the backend set and servers.

name str

A read-only field showing the IP address and port that uniquely identify this backend server in the backend set. Example: 10.0.0.3:8080

offline bool

Whether the load balancer should treat this server as offline. Offline servers receive no incoming traffic. Example: false

port int

The communication port for the backend server. Example: 8080

state str
weight int

The load balancing policy weight assigned to the server. Backend servers with a higher weight receive a larger proportion of incoming traffic. For example, a server weighted '3' receives 3 times the number of new connections as a server weighted '1'. For more information on load balancing policies, see How Load Balancing Policies Work. Example: 3

backup bool

Whether the load balancer should treat this server as a backup unit. If true, the load balancer forwards no ingress traffic to this backend server unless all other backend servers not marked as "backup" fail the health check policy.

backendsetName String

The name of the backend set associated with the backend servers. Example: example_backend_set

drain Boolean

Whether the load balancer should drain this server. Servers marked "drain" receive no new incoming traffic. Example: false

ipAddress String

The IP address of the backend server. Example: 10.0.0.3

loadBalancerId String

The OCID of the load balancer associated with the backend set and servers.

name String

A read-only field showing the IP address and port that uniquely identify this backend server in the backend set. Example: 10.0.0.3:8080

offline Boolean

Whether the load balancer should treat this server as offline. Offline servers receive no incoming traffic. Example: false

port Number

The communication port for the backend server. Example: 8080

state String
weight Number

The load balancing policy weight assigned to the server. Backend servers with a higher weight receive a larger proportion of incoming traffic. For example, a server weighted '3' receives 3 times the number of new connections as a server weighted '1'. For more information on load balancing policies, see How Load Balancing Policies Work. Example: 3

backup Boolean

Whether the load balancer should treat this server as a backup unit. If true, the load balancer forwards no ingress traffic to this backend server unless all other backend servers not marked as "backup" fail the health check policy.

GetBackendsFilter

Name string

A read-only field showing the IP address and port that uniquely identify this backend server in the backend set. Example: 10.0.0.3:8080

Values List<string>
Regex bool
Name string

A read-only field showing the IP address and port that uniquely identify this backend server in the backend set. Example: 10.0.0.3:8080

Values []string
Regex bool
name String

A read-only field showing the IP address and port that uniquely identify this backend server in the backend set. Example: 10.0.0.3:8080

values List<String>
regex Boolean
name string

A read-only field showing the IP address and port that uniquely identify this backend server in the backend set. Example: 10.0.0.3:8080

values string[]
regex boolean
name str

A read-only field showing the IP address and port that uniquely identify this backend server in the backend set. Example: 10.0.0.3:8080

values Sequence[str]
regex bool
name String

A read-only field showing the IP address and port that uniquely identify this backend server in the backend set. Example: 10.0.0.3:8080

values List<String>
regex Boolean

Package Details

Repository
https://github.com/pulumi/pulumi-oci
License
Apache-2.0
Notes

This Pulumi package is based on the oci Terraform Provider.