1. Packages
  2. Ionoscloud
  3. API Docs
  4. nlb
  5. getForwardingRule
IonosCloud v0.2.2 published on Monday, May 12, 2025 by ionos-cloud

ionoscloud.nlb.getForwardingRule

Explore with Pulumi AI

ionoscloud logo
IonosCloud v0.2.2 published on Monday, May 12, 2025 by ionos-cloud

    The Network Load Balancer Forwarding Rule data source can be used to search for and return existing network forwarding rules. 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.

    By ID

    import * as pulumi from "@pulumi/pulumi";
    import * as ionoscloud from "@pulumi/ionoscloud";
    
    const example = ionoscloud.nlb.getForwardingRule({
        datacenterId: "datacenter_id",
        networkloadbalancerId: "networkloadbalancer_id",
        id: "networkloadbalancer_forwardingrule_id",
    });
    
    import pulumi
    import pulumi_ionoscloud as ionoscloud
    
    example = ionoscloud.nlb.get_forwarding_rule(datacenter_id="datacenter_id",
        networkloadbalancer_id="networkloadbalancer_id",
        id="networkloadbalancer_forwardingrule_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.LookupForwardingRule(ctx, &nlb.LookupForwardingRuleArgs{
    			DatacenterId:          "datacenter_id",
    			NetworkloadbalancerId: "networkloadbalancer_id",
    			Id:                    pulumi.StringRef("networkloadbalancer_forwardingrule_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.GetForwardingRule.Invoke(new()
        {
            DatacenterId = "datacenter_id",
            NetworkloadbalancerId = "networkloadbalancer_id",
            Id = "networkloadbalancer_forwardingrule_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.GetForwardingRuleArgs;
    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.getForwardingRule(GetForwardingRuleArgs.builder()
                .datacenterId("datacenter_id")
                .networkloadbalancerId("networkloadbalancer_id")
                .id("networkloadbalancer_forwardingrule_id")
                .build());
    
        }
    }
    
    variables:
      example:
        fn::invoke:
          function: ionoscloud:nlb:getForwardingRule
          arguments:
            datacenterId: datacenter_id
            networkloadbalancerId: networkloadbalancer_id
            id: networkloadbalancer_forwardingrule_id
    

    By Name

    import * as pulumi from "@pulumi/pulumi";
    import * as ionoscloud from "@pulumi/ionoscloud";
    
    const example = ionoscloud.nlb.getForwardingRule({
        datacenterId: "datacenter_id",
        networkloadbalancerId: "networkloadbalancer_id",
        name: "Network Load Balancer Forwarding Rule Example",
    });
    
    import pulumi
    import pulumi_ionoscloud as ionoscloud
    
    example = ionoscloud.nlb.get_forwarding_rule(datacenter_id="datacenter_id",
        networkloadbalancer_id="networkloadbalancer_id",
        name="Network Load Balancer Forwarding Rule Example")
    
    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.LookupForwardingRule(ctx, &nlb.LookupForwardingRuleArgs{
    			DatacenterId:          "datacenter_id",
    			NetworkloadbalancerId: "networkloadbalancer_id",
    			Name:                  pulumi.StringRef("Network Load Balancer Forwarding Rule Example"),
    		}, 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.GetForwardingRule.Invoke(new()
        {
            DatacenterId = "datacenter_id",
            NetworkloadbalancerId = "networkloadbalancer_id",
            Name = "Network Load Balancer Forwarding Rule Example",
        });
    
    });
    
    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.GetForwardingRuleArgs;
    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.getForwardingRule(GetForwardingRuleArgs.builder()
                .datacenterId("datacenter_id")
                .networkloadbalancerId("networkloadbalancer_id")
                .name("Network Load Balancer Forwarding Rule Example")
                .build());
    
        }
    }
    
    variables:
      example:
        fn::invoke:
          function: ionoscloud:nlb:getForwardingRule
          arguments:
            datacenterId: datacenter_id
            networkloadbalancerId: networkloadbalancer_id
            name: Network Load Balancer Forwarding Rule Example
    

    Using getForwardingRule

    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 getForwardingRule(args: GetForwardingRuleArgs, opts?: InvokeOptions): Promise<GetForwardingRuleResult>
    function getForwardingRuleOutput(args: GetForwardingRuleOutputArgs, opts?: InvokeOptions): Output<GetForwardingRuleResult>
    def get_forwarding_rule(datacenter_id: Optional[str] = None,
                            id: Optional[str] = None,
                            name: Optional[str] = None,
                            networkloadbalancer_id: Optional[str] = None,
                            opts: Optional[InvokeOptions] = None) -> GetForwardingRuleResult
    def get_forwarding_rule_output(datacenter_id: Optional[pulumi.Input[str]] = None,
                            id: Optional[pulumi.Input[str]] = None,
                            name: Optional[pulumi.Input[str]] = None,
                            networkloadbalancer_id: Optional[pulumi.Input[str]] = None,
                            opts: Optional[InvokeOptions] = None) -> Output[GetForwardingRuleResult]
    func LookupForwardingRule(ctx *Context, args *LookupForwardingRuleArgs, opts ...InvokeOption) (*LookupForwardingRuleResult, error)
    func LookupForwardingRuleOutput(ctx *Context, args *LookupForwardingRuleOutputArgs, opts ...InvokeOption) LookupForwardingRuleResultOutput

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

    public static class GetForwardingRule 
    {
        public static Task<GetForwardingRuleResult> InvokeAsync(GetForwardingRuleArgs args, InvokeOptions? opts = null)
        public static Output<GetForwardingRuleResult> Invoke(GetForwardingRuleInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetForwardingRuleResult> getForwardingRule(GetForwardingRuleArgs args, InvokeOptions options)
    public static Output<GetForwardingRuleResult> getForwardingRule(GetForwardingRuleArgs args, InvokeOptions options)
    
    fn::invoke:
      function: ionoscloud:nlb/getForwardingRule:getForwardingRule
      arguments:
        # arguments dictionary

    The following arguments are supported:

    DatacenterId string
    Datacenter's UUID.
    NetworkloadbalancerId string
    Network Load Balancer's UUID.
    Id string

    ID of the network load balancer forwarding rule you want to search for.

    Both datacenter_id and networkloadbalancer_id and either name or id must be provided. If none, or both of name and id are provided, the datasource will return an error.

    Name string
    Name of an existing network load balancer forwarding rule that you want to search for.
    DatacenterId string
    Datacenter's UUID.
    NetworkloadbalancerId string
    Network Load Balancer's UUID.
    Id string

    ID of the network load balancer forwarding rule you want to search for.

    Both datacenter_id and networkloadbalancer_id and either name or id must be provided. If none, or both of name and id are provided, the datasource will return an error.

    Name string
    Name of an existing network load balancer forwarding rule that you want to search for.
    datacenterId String
    Datacenter's UUID.
    networkloadbalancerId String
    Network Load Balancer's UUID.
    id String

    ID of the network load balancer forwarding rule you want to search for.

    Both datacenter_id and networkloadbalancer_id and either name or id must be provided. If none, or both of name and id are provided, the datasource will return an error.

    name String
    Name of an existing network load balancer forwarding rule that you want to search for.
    datacenterId string
    Datacenter's UUID.
    networkloadbalancerId string
    Network Load Balancer's UUID.
    id string

    ID of the network load balancer forwarding rule you want to search for.

    Both datacenter_id and networkloadbalancer_id and either name or id must be provided. If none, or both of name and id are provided, the datasource will return an error.

    name string
    Name of an existing network load balancer forwarding rule that you want to search for.
    datacenter_id str
    Datacenter's UUID.
    networkloadbalancer_id str
    Network Load Balancer's UUID.
    id str

    ID of the network load balancer forwarding rule you want to search for.

    Both datacenter_id and networkloadbalancer_id and either name or id must be provided. If none, or both of name and id are provided, the datasource will return an error.

    name str
    Name of an existing network load balancer forwarding rule that you want to search for.
    datacenterId String
    Datacenter's UUID.
    networkloadbalancerId String
    Network Load Balancer's UUID.
    id String

    ID of the network load balancer forwarding rule you want to search for.

    Both datacenter_id and networkloadbalancer_id and either name or id must be provided. If none, or both of name and id are provided, the datasource will return an error.

    name String
    Name of an existing network load balancer forwarding rule that you want to search for.

    getForwardingRule Result

    The following output properties are available:

    Algorithm string
    Algorithm for the balancing.
    DatacenterId string
    HealthChecks List<Ionoscloud.GetForwardingRuleHealthCheck>
    Health check attributes for Network Load Balancer forwarding rule target.
    Id string
    The id of that Network Load Balancer forwarding rule.
    ListenerIp string
    Listening IP. (inbound)
    ListenerPort int
    Listening port number. (inbound) (range: 1 to 65535)
    Name string
    The name of that Network Load Balancer forwarding rule.
    NetworkloadbalancerId string
    Protocol string
    Protocol of the balancing.
    Targets List<Ionoscloud.GetForwardingRuleTarget>
    Array of items in that collection.
    Algorithm string
    Algorithm for the balancing.
    DatacenterId string
    HealthChecks []GetForwardingRuleHealthCheck
    Health check attributes for Network Load Balancer forwarding rule target.
    Id string
    The id of that Network Load Balancer forwarding rule.
    ListenerIp string
    Listening IP. (inbound)
    ListenerPort int
    Listening port number. (inbound) (range: 1 to 65535)
    Name string
    The name of that Network Load Balancer forwarding rule.
    NetworkloadbalancerId string
    Protocol string
    Protocol of the balancing.
    Targets []GetForwardingRuleTarget
    Array of items in that collection.
    algorithm String
    Algorithm for the balancing.
    datacenterId String
    healthChecks List<GetForwardingRuleHealthCheck>
    Health check attributes for Network Load Balancer forwarding rule target.
    id String
    The id of that Network Load Balancer forwarding rule.
    listenerIp String
    Listening IP. (inbound)
    listenerPort Integer
    Listening port number. (inbound) (range: 1 to 65535)
    name String
    The name of that Network Load Balancer forwarding rule.
    networkloadbalancerId String
    protocol String
    Protocol of the balancing.
    targets List<GetForwardingRuleTarget>
    Array of items in that collection.
    algorithm string
    Algorithm for the balancing.
    datacenterId string
    healthChecks GetForwardingRuleHealthCheck[]
    Health check attributes for Network Load Balancer forwarding rule target.
    id string
    The id of that Network Load Balancer forwarding rule.
    listenerIp string
    Listening IP. (inbound)
    listenerPort number
    Listening port number. (inbound) (range: 1 to 65535)
    name string
    The name of that Network Load Balancer forwarding rule.
    networkloadbalancerId string
    protocol string
    Protocol of the balancing.
    targets GetForwardingRuleTarget[]
    Array of items in that collection.
    algorithm str
    Algorithm for the balancing.
    datacenter_id str
    health_checks Sequence[GetForwardingRuleHealthCheck]
    Health check attributes for Network Load Balancer forwarding rule target.
    id str
    The id of that Network Load Balancer forwarding rule.
    listener_ip str
    Listening IP. (inbound)
    listener_port int
    Listening port number. (inbound) (range: 1 to 65535)
    name str
    The name of that Network Load Balancer forwarding rule.
    networkloadbalancer_id str
    protocol str
    Protocol of the balancing.
    targets Sequence[GetForwardingRuleTarget]
    Array of items in that collection.
    algorithm String
    Algorithm for the balancing.
    datacenterId String
    healthChecks List<Property Map>
    Health check attributes for Network Load Balancer forwarding rule target.
    id String
    The id of that Network Load Balancer forwarding rule.
    listenerIp String
    Listening IP. (inbound)
    listenerPort Number
    Listening port number. (inbound) (range: 1 to 65535)
    name String
    The name of that Network Load Balancer forwarding rule.
    networkloadbalancerId String
    protocol String
    Protocol of the balancing.
    targets List<Property Map>
    Array of items in that collection.

    Supporting Types

    GetForwardingRuleHealthCheck

    ClientTimeout int
    ClientTimeout is expressed in milliseconds. This inactivity timeout applies when the client is expected to acknowledge or send data. If unset the default of 50 seconds will be used.
    ConnectTimeout int
    It specifies the maximum time (in milliseconds) to wait for a connection attempt to a target VM to succeed. If unset, the default of 5 seconds will be used.
    Retries int
    Retries specifies the number of retries to perform on a target VM after a connection failure. If unset, the default value of 3 will be used.
    TargetTimeout int
    TargetTimeout specifies the maximum inactivity time (in milliseconds) on the target VM side. If unset, the default of 50 seconds will be used.
    ClientTimeout int
    ClientTimeout is expressed in milliseconds. This inactivity timeout applies when the client is expected to acknowledge or send data. If unset the default of 50 seconds will be used.
    ConnectTimeout int
    It specifies the maximum time (in milliseconds) to wait for a connection attempt to a target VM to succeed. If unset, the default of 5 seconds will be used.
    Retries int
    Retries specifies the number of retries to perform on a target VM after a connection failure. If unset, the default value of 3 will be used.
    TargetTimeout int
    TargetTimeout specifies the maximum inactivity time (in milliseconds) on the target VM side. If unset, the default of 50 seconds will be used.
    clientTimeout Integer
    ClientTimeout is expressed in milliseconds. This inactivity timeout applies when the client is expected to acknowledge or send data. If unset the default of 50 seconds will be used.
    connectTimeout Integer
    It specifies the maximum time (in milliseconds) to wait for a connection attempt to a target VM to succeed. If unset, the default of 5 seconds will be used.
    retries Integer
    Retries specifies the number of retries to perform on a target VM after a connection failure. If unset, the default value of 3 will be used.
    targetTimeout Integer
    TargetTimeout specifies the maximum inactivity time (in milliseconds) on the target VM side. If unset, the default of 50 seconds will be used.
    clientTimeout number
    ClientTimeout is expressed in milliseconds. This inactivity timeout applies when the client is expected to acknowledge or send data. If unset the default of 50 seconds will be used.
    connectTimeout number
    It specifies the maximum time (in milliseconds) to wait for a connection attempt to a target VM to succeed. If unset, the default of 5 seconds will be used.
    retries number
    Retries specifies the number of retries to perform on a target VM after a connection failure. If unset, the default value of 3 will be used.
    targetTimeout number
    TargetTimeout specifies the maximum inactivity time (in milliseconds) on the target VM side. If unset, the default of 50 seconds will be used.
    client_timeout int
    ClientTimeout is expressed in milliseconds. This inactivity timeout applies when the client is expected to acknowledge or send data. If unset the default of 50 seconds will be used.
    connect_timeout int
    It specifies the maximum time (in milliseconds) to wait for a connection attempt to a target VM to succeed. If unset, the default of 5 seconds will be used.
    retries int
    Retries specifies the number of retries to perform on a target VM after a connection failure. If unset, the default value of 3 will be used.
    target_timeout int
    TargetTimeout specifies the maximum inactivity time (in milliseconds) on the target VM side. If unset, the default of 50 seconds will be used.
    clientTimeout Number
    ClientTimeout is expressed in milliseconds. This inactivity timeout applies when the client is expected to acknowledge or send data. If unset the default of 50 seconds will be used.
    connectTimeout Number
    It specifies the maximum time (in milliseconds) to wait for a connection attempt to a target VM to succeed. If unset, the default of 5 seconds will be used.
    retries Number
    Retries specifies the number of retries to perform on a target VM after a connection failure. If unset, the default value of 3 will be used.
    targetTimeout Number
    TargetTimeout specifies the maximum inactivity time (in milliseconds) on the target VM side. If unset, the default of 50 seconds will be used.

    GetForwardingRuleTarget

    HealthChecks List<Ionoscloud.GetForwardingRuleTargetHealthCheck>
    Health check attributes for Network Load Balancer forwarding rule target.
    Ip string
    IP of a balanced target VM.
    Port int
    Port of the balanced target service. (range: 1 to 65535).
    ProxyProtocol string
    The proxy protocol version.
    Weight int
    Weight parameter is used to adjust the target VM's weight relative to other target VMs.
    HealthChecks []GetForwardingRuleTargetHealthCheck
    Health check attributes for Network Load Balancer forwarding rule target.
    Ip string
    IP of a balanced target VM.
    Port int
    Port of the balanced target service. (range: 1 to 65535).
    ProxyProtocol string
    The proxy protocol version.
    Weight int
    Weight parameter is used to adjust the target VM's weight relative to other target VMs.
    healthChecks List<GetForwardingRuleTargetHealthCheck>
    Health check attributes for Network Load Balancer forwarding rule target.
    ip String
    IP of a balanced target VM.
    port Integer
    Port of the balanced target service. (range: 1 to 65535).
    proxyProtocol String
    The proxy protocol version.
    weight Integer
    Weight parameter is used to adjust the target VM's weight relative to other target VMs.
    healthChecks GetForwardingRuleTargetHealthCheck[]
    Health check attributes for Network Load Balancer forwarding rule target.
    ip string
    IP of a balanced target VM.
    port number
    Port of the balanced target service. (range: 1 to 65535).
    proxyProtocol string
    The proxy protocol version.
    weight number
    Weight parameter is used to adjust the target VM's weight relative to other target VMs.
    health_checks Sequence[GetForwardingRuleTargetHealthCheck]
    Health check attributes for Network Load Balancer forwarding rule target.
    ip str
    IP of a balanced target VM.
    port int
    Port of the balanced target service. (range: 1 to 65535).
    proxy_protocol str
    The proxy protocol version.
    weight int
    Weight parameter is used to adjust the target VM's weight relative to other target VMs.
    healthChecks List<Property Map>
    Health check attributes for Network Load Balancer forwarding rule target.
    ip String
    IP of a balanced target VM.
    port Number
    Port of the balanced target service. (range: 1 to 65535).
    proxyProtocol String
    The proxy protocol version.
    weight Number
    Weight parameter is used to adjust the target VM's weight relative to other target VMs.

    GetForwardingRuleTargetHealthCheck

    Check bool
    Check specifies whether the target VM's health is checked.
    CheckInterval int
    CheckInterval determines the duration (in milliseconds) between consecutive health checks. If unspecified a default of 2000 ms is used.
    Maintenance bool
    Maintenance specifies if a target VM should be marked as down, even if it is not.
    Check bool
    Check specifies whether the target VM's health is checked.
    CheckInterval int
    CheckInterval determines the duration (in milliseconds) between consecutive health checks. If unspecified a default of 2000 ms is used.
    Maintenance bool
    Maintenance specifies if a target VM should be marked as down, even if it is not.
    check Boolean
    Check specifies whether the target VM's health is checked.
    checkInterval Integer
    CheckInterval determines the duration (in milliseconds) between consecutive health checks. If unspecified a default of 2000 ms is used.
    maintenance Boolean
    Maintenance specifies if a target VM should be marked as down, even if it is not.
    check boolean
    Check specifies whether the target VM's health is checked.
    checkInterval number
    CheckInterval determines the duration (in milliseconds) between consecutive health checks. If unspecified a default of 2000 ms is used.
    maintenance boolean
    Maintenance specifies if a target VM should be marked as down, even if it is not.
    check bool
    Check specifies whether the target VM's health is checked.
    check_interval int
    CheckInterval determines the duration (in milliseconds) between consecutive health checks. If unspecified a default of 2000 ms is used.
    maintenance bool
    Maintenance specifies if a target VM should be marked as down, even if it is not.
    check Boolean
    Check specifies whether the target VM's health is checked.
    checkInterval Number
    CheckInterval determines the duration (in milliseconds) between consecutive health checks. If unspecified a default of 2000 ms is used.
    maintenance Boolean
    Maintenance specifies if a target VM should be marked as down, even if it is not.

    Package Details

    Repository
    ionoscloud ionos-cloud/pulumi-ionoscloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the ionoscloud Terraform Provider.
    ionoscloud logo
    IonosCloud v0.2.2 published on Monday, May 12, 2025 by ionos-cloud