1. Packages
  2. Exoscale
  3. API Docs
  4. getPrivateNetwork
Exoscale v0.56.0 published on Sunday, Mar 3, 2024 by Pulumiverse

exoscale.getPrivateNetwork

Explore with Pulumi AI

exoscale logo
Exoscale v0.56.0 published on Sunday, Mar 3, 2024 by Pulumiverse

    Fetch Exoscale Private Networks data.

    Corresponding resource: exoscale_private_network.

    Example Usage

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Exoscale = Pulumi.Exoscale;
    
    return await Deployment.RunAsync(() => 
    {
        var myPrivateNetwork = Exoscale.GetPrivateNetwork.Invoke(new()
        {
            Zone = "ch-gva-2",
            Name = "my-private-network",
        });
    
        return new Dictionary<string, object?>
        {
            ["myPrivateNetworkId"] = myPrivateNetwork.Apply(getPrivateNetworkResult => getPrivateNetworkResult.Id),
        };
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumiverse/pulumi-exoscale/sdk/go/exoscale"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		myPrivateNetwork, err := exoscale.LookupPrivateNetwork(ctx, &exoscale.LookupPrivateNetworkArgs{
    			Zone: "ch-gva-2",
    			Name: pulumi.StringRef("my-private-network"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("myPrivateNetworkId", myPrivateNetwork.Id)
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.exoscale.ExoscaleFunctions;
    import com.pulumi.exoscale.inputs.GetPrivateNetworkArgs;
    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 myPrivateNetwork = ExoscaleFunctions.getPrivateNetwork(GetPrivateNetworkArgs.builder()
                .zone("ch-gva-2")
                .name("my-private-network")
                .build());
    
            ctx.export("myPrivateNetworkId", myPrivateNetwork.applyValue(getPrivateNetworkResult -> getPrivateNetworkResult.id()));
        }
    }
    
    import pulumi
    import pulumi_exoscale as exoscale
    
    my_private_network = exoscale.get_private_network(zone="ch-gva-2",
        name="my-private-network")
    pulumi.export("myPrivateNetworkId", my_private_network.id)
    
    import * as pulumi from "@pulumi/pulumi";
    import * as exoscale from "@pulumi/exoscale";
    
    const myPrivateNetwork = exoscale.getPrivateNetwork({
        zone: "ch-gva-2",
        name: "my-private-network",
    });
    export const myPrivateNetworkId = myPrivateNetwork.then(myPrivateNetwork => myPrivateNetwork.id);
    
    variables:
      myPrivateNetwork:
        fn::invoke:
          Function: exoscale:getPrivateNetwork
          Arguments:
            zone: ch-gva-2
            name: my-private-network
    outputs:
      myPrivateNetworkId: ${myPrivateNetwork.id}
    

    Using getPrivateNetwork

    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 getPrivateNetwork(args: GetPrivateNetworkArgs, opts?: InvokeOptions): Promise<GetPrivateNetworkResult>
    function getPrivateNetworkOutput(args: GetPrivateNetworkOutputArgs, opts?: InvokeOptions): Output<GetPrivateNetworkResult>
    def get_private_network(description: Optional[str] = None,
                            id: Optional[str] = None,
                            labels: Optional[Mapping[str, str]] = None,
                            name: Optional[str] = None,
                            zone: Optional[str] = None,
                            opts: Optional[InvokeOptions] = None) -> GetPrivateNetworkResult
    def get_private_network_output(description: Optional[pulumi.Input[str]] = None,
                            id: Optional[pulumi.Input[str]] = None,
                            labels: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
                            name: Optional[pulumi.Input[str]] = None,
                            zone: Optional[pulumi.Input[str]] = None,
                            opts: Optional[InvokeOptions] = None) -> Output[GetPrivateNetworkResult]
    func LookupPrivateNetwork(ctx *Context, args *LookupPrivateNetworkArgs, opts ...InvokeOption) (*LookupPrivateNetworkResult, error)
    func LookupPrivateNetworkOutput(ctx *Context, args *LookupPrivateNetworkOutputArgs, opts ...InvokeOption) LookupPrivateNetworkResultOutput

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

    public static class GetPrivateNetwork 
    {
        public static Task<GetPrivateNetworkResult> InvokeAsync(GetPrivateNetworkArgs args, InvokeOptions? opts = null)
        public static Output<GetPrivateNetworkResult> Invoke(GetPrivateNetworkInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetPrivateNetworkResult> getPrivateNetwork(GetPrivateNetworkArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: exoscale:index/getPrivateNetwork:getPrivateNetwork
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Zone string
    The Exoscale Zone name.
    Description string
    The private network description.
    Id string
    The private network ID to match (conflicts with name).
    Labels Dictionary<string, string>
    A map of key/value labels.
    Name string
    The network name to match (conflicts with id).
    Zone string
    The Exoscale Zone name.
    Description string
    The private network description.
    Id string
    The private network ID to match (conflicts with name).
    Labels map[string]string
    A map of key/value labels.
    Name string
    The network name to match (conflicts with id).
    zone String
    The Exoscale Zone name.
    description String
    The private network description.
    id String
    The private network ID to match (conflicts with name).
    labels Map<String,String>
    A map of key/value labels.
    name String
    The network name to match (conflicts with id).
    zone string
    The Exoscale Zone name.
    description string
    The private network description.
    id string
    The private network ID to match (conflicts with name).
    labels {[key: string]: string}
    A map of key/value labels.
    name string
    The network name to match (conflicts with id).
    zone str
    The Exoscale Zone name.
    description str
    The private network description.
    id str
    The private network ID to match (conflicts with name).
    labels Mapping[str, str]
    A map of key/value labels.
    name str
    The network name to match (conflicts with id).
    zone String
    The Exoscale Zone name.
    description String
    The private network description.
    id String
    The private network ID to match (conflicts with name).
    labels Map<String>
    A map of key/value labels.
    name String
    The network name to match (conflicts with id).

    getPrivateNetwork Result

    The following output properties are available:

    EndIp string
    The first/last IPv4 addresses used by the DHCP service for dynamic leases.
    Netmask string
    The network mask defining the IPv4 network allowed for static leases.
    StartIp string
    The first/last IPv4 addresses used by the DHCP service for dynamic leases.
    Zone string
    The Exoscale Zone name.
    Description string
    The private network description.
    Id string
    The private network ID to match (conflicts with name).
    Labels Dictionary<string, string>
    A map of key/value labels.
    Name string
    The network name to match (conflicts with id).
    EndIp string
    The first/last IPv4 addresses used by the DHCP service for dynamic leases.
    Netmask string
    The network mask defining the IPv4 network allowed for static leases.
    StartIp string
    The first/last IPv4 addresses used by the DHCP service for dynamic leases.
    Zone string
    The Exoscale Zone name.
    Description string
    The private network description.
    Id string
    The private network ID to match (conflicts with name).
    Labels map[string]string
    A map of key/value labels.
    Name string
    The network name to match (conflicts with id).
    endIp String
    The first/last IPv4 addresses used by the DHCP service for dynamic leases.
    netmask String
    The network mask defining the IPv4 network allowed for static leases.
    startIp String
    The first/last IPv4 addresses used by the DHCP service for dynamic leases.
    zone String
    The Exoscale Zone name.
    description String
    The private network description.
    id String
    The private network ID to match (conflicts with name).
    labels Map<String,String>
    A map of key/value labels.
    name String
    The network name to match (conflicts with id).
    endIp string
    The first/last IPv4 addresses used by the DHCP service for dynamic leases.
    netmask string
    The network mask defining the IPv4 network allowed for static leases.
    startIp string
    The first/last IPv4 addresses used by the DHCP service for dynamic leases.
    zone string
    The Exoscale Zone name.
    description string
    The private network description.
    id string
    The private network ID to match (conflicts with name).
    labels {[key: string]: string}
    A map of key/value labels.
    name string
    The network name to match (conflicts with id).
    end_ip str
    The first/last IPv4 addresses used by the DHCP service for dynamic leases.
    netmask str
    The network mask defining the IPv4 network allowed for static leases.
    start_ip str
    The first/last IPv4 addresses used by the DHCP service for dynamic leases.
    zone str
    The Exoscale Zone name.
    description str
    The private network description.
    id str
    The private network ID to match (conflicts with name).
    labels Mapping[str, str]
    A map of key/value labels.
    name str
    The network name to match (conflicts with id).
    endIp String
    The first/last IPv4 addresses used by the DHCP service for dynamic leases.
    netmask String
    The network mask defining the IPv4 network allowed for static leases.
    startIp String
    The first/last IPv4 addresses used by the DHCP service for dynamic leases.
    zone String
    The Exoscale Zone name.
    description String
    The private network description.
    id String
    The private network ID to match (conflicts with name).
    labels Map<String>
    A map of key/value labels.
    name String
    The network name to match (conflicts with id).

    Package Details

    Repository
    exoscale pulumiverse/pulumi-exoscale
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the exoscale Terraform Provider.
    exoscale logo
    Exoscale v0.56.0 published on Sunday, Mar 3, 2024 by Pulumiverse