ionoscloud.nlb.getBalancer
Explore with Pulumi AI
The Network Load Balancer data source can be used to search for and return existing network load balancers. If a single match is found, it will be returned. If your search results in multiple matches, an error will be returned. When this happens, please refine your search string so that it is specific enough to return only one result.
Example Usage
By ID
import * as pulumi from "@pulumi/pulumi";
import * as ionoscloud from "@pulumi/ionoscloud";
const example = ionoscloud.nlb.getBalancer({
datacenterId: exampleIonoscloudDatacenter.id,
id: "networkloadbalancer_id",
});
import pulumi
import pulumi_ionoscloud as ionoscloud
example = ionoscloud.nlb.get_balancer(datacenter_id=example_ionoscloud_datacenter["id"],
id="networkloadbalancer_id")
package main
import (
"github.com/ionos-cloud/pulumi-ionoscloud/sdk/go/ionoscloud/nlb"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := nlb.LookupBalancer(ctx, &nlb.LookupBalancerArgs{
DatacenterId: exampleIonoscloudDatacenter.Id,
Id: pulumi.StringRef("networkloadbalancer_id"),
}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Ionoscloud = Pulumi.Ionoscloud;
return await Deployment.RunAsync(() =>
{
var example = Ionoscloud.Nlb.GetBalancer.Invoke(new()
{
DatacenterId = exampleIonoscloudDatacenter.Id,
Id = "networkloadbalancer_id",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.ionoscloud.nlb.NlbFunctions;
import com.pulumi.ionoscloud.nlb.inputs.GetBalancerArgs;
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 example = NlbFunctions.getBalancer(GetBalancerArgs.builder()
.datacenterId(exampleIonoscloudDatacenter.id())
.id("networkloadbalancer_id")
.build());
}
}
variables:
example:
fn::invoke:
function: ionoscloud:nlb:getBalancer
arguments:
datacenterId: ${exampleIonoscloudDatacenter.id}
id: networkloadbalancer_id
By Name
import * as pulumi from "@pulumi/pulumi";
import * as ionoscloud from "@pulumi/ionoscloud";
const example = ionoscloud.nlb.getBalancer({
datacenterId: exampleIonoscloudDatacenter.id,
name: "Network Load Balancer Name",
});
import pulumi
import pulumi_ionoscloud as ionoscloud
example = ionoscloud.nlb.get_balancer(datacenter_id=example_ionoscloud_datacenter["id"],
name="Network Load Balancer Name")
package main
import (
"github.com/ionos-cloud/pulumi-ionoscloud/sdk/go/ionoscloud/nlb"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := nlb.LookupBalancer(ctx, &nlb.LookupBalancerArgs{
DatacenterId: exampleIonoscloudDatacenter.Id,
Name: pulumi.StringRef("Network Load Balancer Name"),
}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Ionoscloud = Pulumi.Ionoscloud;
return await Deployment.RunAsync(() =>
{
var example = Ionoscloud.Nlb.GetBalancer.Invoke(new()
{
DatacenterId = exampleIonoscloudDatacenter.Id,
Name = "Network Load Balancer Name",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.ionoscloud.nlb.NlbFunctions;
import com.pulumi.ionoscloud.nlb.inputs.GetBalancerArgs;
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 example = NlbFunctions.getBalancer(GetBalancerArgs.builder()
.datacenterId(exampleIonoscloudDatacenter.id())
.name("Network Load Balancer Name")
.build());
}
}
variables:
example:
fn::invoke:
function: ionoscloud:nlb:getBalancer
arguments:
datacenterId: ${exampleIonoscloudDatacenter.id}
name: Network Load Balancer Name
Using getBalancer
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 getBalancer(args: GetBalancerArgs, opts?: InvokeOptions): Promise<GetBalancerResult>
function getBalancerOutput(args: GetBalancerOutputArgs, opts?: InvokeOptions): Output<GetBalancerResult>
def get_balancer(datacenter_id: Optional[str] = None,
id: Optional[str] = None,
name: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetBalancerResult
def get_balancer_output(datacenter_id: Optional[pulumi.Input[str]] = None,
id: Optional[pulumi.Input[str]] = None,
name: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetBalancerResult]
func LookupBalancer(ctx *Context, args *LookupBalancerArgs, opts ...InvokeOption) (*LookupBalancerResult, error)
func LookupBalancerOutput(ctx *Context, args *LookupBalancerOutputArgs, opts ...InvokeOption) LookupBalancerResultOutput
> Note: This function is named LookupBalancer
in the Go SDK.
public static class GetBalancer
{
public static Task<GetBalancerResult> InvokeAsync(GetBalancerArgs args, InvokeOptions? opts = null)
public static Output<GetBalancerResult> Invoke(GetBalancerInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetBalancerResult> getBalancer(GetBalancerArgs args, InvokeOptions options)
public static Output<GetBalancerResult> getBalancer(GetBalancerArgs args, InvokeOptions options)
fn::invoke:
function: ionoscloud:nlb/getBalancer:getBalancer
arguments:
# arguments dictionary
The following arguments are supported:
- Datacenter
Id string - Datacenter's UUID.
- Id string
ID of the network load balancer you want to search for.
datacenter_id
and eithername
orid
must be provided. If none, or both ofname
andid
are provided, the datasource will return an error.- Name string
- Name of an existing network load balancer that you want to search for.
- Datacenter
Id string - Datacenter's UUID.
- Id string
ID of the network load balancer you want to search for.
datacenter_id
and eithername
orid
must be provided. If none, or both ofname
andid
are provided, the datasource will return an error.- Name string
- Name of an existing network load balancer that you want to search for.
- datacenter
Id String - Datacenter's UUID.
- id String
ID of the network load balancer you want to search for.
datacenter_id
and eithername
orid
must be provided. If none, or both ofname
andid
are provided, the datasource will return an error.- name String
- Name of an existing network load balancer that you want to search for.
- datacenter
Id string - Datacenter's UUID.
- id string
ID of the network load balancer you want to search for.
datacenter_id
and eithername
orid
must be provided. If none, or both ofname
andid
are provided, the datasource will return an error.- name string
- Name of an existing network load balancer that you want to search for.
- datacenter_
id str - Datacenter's UUID.
- id str
ID of the network load balancer you want to search for.
datacenter_id
and eithername
orid
must be provided. If none, or both ofname
andid
are provided, the datasource will return an error.- name str
- Name of an existing network load balancer that you want to search for.
- datacenter
Id String - Datacenter's UUID.
- id String
ID of the network load balancer you want to search for.
datacenter_id
and eithername
orid
must be provided. If none, or both ofname
andid
are provided, the datasource will return an error.- name String
- Name of an existing network load balancer that you want to search for.
getBalancer Result
The following output properties are available:
- Central
Logging bool - Turn logging on and off for this product. Default value is 'false'.
- Datacenter
Id string - Flowlogs
List<Ionoscloud.
Get Balancer Flowlog> - Only 1 flow log can be configured. Only the name field can change as part of an update. Flow logs holistically capture network information such as source and destination IP addresses, source and destination ports, number of packets, amount of bytes, the start and end time of the recording, and the type of protocol – and log the extent to which your instances are being accessed.
- Id string
- Id of that Network Load Balancer
- Ips List<string>
- Collection of IP addresses of the Network Load Balancer. (inbound and outbound) IP of the listenerLan must be a customer reserved IP for the public load balancer and private IP for the private load balancer.
- Lb
Private List<string>Ips - Collection of private IP addresses with subnet mask of the Network Load Balancer. IPs must contain valid subnet mask. If user will not provide any IP then the system will generate one IP with /24 subnet.
- Listener
Lan int - Id of the listening LAN. (inbound)
- Logging
Format string - Name string
- Specifies the name of the flow log.
- Target
Lan int - Id of the balanced private target LAN. (outbound)
- Central
Logging bool - Turn logging on and off for this product. Default value is 'false'.
- Datacenter
Id string - Flowlogs
[]Get
Balancer Flowlog - Only 1 flow log can be configured. Only the name field can change as part of an update. Flow logs holistically capture network information such as source and destination IP addresses, source and destination ports, number of packets, amount of bytes, the start and end time of the recording, and the type of protocol – and log the extent to which your instances are being accessed.
- Id string
- Id of that Network Load Balancer
- Ips []string
- Collection of IP addresses of the Network Load Balancer. (inbound and outbound) IP of the listenerLan must be a customer reserved IP for the public load balancer and private IP for the private load balancer.
- Lb
Private []stringIps - Collection of private IP addresses with subnet mask of the Network Load Balancer. IPs must contain valid subnet mask. If user will not provide any IP then the system will generate one IP with /24 subnet.
- Listener
Lan int - Id of the listening LAN. (inbound)
- Logging
Format string - Name string
- Specifies the name of the flow log.
- Target
Lan int - Id of the balanced private target LAN. (outbound)
- central
Logging Boolean - Turn logging on and off for this product. Default value is 'false'.
- datacenter
Id String - flowlogs
List<Get
Balancer Flowlog> - Only 1 flow log can be configured. Only the name field can change as part of an update. Flow logs holistically capture network information such as source and destination IP addresses, source and destination ports, number of packets, amount of bytes, the start and end time of the recording, and the type of protocol – and log the extent to which your instances are being accessed.
- id String
- Id of that Network Load Balancer
- ips List<String>
- Collection of IP addresses of the Network Load Balancer. (inbound and outbound) IP of the listenerLan must be a customer reserved IP for the public load balancer and private IP for the private load balancer.
- lb
Private List<String>Ips - Collection of private IP addresses with subnet mask of the Network Load Balancer. IPs must contain valid subnet mask. If user will not provide any IP then the system will generate one IP with /24 subnet.
- listener
Lan Integer - Id of the listening LAN. (inbound)
- logging
Format String - name String
- Specifies the name of the flow log.
- target
Lan Integer - Id of the balanced private target LAN. (outbound)
- central
Logging boolean - Turn logging on and off for this product. Default value is 'false'.
- datacenter
Id string - flowlogs
Get
Balancer Flowlog[] - Only 1 flow log can be configured. Only the name field can change as part of an update. Flow logs holistically capture network information such as source and destination IP addresses, source and destination ports, number of packets, amount of bytes, the start and end time of the recording, and the type of protocol – and log the extent to which your instances are being accessed.
- id string
- Id of that Network Load Balancer
- ips string[]
- Collection of IP addresses of the Network Load Balancer. (inbound and outbound) IP of the listenerLan must be a customer reserved IP for the public load balancer and private IP for the private load balancer.
- lb
Private string[]Ips - Collection of private IP addresses with subnet mask of the Network Load Balancer. IPs must contain valid subnet mask. If user will not provide any IP then the system will generate one IP with /24 subnet.
- listener
Lan number - Id of the listening LAN. (inbound)
- logging
Format string - name string
- Specifies the name of the flow log.
- target
Lan number - Id of the balanced private target LAN. (outbound)
- central_
logging bool - Turn logging on and off for this product. Default value is 'false'.
- datacenter_
id str - flowlogs
Sequence[Get
Balancer Flowlog] - Only 1 flow log can be configured. Only the name field can change as part of an update. Flow logs holistically capture network information such as source and destination IP addresses, source and destination ports, number of packets, amount of bytes, the start and end time of the recording, and the type of protocol – and log the extent to which your instances are being accessed.
- id str
- Id of that Network Load Balancer
- ips Sequence[str]
- Collection of IP addresses of the Network Load Balancer. (inbound and outbound) IP of the listenerLan must be a customer reserved IP for the public load balancer and private IP for the private load balancer.
- lb_
private_ Sequence[str]ips - Collection of private IP addresses with subnet mask of the Network Load Balancer. IPs must contain valid subnet mask. If user will not provide any IP then the system will generate one IP with /24 subnet.
- listener_
lan int - Id of the listening LAN. (inbound)
- logging_
format str - name str
- Specifies the name of the flow log.
- target_
lan int - Id of the balanced private target LAN. (outbound)
- central
Logging Boolean - Turn logging on and off for this product. Default value is 'false'.
- datacenter
Id String - flowlogs List<Property Map>
- Only 1 flow log can be configured. Only the name field can change as part of an update. Flow logs holistically capture network information such as source and destination IP addresses, source and destination ports, number of packets, amount of bytes, the start and end time of the recording, and the type of protocol – and log the extent to which your instances are being accessed.
- id String
- Id of that Network Load Balancer
- ips List<String>
- Collection of IP addresses of the Network Load Balancer. (inbound and outbound) IP of the listenerLan must be a customer reserved IP for the public load balancer and private IP for the private load balancer.
- lb
Private List<String>Ips - Collection of private IP addresses with subnet mask of the Network Load Balancer. IPs must contain valid subnet mask. If user will not provide any IP then the system will generate one IP with /24 subnet.
- listener
Lan Number - Id of the listening LAN. (inbound)
- logging
Format String - name String
- Specifies the name of the flow log.
- target
Lan Number - Id of the balanced private target LAN. (outbound)
Supporting Types
GetBalancerFlowlog
- Action string
- Specifies the action to be taken when the rule is matched. Possible values: ACCEPTED, REJECTED, ALL. Immutable, forces re-creation.
- Bucket string
- Specifies the IONOS Object Storage bucket where the flow log data will be stored. The bucket must exist. Immutable, forces re-creation.
- Direction string
- Specifies the traffic direction pattern. Valid values: INGRESS, EGRESS, BIDIRECTIONAL. Immutable, forces re-creation.
- Id string
ID of the network load balancer you want to search for.
datacenter_id
and eithername
orid
must be provided. If none, or both ofname
andid
are provided, the datasource will return an error.- Name string
- Name of an existing network load balancer that you want to search for.
- Action string
- Specifies the action to be taken when the rule is matched. Possible values: ACCEPTED, REJECTED, ALL. Immutable, forces re-creation.
- Bucket string
- Specifies the IONOS Object Storage bucket where the flow log data will be stored. The bucket must exist. Immutable, forces re-creation.
- Direction string
- Specifies the traffic direction pattern. Valid values: INGRESS, EGRESS, BIDIRECTIONAL. Immutable, forces re-creation.
- Id string
ID of the network load balancer you want to search for.
datacenter_id
and eithername
orid
must be provided. If none, or both ofname
andid
are provided, the datasource will return an error.- Name string
- Name of an existing network load balancer that you want to search for.
- action String
- Specifies the action to be taken when the rule is matched. Possible values: ACCEPTED, REJECTED, ALL. Immutable, forces re-creation.
- bucket String
- Specifies the IONOS Object Storage bucket where the flow log data will be stored. The bucket must exist. Immutable, forces re-creation.
- direction String
- Specifies the traffic direction pattern. Valid values: INGRESS, EGRESS, BIDIRECTIONAL. Immutable, forces re-creation.
- id String
ID of the network load balancer you want to search for.
datacenter_id
and eithername
orid
must be provided. If none, or both ofname
andid
are provided, the datasource will return an error.- name String
- Name of an existing network load balancer that you want to search for.
- action string
- Specifies the action to be taken when the rule is matched. Possible values: ACCEPTED, REJECTED, ALL. Immutable, forces re-creation.
- bucket string
- Specifies the IONOS Object Storage bucket where the flow log data will be stored. The bucket must exist. Immutable, forces re-creation.
- direction string
- Specifies the traffic direction pattern. Valid values: INGRESS, EGRESS, BIDIRECTIONAL. Immutable, forces re-creation.
- id string
ID of the network load balancer you want to search for.
datacenter_id
and eithername
orid
must be provided. If none, or both ofname
andid
are provided, the datasource will return an error.- name string
- Name of an existing network load balancer that you want to search for.
- action str
- Specifies the action to be taken when the rule is matched. Possible values: ACCEPTED, REJECTED, ALL. Immutable, forces re-creation.
- bucket str
- Specifies the IONOS Object Storage bucket where the flow log data will be stored. The bucket must exist. Immutable, forces re-creation.
- direction str
- Specifies the traffic direction pattern. Valid values: INGRESS, EGRESS, BIDIRECTIONAL. Immutable, forces re-creation.
- id str
ID of the network load balancer you want to search for.
datacenter_id
and eithername
orid
must be provided. If none, or both ofname
andid
are provided, the datasource will return an error.- name str
- Name of an existing network load balancer that you want to search for.
- action String
- Specifies the action to be taken when the rule is matched. Possible values: ACCEPTED, REJECTED, ALL. Immutable, forces re-creation.
- bucket String
- Specifies the IONOS Object Storage bucket where the flow log data will be stored. The bucket must exist. Immutable, forces re-creation.
- direction String
- Specifies the traffic direction pattern. Valid values: INGRESS, EGRESS, BIDIRECTIONAL. Immutable, forces re-creation.
- id String
ID of the network load balancer you want to search for.
datacenter_id
and eithername
orid
must be provided. If none, or both ofname
andid
are provided, the datasource will return an error.- name String
- Name of an existing network load balancer that you want to search for.
Package Details
- Repository
- ionoscloud ionos-cloud/pulumi-ionoscloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
ionoscloud
Terraform Provider.