1. Packages
  2. Linode Provider
  3. API Docs
  4. getVpc
Linode v5.4.0 published on Friday, Oct 10, 2025 by Pulumi

linode.getVpc

Get Started
linode logo
Linode v5.4.0 published on Friday, Oct 10, 2025 by Pulumi

    Provides information about a Linode VPC. For more information, see the Linode APIv4 docs.

    Example Usage

    The following example shows how one might use this data source to access information about a Linode VPC.

    import * as pulumi from "@pulumi/pulumi";
    import * as linode from "@pulumi/linode";
    
    const foo = linode.getVpc({
        id: "123",
    });
    export const vpc = foo;
    
    import pulumi
    import pulumi_linode as linode
    
    foo = linode.get_vpc(id="123")
    pulumi.export("vpc", foo)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-linode/sdk/v5/go/linode"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		foo, err := linode.LookupVpc(ctx, &linode.LookupVpcArgs{
    			Id: "123",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("vpc", foo)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Linode = Pulumi.Linode;
    
    return await Deployment.RunAsync(() => 
    {
        var foo = Linode.GetVpc.Invoke(new()
        {
            Id = "123",
        });
    
        return new Dictionary<string, object?>
        {
            ["vpc"] = foo,
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.linode.LinodeFunctions;
    import com.pulumi.linode.inputs.GetVpcArgs;
    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 foo = LinodeFunctions.getVpc(GetVpcArgs.builder()
                .id("123")
                .build());
    
            ctx.export("vpc", foo);
        }
    }
    
    variables:
      foo:
        fn::invoke:
          function: linode:getVpc
          arguments:
            id: 123
    outputs:
      vpc: ${foo}
    

    IPv6

    Limited Availability IPv6 VPCs may not currently be available to all users.

    Contains information about a single IPv6 allocation under this VPC.

    • range - The allocated range in CIDR format.

    Subnets Reference

    To list all subnets under a VPC, please refer to the linode.getVpcSubnets data source.

    Using getVpc

    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 getVpc(args: GetVpcArgs, opts?: InvokeOptions): Promise<GetVpcResult>
    function getVpcOutput(args: GetVpcOutputArgs, opts?: InvokeOptions): Output<GetVpcResult>
    def get_vpc(id: Optional[str] = None,
                opts: Optional[InvokeOptions] = None) -> GetVpcResult
    def get_vpc_output(id: Optional[pulumi.Input[str]] = None,
                opts: Optional[InvokeOptions] = None) -> Output[GetVpcResult]
    func LookupVpc(ctx *Context, args *LookupVpcArgs, opts ...InvokeOption) (*LookupVpcResult, error)
    func LookupVpcOutput(ctx *Context, args *LookupVpcOutputArgs, opts ...InvokeOption) LookupVpcResultOutput

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

    public static class GetVpc 
    {
        public static Task<GetVpcResult> InvokeAsync(GetVpcArgs args, InvokeOptions? opts = null)
        public static Output<GetVpcResult> Invoke(GetVpcInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetVpcResult> getVpc(GetVpcArgs args, InvokeOptions options)
    public static Output<GetVpcResult> getVpc(GetVpcArgs args, InvokeOptions options)
    
    fn::invoke:
      function: linode:index/getVpc:getVpc
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Id string
    The unique id of this VPC.
    Id string
    The unique id of this VPC.
    id String
    The unique id of this VPC.
    id string
    The unique id of this VPC.
    id str
    The unique id of this VPC.
    id String
    The unique id of this VPC.

    getVpc Result

    The following output properties are available:

    Created string
    The date and time when the VPC was created.
    Description string
    The user-defined description of this VPC.
    Id string
    Ipv6s List<GetVpcIpv6>
    A list of IPv6 allocations under this VPC.
    Label string
    The label of the VPC.
    Region string
    The region where the VPC is deployed.
    Updated string
    The date and time when the VPC was last updated.
    Created string
    The date and time when the VPC was created.
    Description string
    The user-defined description of this VPC.
    Id string
    Ipv6s []GetVpcIpv6
    A list of IPv6 allocations under this VPC.
    Label string
    The label of the VPC.
    Region string
    The region where the VPC is deployed.
    Updated string
    The date and time when the VPC was last updated.
    created String
    The date and time when the VPC was created.
    description String
    The user-defined description of this VPC.
    id String
    ipv6s List<GetVpcIpv6>
    A list of IPv6 allocations under this VPC.
    label String
    The label of the VPC.
    region String
    The region where the VPC is deployed.
    updated String
    The date and time when the VPC was last updated.
    created string
    The date and time when the VPC was created.
    description string
    The user-defined description of this VPC.
    id string
    ipv6s GetVpcIpv6[]
    A list of IPv6 allocations under this VPC.
    label string
    The label of the VPC.
    region string
    The region where the VPC is deployed.
    updated string
    The date and time when the VPC was last updated.
    created str
    The date and time when the VPC was created.
    description str
    The user-defined description of this VPC.
    id str
    ipv6s Sequence[GetVpcIpv6]
    A list of IPv6 allocations under this VPC.
    label str
    The label of the VPC.
    region str
    The region where the VPC is deployed.
    updated str
    The date and time when the VPC was last updated.
    created String
    The date and time when the VPC was created.
    description String
    The user-defined description of this VPC.
    id String
    ipv6s List<Property Map>
    A list of IPv6 allocations under this VPC.
    label String
    The label of the VPC.
    region String
    The region where the VPC is deployed.
    updated String
    The date and time when the VPC was last updated.

    Supporting Types

    GetVpcIpv6

    Range string
    The IPv6 range assigned to this VPC.
    Range string
    The IPv6 range assigned to this VPC.
    range String
    The IPv6 range assigned to this VPC.
    range string
    The IPv6 range assigned to this VPC.
    range str
    The IPv6 range assigned to this VPC.
    range String
    The IPv6 range assigned to this VPC.

    Package Details

    Repository
    Linode pulumi/pulumi-linode
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the linode Terraform Provider.
    linode logo
    Linode v5.4.0 published on Friday, Oct 10, 2025 by Pulumi
      Meet Neo: Your AI Platform Teammate