Class Vpc
Provides a DigitalOcean VPC resource.
VPCs are virtual networks containing resources that can communicate with each other in full isolation, using private IP addresses.
Example Usage
using Pulumi;
using DigitalOcean = Pulumi.DigitalOcean;
class MyStack : Stack
{
public MyStack()
{
var example = new DigitalOcean.Vpc("example", new DigitalOcean.VpcArgs
{
IpRange = "10.10.10.0/24",
Region = "nyc3",
});
}
}
Resource Assignment
using Pulumi;
using DigitalOcean = Pulumi.DigitalOcean;
class MyStack : Stack
{
public MyStack()
{
var exampleVpc = new DigitalOcean.Vpc("exampleVpc", new DigitalOcean.VpcArgs
{
Region = "nyc3",
});
var exampleDroplet = new DigitalOcean.Droplet("exampleDroplet", new DigitalOcean.DropletArgs
{
Size = "s-1vcpu-1gb",
Image = "ubuntu-18-04-x64",
Region = "nyc3",
VpcUuid = exampleVpc.Id,
});
}
}
Inherited Members
Namespace: Pulumi.DigitalOcean
Assembly: Pulumi.DigitalOcean.dll
Syntax
public class Vpc : CustomResource
Constructors
View SourceVpc(String, VpcArgs, CustomResourceOptions)
Create a Vpc resource with the given unique name, arguments, and options.
Declaration
public Vpc(string name, VpcArgs args, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resource |
| VpcArgs | args | The arguments used to populate this resource's properties |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Properties
View SourceCreatedAt
The date and time of when the VPC was created.
Declaration
public Output<string> CreatedAt { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Default
A boolean indicating whether or not the VPC is the default one for the region.
Declaration
public Output<bool> Default { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Boolean> |
Description
A free-form text field up to a limit of 255 characters to describe the VPC.
Declaration
public Output<string> Description { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
IpRange
The range of IP addresses for the VPC in CIDR notation. Network ranges cannot overlap with other networks in the same account and must be in range of private addresses as defined in RFC1918. It may not be larger than /16 or smaller than /24.
Declaration
public Output<string> IpRange { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Name
A name for the VPC. Must be unique and contain alphanumeric characters, dashes, and periods only.
Declaration
public Output<string> Name { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Region
The DigitalOcean region slug for the VPC's location.
Declaration
public Output<string> Region { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Urn
The uniform resource name (URN) for the VPC.
Declaration
public Output<string> Urn { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Methods
View SourceGet(String, Input<String>, VpcState, CustomResourceOptions)
Get an existing Vpc resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
Declaration
public static Vpc Get(string name, Input<string> id, VpcState state = null, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resulting resource. |
| Input<System.String> | id | The unique provider ID of the resource to lookup. |
| VpcState | state | Any extra arguments used during the lookup. |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Returns
| Type | Description |
|---|---|
| Vpc |