UNPKG

@pulumi/digitalocean

Version:

A Pulumi package for creating and managing DigitalOcean cloud resources.

110 lines 3.52 kB
"use strict"; // *** WARNING: this file was generated by pulumi-language-nodejs. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.getVpcOutput = exports.getVpc = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * 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), * }); * ``` */ function getVpc(args, opts) { args = args || {}; opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {}); return pulumi.runtime.invoke("digitalocean:index/getVpc:getVpc", { "id": args.id, "name": args.name, "region": args.region, }, opts); } exports.getVpc = 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 * 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), * }); * ``` */ function getVpcOutput(args, opts) { args = args || {}; opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {}); return pulumi.runtime.invokeOutput("digitalocean:index/getVpc:getVpc", { "id": args.id, "name": args.name, "region": args.region, }, opts); } exports.getVpcOutput = getVpcOutput; //# sourceMappingURL=getVpc.js.map