GetVpc

Retrieve information about a VPC for use in other resources.

This data source provides all of the VPC’s properties as configured on your DigitalOcean account. This is useful if the VPC in question is not managed by this provider or you need to utilize any of the VPC’s data.

VPCs may be looked up by id or name. Specifying a region will return that that region’s default VPC.

Example Usage

VPC By Name

using Pulumi;
using DigitalOcean = Pulumi.DigitalOcean;

class MyStack : Stack
{
    public MyStack()
    {
        var example = Output.Create(DigitalOcean.GetVpc.InvokeAsync(new DigitalOcean.GetVpcArgs
        {
            Name = "example-network",
        }));
    }

}

Coming soon!

import pulumi
import pulumi_digitalocean as digitalocean

example = digitalocean.get_vpc(name="example-network")
import * as pulumi from "@pulumi/pulumi";
import * as digitalocean from "@pulumi/digitalocean";

const example = pulumi.output(digitalocean.getVpc({
    name: "example-network",
}, { async: true }));

Using GetVpc

function getVpc(args: GetVpcArgs, opts?: InvokeOptions): Promise<GetVpcResult>
function  get_vpc(id=None, name=None, region=None, opts=None)
func LookupVpc(ctx *Context, args *LookupVpcArgs, opts ...InvokeOption) (*LookupVpcResult, error)

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

public static class GetVpc {
    public static Task<GetVpcResult> InvokeAsync(GetVpcArgs args, InvokeOptions? opts = null)
}

The following arguments are supported:

Id string

The unique identifier of an existing VPC.

Name string

The name of an existing VPC.

Region string

The DigitalOcean region slug for the VPC’s location.

Id string

The unique identifier of an existing VPC.

Name string

The name of an existing VPC.

Region string

The DigitalOcean region slug for the VPC’s location.

id string

The unique identifier of an existing VPC.

name string

The name of an existing VPC.

region string

The DigitalOcean region slug for the VPC’s location.

id str

The unique identifier of an existing VPC.

name str

The name of an existing VPC.

region str

The DigitalOcean region slug for the VPC’s location.

GetVpc Result

The following output properties are available:

CreatedAt string

The date and time of when the VPC was created.

Default bool

A boolean indicating whether or not the VPC is the default one for the region.

Description string

A free-form text field describing the VPC.

Id string

The unique identifier for the VPC.

IpRange string

The range of IP addresses for the VPC in CIDR notation.

Name string

The name of the VPC.

Region string

The DigitalOcean region slug for the VPC’s location.

Urn string

The uniform resource name (URN) for the VPC.

CreatedAt string

The date and time of when the VPC was created.

Default bool

A boolean indicating whether or not the VPC is the default one for the region.

Description string

A free-form text field describing the VPC.

Id string

The unique identifier for the VPC.

IpRange string

The range of IP addresses for the VPC in CIDR notation.

Name string

The name of the VPC.

Region string

The DigitalOcean region slug for the VPC’s location.

Urn string

The uniform resource name (URN) for the VPC.

createdAt string

The date and time of when the VPC was created.

default boolean

A boolean indicating whether or not the VPC is the default one for the region.

description string

A free-form text field describing the VPC.

id string

The unique identifier for the VPC.

ipRange string

The range of IP addresses for the VPC in CIDR notation.

name string

The name of the VPC.

region string

The DigitalOcean region slug for the VPC’s location.

urn string

The uniform resource name (URN) for the VPC.

created_at str

The date and time of when the VPC was created.

default bool

A boolean indicating whether or not the VPC is the default one for the region.

description str

A free-form text field describing the VPC.

id str

The unique identifier for the VPC.

ip_range str

The range of IP addresses for the VPC in CIDR notation.

name str

The name of the VPC.

region str

The DigitalOcean region slug for the VPC’s location.

urn str

The uniform resource name (URN) for the VPC.

Package Details

Repository
https://github.com/pulumi/pulumi-digitalocean
License
Apache-2.0
Notes
This Pulumi package is based on the digitalocean Terraform Provider.