1. Packages
  2. Ionoscloud Provider
  3. API Docs
  4. getLan
ionoscloud 6.7.6 published on Monday, Apr 14, 2025 by ionos-cloud

ionoscloud.getLan

Explore with Pulumi AI

ionoscloud logo
ionoscloud 6.7.6 published on Monday, Apr 14, 2025 by ionos-cloud

    The LAN data source can be used to search for and return existing lans. 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.getLan({
        datacenterId: "datacenter_id",
        id: "lan_id",
    });
    
    import pulumi
    import pulumi_ionoscloud as ionoscloud
    
    example = ionoscloud.get_lan(datacenter_id="datacenter_id",
        id="lan_id")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/ionoscloud/v6/ionoscloud"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ionoscloud.LookupLan(ctx, &ionoscloud.LookupLanArgs{
    			DatacenterId: "datacenter_id",
    			Id:           pulumi.StringRef("lan_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.GetLan.Invoke(new()
        {
            DatacenterId = "datacenter_id",
            Id = "lan_id",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.ionoscloud.IonoscloudFunctions;
    import com.pulumi.ionoscloud.inputs.GetLanArgs;
    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 = IonoscloudFunctions.getLan(GetLanArgs.builder()
                .datacenterId("datacenter_id")
                .id("lan_id")
                .build());
    
        }
    }
    
    variables:
      example:
        fn::invoke:
          function: ionoscloud:getLan
          arguments:
            datacenterId: datacenter_id
            id: lan_id
    

    By Name

    import * as pulumi from "@pulumi/pulumi";
    import * as ionoscloud from "@pulumi/ionoscloud";
    
    const example = ionoscloud.getLan({
        datacenterId: "datacenter_id",
        name: "Lan Example",
    });
    
    import pulumi
    import pulumi_ionoscloud as ionoscloud
    
    example = ionoscloud.get_lan(datacenter_id="datacenter_id",
        name="Lan Example")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/ionoscloud/v6/ionoscloud"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ionoscloud.LookupLan(ctx, &ionoscloud.LookupLanArgs{
    			DatacenterId: "datacenter_id",
    			Name:         pulumi.StringRef("Lan 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.GetLan.Invoke(new()
        {
            DatacenterId = "datacenter_id",
            Name = "Lan Example",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.ionoscloud.IonoscloudFunctions;
    import com.pulumi.ionoscloud.inputs.GetLanArgs;
    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 = IonoscloudFunctions.getLan(GetLanArgs.builder()
                .datacenterId("datacenter_id")
                .name("Lan Example")
                .build());
    
        }
    }
    
    variables:
      example:
        fn::invoke:
          function: ionoscloud:getLan
          arguments:
            datacenterId: datacenter_id
            name: Lan Example
    

    Using getLan

    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 getLan(args: GetLanArgs, opts?: InvokeOptions): Promise<GetLanResult>
    function getLanOutput(args: GetLanOutputArgs, opts?: InvokeOptions): Output<GetLanResult>
    def get_lan(datacenter_id: Optional[str] = None,
                id: Optional[str] = None,
                name: Optional[str] = None,
                timeouts: Optional[GetLanTimeouts] = None,
                opts: Optional[InvokeOptions] = None) -> GetLanResult
    def get_lan_output(datacenter_id: Optional[pulumi.Input[str]] = None,
                id: Optional[pulumi.Input[str]] = None,
                name: Optional[pulumi.Input[str]] = None,
                timeouts: Optional[pulumi.Input[GetLanTimeoutsArgs]] = None,
                opts: Optional[InvokeOptions] = None) -> Output[GetLanResult]
    func LookupLan(ctx *Context, args *LookupLanArgs, opts ...InvokeOption) (*LookupLanResult, error)
    func LookupLanOutput(ctx *Context, args *LookupLanOutputArgs, opts ...InvokeOption) LookupLanResultOutput

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

    public static class GetLan 
    {
        public static Task<GetLanResult> InvokeAsync(GetLanArgs args, InvokeOptions? opts = null)
        public static Output<GetLanResult> Invoke(GetLanInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetLanResult> getLan(GetLanArgs args, InvokeOptions options)
    public static Output<GetLanResult> getLan(GetLanArgs args, InvokeOptions options)
    
    fn::invoke:
      function: ionoscloud:index/getLan:getLan
      arguments:
        # arguments dictionary

    The following arguments are supported:

    DatacenterId string
    Datacenter's UUID.
    Id string

    ID of the lan you want to search for.

    datacenter_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 lan that you want to search for.
    Timeouts GetLanTimeouts
    DatacenterId string
    Datacenter's UUID.
    Id string

    ID of the lan you want to search for.

    datacenter_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 lan that you want to search for.
    Timeouts GetLanTimeouts
    datacenterId String
    Datacenter's UUID.
    id String

    ID of the lan you want to search for.

    datacenter_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 lan that you want to search for.
    timeouts GetLanTimeouts
    datacenterId string
    Datacenter's UUID.
    id string

    ID of the lan you want to search for.

    datacenter_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 lan that you want to search for.
    timeouts GetLanTimeouts
    datacenter_id str
    Datacenter's UUID.
    id str

    ID of the lan you want to search for.

    datacenter_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 lan that you want to search for.
    timeouts GetLanTimeouts
    datacenterId String
    Datacenter's UUID.
    id String

    ID of the lan you want to search for.

    datacenter_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 lan that you want to search for.
    timeouts Property Map

    getLan Result

    The following output properties are available:

    DatacenterId string
    The ID of lan's Virtual Data Center.
    Id string
    The id of the LAN.
    IpFailovers List<GetLanIpFailover>
    list of
    Ipv4CidrBlock string
    For public LANs this property is null, for private LANs it contains the private IPv4 CIDR range.
    Ipv6CidrBlock string
    Contains the LAN's /64 IPv6 CIDR block if this LAN is IPv6 enabled.
    Name string
    The name of the LAN.
    Pcc string
    The unique id of a ionoscloud.PrivateCrossconnect resource, in order.
    Public bool
    Indicates if the LAN faces the public Internet (true) or not (false).
    Timeouts GetLanTimeouts
    DatacenterId string
    The ID of lan's Virtual Data Center.
    Id string
    The id of the LAN.
    IpFailovers []GetLanIpFailover
    list of
    Ipv4CidrBlock string
    For public LANs this property is null, for private LANs it contains the private IPv4 CIDR range.
    Ipv6CidrBlock string
    Contains the LAN's /64 IPv6 CIDR block if this LAN is IPv6 enabled.
    Name string
    The name of the LAN.
    Pcc string
    The unique id of a ionoscloud.PrivateCrossconnect resource, in order.
    Public bool
    Indicates if the LAN faces the public Internet (true) or not (false).
    Timeouts GetLanTimeouts
    datacenterId String
    The ID of lan's Virtual Data Center.
    id String
    The id of the LAN.
    ipFailovers List<GetLanIpFailover>
    list of
    ipv4CidrBlock String
    For public LANs this property is null, for private LANs it contains the private IPv4 CIDR range.
    ipv6CidrBlock String
    Contains the LAN's /64 IPv6 CIDR block if this LAN is IPv6 enabled.
    name String
    The name of the LAN.
    pcc String
    The unique id of a ionoscloud.PrivateCrossconnect resource, in order.
    public_ Boolean
    Indicates if the LAN faces the public Internet (true) or not (false).
    timeouts GetLanTimeouts
    datacenterId string
    The ID of lan's Virtual Data Center.
    id string
    The id of the LAN.
    ipFailovers GetLanIpFailover[]
    list of
    ipv4CidrBlock string
    For public LANs this property is null, for private LANs it contains the private IPv4 CIDR range.
    ipv6CidrBlock string
    Contains the LAN's /64 IPv6 CIDR block if this LAN is IPv6 enabled.
    name string
    The name of the LAN.
    pcc string
    The unique id of a ionoscloud.PrivateCrossconnect resource, in order.
    public boolean
    Indicates if the LAN faces the public Internet (true) or not (false).
    timeouts GetLanTimeouts
    datacenter_id str
    The ID of lan's Virtual Data Center.
    id str
    The id of the LAN.
    ip_failovers Sequence[GetLanIpFailover]
    list of
    ipv4_cidr_block str
    For public LANs this property is null, for private LANs it contains the private IPv4 CIDR range.
    ipv6_cidr_block str
    Contains the LAN's /64 IPv6 CIDR block if this LAN is IPv6 enabled.
    name str
    The name of the LAN.
    pcc str
    The unique id of a ionoscloud.PrivateCrossconnect resource, in order.
    public bool
    Indicates if the LAN faces the public Internet (true) or not (false).
    timeouts GetLanTimeouts
    datacenterId String
    The ID of lan's Virtual Data Center.
    id String
    The id of the LAN.
    ipFailovers List<Property Map>
    list of
    ipv4CidrBlock String
    For public LANs this property is null, for private LANs it contains the private IPv4 CIDR range.
    ipv6CidrBlock String
    Contains the LAN's /64 IPv6 CIDR block if this LAN is IPv6 enabled.
    name String
    The name of the LAN.
    pcc String
    The unique id of a ionoscloud.PrivateCrossconnect resource, in order.
    public Boolean
    Indicates if the LAN faces the public Internet (true) or not (false).
    timeouts Property Map

    Supporting Types

    GetLanIpFailover

    Ip string
    NicUuid string
    Ip string
    NicUuid string
    ip String
    nicUuid String
    ip string
    nicUuid string
    ip str
    nic_uuid str
    ip String
    nicUuid String

    GetLanTimeouts

    Create string
    Default string
    Delete string
    Update string
    Create string
    Default string
    Delete string
    Update string
    create String
    default_ String
    delete String
    update String
    create string
    default string
    delete string
    update string
    create String
    default String
    delete String
    update String

    Package Details

    Repository
    ionoscloud ionos-cloud/terraform-provider-ionoscloud
    License
    Notes
    This Pulumi package is based on the ionoscloud Terraform Provider.
    ionoscloud logo
    ionoscloud 6.7.6 published on Monday, Apr 14, 2025 by ionos-cloud