Namespace Pulumi.DigitalOcean
Classes
Cdn
Provides a DigitalOcean CDN Endpoint resource for use with Spaces.
Example Usage
Basic Example
using Pulumi;
using DigitalOcean = Pulumi.DigitalOcean;
class MyStack : Stack
{
public MyStack()
{
// Create a new Spaces Bucket
var mybucket = new DigitalOcean.SpacesBucket("mybucket", new DigitalOcean.SpacesBucketArgs
{
Region = "sfo2",
Acl = "public-read",
});
// Add a CDN endpoint to the Spaces Bucket
var mycdn = new DigitalOcean.Cdn("mycdn", new DigitalOcean.CdnArgs
{
Origin = mybucket.BucketDomainName,
});
this.Fqdn = mycdn.Endpoint;
}
[Output("fqdn")]
public Output<string> Fqdn { get; set; }
}
Custom Sub-Domain Example
using Pulumi;
using DigitalOcean = Pulumi.DigitalOcean;
class MyStack : Stack
{
public MyStack()
{
// Create a new Spaces Bucket
var mybucket = new DigitalOcean.SpacesBucket("mybucket", new DigitalOcean.SpacesBucketArgs
{
Region = "sfo2",
Acl = "public-read",
});
// Create a DigitalOcean managed Let's Encrypt Certificate
var cert = new DigitalOcean.Certificate("cert", new DigitalOcean.CertificateArgs
{
Type = "lets_encrypt",
Domains =
{
"static.example.com",
},
});
// Add a CDN endpoint with a custom sub-domain to the Spaces Bucket
var mycdn = new DigitalOcean.Cdn("mycdn", new DigitalOcean.CdnArgs
{
Origin = mybucket.BucketDomainName,
CustomDomain = "static.example.com",
CertificateId = cert.Id,
});
}
}
CdnArgs
CdnState
Certificate
CertificateArgs
CertificateState
Config
DatabaseCluster
Provides a DigitalOcean database cluster resource.
Example Usage
Create a new PostgreSQL database cluster
using Pulumi;
using DigitalOcean = Pulumi.DigitalOcean;
class MyStack : Stack
{
public MyStack()
{
var postgres_example = new DigitalOcean.DatabaseCluster("postgres-example", new DigitalOcean.DatabaseClusterArgs
{
Engine = "pg",
NodeCount = 1,
Region = "nyc1",
Size = "db-s-1vcpu-1gb",
Version = "11",
});
}
}
Create a new MySQL database cluster
using Pulumi;
using DigitalOcean = Pulumi.DigitalOcean;
class MyStack : Stack
{
public MyStack()
{
var mysql_example = new DigitalOcean.DatabaseCluster("mysql-example", new DigitalOcean.DatabaseClusterArgs
{
Engine = "mysql",
NodeCount = 1,
Region = "nyc1",
Size = "db-s-1vcpu-1gb",
Version = "8",
});
}
}
Create a new Redis database cluster
using Pulumi;
using DigitalOcean = Pulumi.DigitalOcean;
class MyStack : Stack
{
public MyStack()
{
var redis_example = new DigitalOcean.DatabaseCluster("redis-example", new DigitalOcean.DatabaseClusterArgs
{
Engine = "redis",
NodeCount = 1,
Region = "nyc1",
Size = "db-s-1vcpu-1gb",
Version = "5",
});
}
}
DatabaseClusterArgs
DatabaseClusterState
DatabaseConnectionPool
Provides a DigitalOcean database connection pool resource.
Example Usage
Create a new PostgreSQL database connection pool
using Pulumi;
using DigitalOcean = Pulumi.DigitalOcean;
class MyStack : Stack
{
public MyStack()
{
var postgres_example = new DigitalOcean.DatabaseCluster("postgres-example", new DigitalOcean.DatabaseClusterArgs
{
Engine = "pg",
Version = "11",
Size = "db-s-1vcpu-1gb",
Region = "nyc1",
NodeCount = 1,
});
var pool_01 = new DigitalOcean.DatabaseConnectionPool("pool-01", new DigitalOcean.DatabaseConnectionPoolArgs
{
ClusterId = postgres_example.Id,
Mode = "transaction",
Size = 20,
DbName = "defaultdb",
User = "doadmin",
});
}
}
DatabaseConnectionPoolArgs
DatabaseConnectionPoolState
DatabaseDb
Provides a DigitalOcean database resource. When creating a new database cluster, a default database with name defaultdb will be created. Then, this resource can be used to provide additional database inside the cluster.
Example Usage
Create a new PostgreSQL database
using Pulumi;
using DigitalOcean = Pulumi.DigitalOcean;
class MyStack : Stack
{
public MyStack()
{
var postgres_example = new DigitalOcean.DatabaseCluster("postgres-example", new DigitalOcean.DatabaseClusterArgs
{
Engine = "pg",
Version = "11",
Size = "db-s-1vcpu-1gb",
Region = "nyc1",
NodeCount = 1,
});
var database_example = new DigitalOcean.DatabaseDb("database-example", new DigitalOcean.DatabaseDbArgs
{
ClusterId = postgres_example.Id,
});
}
}
DatabaseDbArgs
DatabaseDbState
DatabaseFirewall
Provides a DigitalOcean database firewall resource allowing you to restrict connections to your database to trusted sources. You may limit connections to specific Droplets, Kubernetes clusters, or IP addresses.
DatabaseFirewallArgs
DatabaseFirewallState
DatabaseReplica
Provides a DigitalOcean database replica resource.
Example Usage
Create a new PostgreSQL database replica
using Pulumi;
using DigitalOcean = Pulumi.DigitalOcean;
class MyStack : Stack
{
public MyStack()
{
var postgres_example = new DigitalOcean.DatabaseCluster("postgres-example", new DigitalOcean.DatabaseClusterArgs
{
Engine = "pg",
Version = "11",
Size = "db-s-1vcpu-1gb",
Region = "nyc1",
NodeCount = 1,
});
var read_replica = new DigitalOcean.DatabaseReplica("read-replica", new DigitalOcean.DatabaseReplicaArgs
{
ClusterId = postgres_example.Id,
Size = "db-s-1vcpu-1gb",
Region = "nyc1",
});
}
}
DatabaseReplicaArgs
DatabaseReplicaState
DatabaseUser
Provides a DigitalOcean database user resource. When creating a new database cluster, a default admin user with name doadmin will be created. Then, this resource can be used to provide additional normal users inside the cluster.
NOTE: Any new users created will always have
normalrole, only the default user that comes with database cluster creation hasprimaryrole. Additional permissions must be managed manually.
Example Usage
Create a new PostgreSQL database user
using Pulumi;
using DigitalOcean = Pulumi.DigitalOcean;
class MyStack : Stack
{
public MyStack()
{
var postgres_example = new DigitalOcean.DatabaseCluster("postgres-example", new DigitalOcean.DatabaseClusterArgs
{
Engine = "pg",
Version = "11",
Size = "db-s-1vcpu-1gb",
Region = "nyc1",
NodeCount = 1,
});
var user_example = new DigitalOcean.DatabaseUser("user-example", new DigitalOcean.DatabaseUserArgs
{
ClusterId = postgres_example.Id,
});
}
}
DatabaseUserArgs
DatabaseUserState
DnsRecord
Provides a DigitalOcean DNS record resource.
Example Usage
using Pulumi;
using DigitalOcean = Pulumi.DigitalOcean;
class MyStack : Stack
{
public MyStack()
{
var @default = new DigitalOcean.Domain("default", new DigitalOcean.DomainArgs
{
Name = "example.com",
});
// Add an A record to the domain for www.example.com.
var www = new DigitalOcean.DnsRecord("www", new DigitalOcean.DnsRecordArgs
{
Domain = @default.Name,
Type = "A",
Value = "192.168.0.11",
});
// Add a MX record for the example.com domain itself.
var mx = new DigitalOcean.DnsRecord("mx", new DigitalOcean.DnsRecordArgs
{
Domain = @default.Name,
Type = "MX",
Priority = 10,
Value = "mail.example.com.",
});
this.WwwFqdn = www.Fqdn;
this.MxFqdn = mx.Fqdn;
}
[Output("wwwFqdn")]
public Output<string> WwwFqdn { get; set; }
[Output("mxFqdn")]
public Output<string> MxFqdn { get; set; }
}
DnsRecordArgs
DnsRecordState
Domain
Provides a DigitalOcean domain resource.
Example Usage
using Pulumi;
using DigitalOcean = Pulumi.DigitalOcean;
class MyStack : Stack
{
public MyStack()
{
// Create a new domain
var @default = new DigitalOcean.Domain("default", new DigitalOcean.DomainArgs
{
Name = "example.com",
IpAddress = digitalocean_droplet.Foo.Ipv4_address,
});
}
}
DomainArgs
DomainState
Droplet
Provides a DigitalOcean Droplet resource. This can be used to create, modify, and delete Droplets. Droplets also support provisioning.
Example Usage
using Pulumi;
using DigitalOcean = Pulumi.DigitalOcean;
class MyStack : Stack
{
public MyStack()
{
// Create a new Web Droplet in the nyc2 region
var web = new DigitalOcean.Droplet("web", new DigitalOcean.DropletArgs
{
Image = "ubuntu-18-04-x64",
Region = "nyc2",
Size = "s-1vcpu-1gb",
});
}
}
DropletArgs
DropletSnapshot
Provides a resource which can be used to create a snapshot from an existing DigitalOcean Droplet.
Example Usage
using Pulumi;
using DigitalOcean = Pulumi.DigitalOcean;
class MyStack : Stack
{
public MyStack()
{
var web = new DigitalOcean.Droplet("web", new DigitalOcean.DropletArgs
{
Size = "s-1vcpu-1gb",
Image = "centos-7-x64",
Region = "nyc3",
});
var web_snapshot = new DigitalOcean.DropletSnapshot("web-snapshot", new DigitalOcean.DropletSnapshotArgs
{
DropletId = web.Id,
});
}
}
DropletSnapshotArgs
DropletSnapshotState
DropletState
Firewall
Provides a DigitalOcean Cloud Firewall resource. This can be used to create, modify, and delete Firewalls.
FirewallArgs
FirewallState
FloatingIp
Provides a DigitalOcean Floating IP to represent a publicly-accessible static IP addresses that can be mapped to one of your Droplets.
NOTE: Floating IPs can be assigned to a Droplet either directly on the
digitalocean..FloatingIpresource by setting adroplet_idor using thedigitalocean..FloatingIpAssignmentresource, but the two cannot be used together.
Example Usage
using Pulumi;
using DigitalOcean = Pulumi.DigitalOcean;
class MyStack : Stack
{
public MyStack()
{
var foobarDroplet = new DigitalOcean.Droplet("foobarDroplet", new DigitalOcean.DropletArgs
{
Size = "s-1vcpu-1gb",
Image = "ubuntu-18-04-x64",
Region = "sgp1",
Ipv6 = true,
PrivateNetworking = true,
});
var foobarFloatingIp = new DigitalOcean.FloatingIp("foobarFloatingIp", new DigitalOcean.FloatingIpArgs
{
DropletId = foobarDroplet.Id,
Region = foobarDroplet.Region,
});
}
}
FloatingIpArgs
FloatingIpAssignment
Provides a resource for assigning an existing DigitalOcean Floating IP to a Droplet. This makes it easy to provision floating IP addresses that are not tied to the lifecycle of your Droplet.
Example Usage
using Pulumi;
using DigitalOcean = Pulumi.DigitalOcean;
class MyStack : Stack
{
public MyStack()
{
var foobarFloatingIp = new DigitalOcean.FloatingIp("foobarFloatingIp", new DigitalOcean.FloatingIpArgs
{
Region = "sgp1",
});
var foobarDroplet = new DigitalOcean.Droplet("foobarDroplet", new DigitalOcean.DropletArgs
{
Size = "s-1vcpu-1gb",
Image = "ubuntu-18-04-x64",
Region = "sgp1",
Ipv6 = true,
PrivateNetworking = true,
});
var foobarFloatingIpAssignment = new DigitalOcean.FloatingIpAssignment("foobarFloatingIpAssignment", new DigitalOcean.FloatingIpAssignmentArgs
{
IpAddress = foobarFloatingIp.IpAddress,
DropletId = foobarDroplet.Id,
});
}
}
FloatingIpAssignmentArgs
FloatingIpAssignmentState
FloatingIpState
GetAccount
GetAccountResult
GetCertificate
GetCertificateArgs
GetCertificateResult
GetDatabaseCluster
GetDatabaseClusterArgs
GetDatabaseClusterResult
GetDomain
GetDomainArgs
GetDomainResult
GetDroplet
GetDropletArgs
GetDropletResult
GetDroplets
GetDropletsArgs
GetDropletSnapshot
GetDropletSnapshotArgs
GetDropletSnapshotResult
GetDropletsResult
GetFloatingIp
GetFloatingIpArgs
GetFloatingIpResult
GetImage
GetImageArgs
GetImageResult
GetImages
GetImagesArgs
GetImagesResult
GetKubernetesCluster
GetKubernetesClusterArgs
GetKubernetesClusterResult
GetKubernetesVersions
GetKubernetesVersionsArgs
GetKubernetesVersionsResult
GetLoadBalancer
GetLoadBalancerArgs
GetLoadBalancerResult
GetProject
GetProjectArgs
GetProjectResult
GetProjects
GetProjectsArgs
GetProjectsResult
GetRecord
GetRecordArgs
GetRecordResult
GetRegion
GetRegionArgs
GetRegionResult
GetRegions
GetRegionsArgs
GetRegionsResult
GetSizes
GetSizesArgs
GetSizesResult
GetSpacesBucket
GetSpacesBucketArgs
GetSpacesBucketObject
GetSpacesBucketObjectArgs
GetSpacesBucketObjectResult
GetSpacesBucketObjects
GetSpacesBucketObjectsArgs
GetSpacesBucketObjectsResult
GetSpacesBucketResult
GetSpacesBuckets
GetSpacesBucketsArgs
GetSpacesBucketsResult
GetSshKey
GetSshKeyArgs
GetSshKeyResult
GetTag
GetTagArgs
GetTagResult
GetVolume
GetVolumeArgs
GetVolumeResult
GetVolumeSnapshot
GetVolumeSnapshotArgs
GetVolumeSnapshotResult
GetVpc
GetVpcArgs
GetVpcResult
KubernetesCluster
Provides a DigitalOcean Kubernetes cluster resource. This can be used to create, delete, and modify clusters. For more information see the official documentation.
Example Usage
Basic Example
using Pulumi;
using DigitalOcean = Pulumi.DigitalOcean;
class MyStack : Stack
{
public MyStack()
{
var foo = new DigitalOcean.KubernetesCluster("foo", new DigitalOcean.KubernetesClusterArgs
{
NodePool = new DigitalOcean.Inputs.KubernetesClusterNodePoolArgs
{
Name = "worker-pool",
NodeCount = 3,
Size = "s-2vcpu-2gb",
},
Region = "nyc1",
Version = "1.15.5-do.1",
});
}
}
Autoscaling Example
using Pulumi;
using DigitalOcean = Pulumi.DigitalOcean;
class MyStack : Stack
{
public MyStack()
{
var foo = new DigitalOcean.KubernetesCluster("foo", new DigitalOcean.KubernetesClusterArgs
{
NodePool = new DigitalOcean.Inputs.KubernetesClusterNodePoolArgs
{
AutoScale = true,
MaxNodes = 5,
MinNodes = 1,
Name = "autoscale-worker-pool",
Size = "s-2vcpu-2gb",
},
Region = "nyc1",
Version = "1.15.5-do.1",
});
}
}
KubernetesClusterArgs
KubernetesClusterState
KubernetesNodePool
Provides a DigitalOcean Kubernetes node pool resource. While the default node pool must be defined in the digitalocean..KubernetesCluster resource, this resource can be used to add additional ones to a cluster.
Example Usage
Autoscaling Example
using Pulumi;
using DigitalOcean = Pulumi.DigitalOcean;
class MyStack : Stack
{
public MyStack()
{
var autoscale_pool_01 = new DigitalOcean.KubernetesNodePool("autoscale-pool-01", new DigitalOcean.KubernetesNodePoolArgs
{
ClusterId = digitalocean_kubernetes_cluster.Foo.Id,
Size = "s-1vcpu-2gb",
AutoScale = true,
MinNodes = 0,
MaxNodes = 5,
});
}
}
KubernetesNodePoolArgs
KubernetesNodePoolState
LoadBalancer
Provides a DigitalOcean Load Balancer resource. This can be used to create, modify, and delete Load Balancers.
LoadBalancerArgs
LoadBalancerState
Project
ProjectArgs
ProjectState
Provider
The provider type for the digitalocean package. By default, resources use package-wide configuration
settings, however an explicit Provider instance may be created and passed during resource
construction to achieve fine-grained programmatic control over provider settings. See the
documentation for more information.
ProviderArgs
SpacesBucket
Provides a bucket resource for Spaces, DigitalOcean's object storage product.
The Spaces API was designed to be interoperable with Amazon's AWS S3 API. This allows users to interact with the service while using the tools they already know. Spaces mirrors S3's authentication framework and requests to Spaces require a key pair similar to Amazon's Access ID and Secret Key.
The authentication requirement can be met by either setting the
SPACES_ACCESS_KEY_ID and SPACES_SECRET_ACCESS_KEY environment variables or
the provider's spaces_access_id and spaces_secret_key arguments to the
access ID and secret you generate via the DigitalOcean control panel. For
example:
using Pulumi;
using DigitalOcean = Pulumi.DigitalOcean;
class MyStack : Stack
{
public MyStack()
{
var static_assets = new DigitalOcean.SpacesBucket("static-assets", new DigitalOcean.SpacesBucketArgs
{
});
// ...
}
}
For more information, See An Introduction to DigitalOcean Spaces
Example Usage
Create a New Bucket
using Pulumi;
using DigitalOcean = Pulumi.DigitalOcean;
class MyStack : Stack
{
public MyStack()
{
var foobar = new DigitalOcean.SpacesBucket("foobar", new DigitalOcean.SpacesBucketArgs
{
Region = "nyc3",
});
}
}
Create a New Bucket With CORS Rules
using Pulumi;
using DigitalOcean = Pulumi.DigitalOcean;
class MyStack : Stack
{
public MyStack()
{
var foobar = new DigitalOcean.SpacesBucket("foobar", new DigitalOcean.SpacesBucketArgs
{
CorsRules =
{
new DigitalOcean.Inputs.SpacesBucketCorsRuleArgs
{
AllowedHeaders =
{
"*",
},
AllowedMethods =
{
"GET",
},
AllowedOrigins =
{
"*",
},
MaxAgeSeconds = 3000,
},
new DigitalOcean.Inputs.SpacesBucketCorsRuleArgs
{
AllowedHeaders =
{
"*",
},
AllowedMethods =
{
"PUT",
"POST",
"DELETE",
},
AllowedOrigins =
{
"https://www.example.com",
},
MaxAgeSeconds = 3000,
},
},
Region = "nyc3",
});
}
}
SpacesBucketArgs
SpacesBucketObject
SpacesBucketObjectArgs
SpacesBucketObjectState
SpacesBucketState
SshKey
SshKeyArgs
SshKeyState
Tag
Provides a DigitalOcean Tag resource. A Tag is a label that can be applied to a Droplet resource in order to better organize or facilitate the lookups and actions on it. Tags created with this resource can be referenced in your Droplet configuration via their ID or name.
Example Usage
using Pulumi;
using DigitalOcean = Pulumi.DigitalOcean;
class MyStack : Stack
{
public MyStack()
{
// Create a new tag
var foobar = new DigitalOcean.Tag("foobar", new DigitalOcean.TagArgs
{
});
// Create a new Droplet in nyc3 with the foobar tag
var web = new DigitalOcean.Droplet("web", new DigitalOcean.DropletArgs
{
Image = "ubuntu-18-04-x64",
Region = "nyc3",
Size = "s-1vcpu-1gb",
Tags =
{
foobar.Id,
},
});
}
}
TagArgs
TagState
Volume
Provides a DigitalOcean Block Storage volume which can be attached to a Droplet in order to provide expanded storage.
Example Usage
using Pulumi;
using DigitalOcean = Pulumi.DigitalOcean;
class MyStack : Stack
{
public MyStack()
{
var foobarVolume = new DigitalOcean.Volume("foobarVolume", new DigitalOcean.VolumeArgs
{
Region = "nyc1",
Size = 100,
InitialFilesystemType = "ext4",
Description = "an example volume",
});
var foobarDroplet = new DigitalOcean.Droplet("foobarDroplet", new DigitalOcean.DropletArgs
{
Size = "s-1vcpu-1gb",
Image = "ubuntu-18-04-x64",
Region = "nyc1",
});
var foobarVolumeAttachment = new DigitalOcean.VolumeAttachment("foobarVolumeAttachment", new DigitalOcean.VolumeAttachmentArgs
{
DropletId = foobarDroplet.Id,
VolumeId = foobarVolume.Id,
});
}
}
VolumeArgs
VolumeAttachment
Manages attaching a Volume to a Droplet.
NOTE: Volumes can be attached either directly on the
digitalocean..Dropletresource, or using thedigitalocean..VolumeAttachmentresource - but the two cannot be used together. If both are used against the same Droplet, the volume attachments will constantly drift.
Example Usage
using Pulumi;
using DigitalOcean = Pulumi.DigitalOcean;
class MyStack : Stack
{
public MyStack()
{
var foobarVolume = new DigitalOcean.Volume("foobarVolume", new DigitalOcean.VolumeArgs
{
Region = "nyc1",
Size = 100,
InitialFilesystemType = "ext4",
Description = "an example volume",
});
var foobarDroplet = new DigitalOcean.Droplet("foobarDroplet", new DigitalOcean.DropletArgs
{
Size = "s-1vcpu-1gb",
Image = "ubuntu-18-04-x64",
Region = "nyc1",
});
var foobarVolumeAttachment = new DigitalOcean.VolumeAttachment("foobarVolumeAttachment", new DigitalOcean.VolumeAttachmentArgs
{
DropletId = foobarDroplet.Id,
VolumeId = foobarVolume.Id,
});
}
}
VolumeAttachmentArgs
VolumeAttachmentState
VolumeSnapshot
Provides a DigitalOcean Volume Snapshot which can be used to create a snapshot from an existing volume.
Example Usage
using Pulumi;
using DigitalOcean = Pulumi.DigitalOcean;
class MyStack : Stack
{
public MyStack()
{
var foobarVolume = new DigitalOcean.Volume("foobarVolume", new DigitalOcean.VolumeArgs
{
Region = "nyc1",
Size = 100,
Description = "an example volume",
});
var foobarVolumeSnapshot = new DigitalOcean.VolumeSnapshot("foobarVolumeSnapshot", new DigitalOcean.VolumeSnapshotArgs
{
VolumeId = foobarVolume.Id,
});
}
}
VolumeSnapshotArgs
VolumeSnapshotState
VolumeState
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,
});
}
}