1. Packages
  2. Linode Provider
  3. API Docs
  4. getVpc
Linode v4.30.0 published on Friday, Nov 8, 2024 by Pulumi

linode.getVpc

Explore with Pulumi AI

linode logo
Linode v4.30.0 published on Friday, Nov 8, 2024 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/v4/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.applyValue(getVpcResult -> getVpcResult));
        }
    }
    
    variables:
      foo:
        fn::invoke:
          Function: linode:getVpc
          Arguments:
            id: 123
    outputs:
      vpc: ${foo}
    

    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)
    // Output-based functions aren't available in Java yet
    
    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
    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
    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
    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
    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
    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
    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.

    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 v4.30.0 published on Friday, Nov 8, 2024 by Pulumi