@pulumi/digitalocean
Version:
A Pulumi package for creating and managing DigitalOcean cloud resources.
157 lines (156 loc) • 4.33 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
/**
* 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
* the 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
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as digitalocean from "@pulumi/digitalocean";
*
* const example = digitalocean.getVpc({
* name: "example-network",
* });
* ```
*
* Reuse the data about a VPC to assign a Droplet to it:
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as digitalocean from "@pulumi/digitalocean";
*
* const example = digitalocean.getVpc({
* name: "example-network",
* });
* const exampleDroplet = new digitalocean.Droplet("example", {
* name: "example-01",
* size: digitalocean.DropletSlug.DropletS1VCPU1GB,
* image: "ubuntu-18-04-x64",
* region: digitalocean.Region.NYC3,
* vpcUuid: example.then(example => example.id),
* });
* ```
*/
export declare function getVpc(args?: GetVpcArgs, opts?: pulumi.InvokeOptions): Promise<GetVpcResult>;
/**
* A collection of arguments for invoking getVpc.
*/
export interface GetVpcArgs {
/**
* The unique identifier of an existing VPC.
*/
id?: string;
/**
* The name of an existing VPC.
*/
name?: string;
/**
* The DigitalOcean region slug for the VPC's location.
*/
region?: string;
}
/**
* A collection of values returned by getVpc.
*/
export interface GetVpcResult {
/**
* The date and time of when the VPC was created.
*/
readonly createdAt: string;
/**
* A boolean indicating whether or not the VPC is the default one for the region.
*/
readonly default: boolean;
/**
* A free-form text field describing the VPC.
*/
readonly description: string;
/**
* The unique identifier for the VPC.
*/
readonly id: string;
/**
* The range of IP addresses for the VPC in CIDR notation.
*/
readonly ipRange: string;
/**
* The name of the VPC.
*/
readonly name: string;
/**
* The DigitalOcean region slug for the VPC's location.
*/
readonly region: string;
/**
* The uniform resource name (URN) for the VPC.
*/
readonly urn: string;
}
/**
* 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
* the 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
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as digitalocean from "@pulumi/digitalocean";
*
* const example = digitalocean.getVpc({
* name: "example-network",
* });
* ```
*
* Reuse the data about a VPC to assign a Droplet to it:
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as digitalocean from "@pulumi/digitalocean";
*
* const example = digitalocean.getVpc({
* name: "example-network",
* });
* const exampleDroplet = new digitalocean.Droplet("example", {
* name: "example-01",
* size: digitalocean.DropletSlug.DropletS1VCPU1GB,
* image: "ubuntu-18-04-x64",
* region: digitalocean.Region.NYC3,
* vpcUuid: example.then(example => example.id),
* });
* ```
*/
export declare function getVpcOutput(args?: GetVpcOutputArgs, opts?: pulumi.InvokeOutputOptions): pulumi.Output<GetVpcResult>;
/**
* A collection of arguments for invoking getVpc.
*/
export interface GetVpcOutputArgs {
/**
* The unique identifier of an existing VPC.
*/
id?: pulumi.Input<string>;
/**
* The name of an existing VPC.
*/
name?: pulumi.Input<string>;
/**
* The DigitalOcean region slug for the VPC's location.
*/
region?: pulumi.Input<string>;
}