@pulumi/digitalocean
Version:
A Pulumi package for creating and managing DigitalOcean cloud resources.
440 lines (439 loc) • 19.2 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
import * as inputs from "./types/input";
import * as outputs from "./types/output";
import * as enums from "./types/enums";
/**
* Provides a DigitalOcean Droplet resource. This can be used to create,
* modify, and delete Droplets.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as digitalocean from "@pulumi/digitalocean";
*
* // Create a new Web Droplet in the nyc2 region
* const web = new digitalocean.Droplet("web", {
* image: "ubuntu-20-04-x64",
* name: "web-1",
* region: digitalocean.Region.NYC2,
* size: digitalocean.DropletSlug.DropletS1VCPU1GB,
* backups: true,
* backupPolicy: {
* plan: "weekly",
* weekday: "TUE",
* hour: 8,
* },
* });
* ```
*
* ## Import
*
* Droplets can be imported using the Droplet `id`, e.g.
*
* ```sh
* $ pulumi import digitalocean:index/droplet:Droplet mydroplet 100823
* ```
*/
export declare class Droplet extends pulumi.CustomResource {
/**
* Get an existing Droplet resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state Any extra arguments used during the lookup.
* @param opts Optional settings to control the behavior of the CustomResource.
*/
static get(name: string, id: pulumi.Input<pulumi.ID>, state?: DropletState, opts?: pulumi.CustomResourceOptions): Droplet;
/**
* Returns true if the given object is an instance of Droplet. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj: any): obj is Droplet;
/**
* An object specifying the backup policy for the Droplet. If omitted and `backups` is `true`, the backup plan will default to daily.
*/
readonly backupPolicy: pulumi.Output<outputs.DropletBackupPolicy | undefined>;
/**
* Boolean controlling if backups are made. Defaults to
* false.
*/
readonly backups: pulumi.Output<boolean | undefined>;
readonly createdAt: pulumi.Output<string>;
/**
* The size of the instance's disk in GB
*/
readonly disk: pulumi.Output<number>;
/**
* A boolean indicating whether to install the
* DigitalOcean agent used for providing access to the Droplet web console in
* the control panel. By default, the agent is installed on new Droplets but
* installation errors (i.e. OS not supported) are ignored. To prevent it from
* being installed, set to `false`. To make installation errors fatal, explicitly
* set it to `true`.
*/
readonly dropletAgent: pulumi.Output<boolean | undefined>;
/**
* The uniform resource name of the Droplet
*/
readonly dropletUrn: pulumi.Output<string>;
/**
* A boolean indicating whether the droplet
* should be gracefully shut down before it is deleted.
*
* > **NOTE:** If you use `volumeIds` on a Droplet, this provider will assume management over the full set volumes for the instance, and treat additional volumes as a drift. For this reason, `volumeIds` must not be mixed with external `digitalocean.VolumeAttachment` resources for a given instance.
*/
readonly gracefulShutdown: pulumi.Output<boolean | undefined>;
/**
* The Droplet image ID or slug. This could be either image ID or droplet snapshot ID. You can find image IDs and slugs using the [DigitalOcean API](https://docs.digitalocean.com/reference/api/digitalocean/#tag/Images).
*/
readonly image: pulumi.Output<string>;
/**
* The IPv4 address
*/
readonly ipv4Address: pulumi.Output<string>;
/**
* The private networking IPv4 address
*/
readonly ipv4AddressPrivate: pulumi.Output<string>;
/**
* Boolean controlling if IPv6 is enabled. Defaults to false.
* Once enabled for a Droplet, IPv6 can not be disabled. When enabling IPv6 on
* an existing Droplet, [additional OS-level configuration](https://docs.digitalocean.com/products/networking/ipv6/how-to/enable/#on-existing-droplets)
* is required.
*/
readonly ipv6: pulumi.Output<boolean | undefined>;
/**
* The IPv6 address
*/
readonly ipv6Address: pulumi.Output<string>;
/**
* Is the Droplet locked
*/
readonly locked: pulumi.Output<boolean>;
readonly memory: pulumi.Output<number>;
/**
* Boolean controlling whether monitoring agent is installed.
* Defaults to false. If set to `true`, you can configure monitor alert policies
* [monitor alert resource](https://www.terraform.io/providers/digitalocean/digitalocean/latest/docs/resources/monitor_alert)
*/
readonly monitoring: pulumi.Output<boolean | undefined>;
/**
* The Droplet name.
*/
readonly name: pulumi.Output<string>;
/**
* Droplet hourly price
*/
readonly priceHourly: pulumi.Output<number>;
/**
* Droplet monthly price
*/
readonly priceMonthly: pulumi.Output<number>;
/**
* **Deprecated** Boolean controlling if private networking
* is enabled. This parameter has been deprecated. Use `vpcUuid` instead to specify a VPC network for the Droplet. If no `vpcUuid` is provided, the Droplet will be placed in your account's default VPC for the region.
*
* @deprecated This parameter has been deprecated. Use `vpcUuid` instead to specify a VPC network for the Droplet. If no `vpcUuid` is provided, the Droplet will be placed in your account's default VPC for the region.
*/
readonly privateNetworking: pulumi.Output<boolean>;
/**
* The region where the Droplet will be created.
*/
readonly region: pulumi.Output<string>;
/**
* Boolean controlling whether to increase the disk
* size when resizing a Droplet. It defaults to `true`. When set to `false`,
* only the Droplet's RAM and CPU will be resized. **Increasing a Droplet's disk
* size is a permanent change**. Increasing only RAM and CPU is reversible.
*/
readonly resizeDisk: pulumi.Output<boolean | undefined>;
/**
* The unique slug that identifies the type of Droplet. You may list the available slugs using the [DigitalOcean API](https://docs.digitalocean.com/reference/api/digitalocean/#tag/Sizes).
*/
readonly size: pulumi.Output<string>;
/**
* A list of SSH key IDs or fingerprints to enable in
* the format `[12345, 123456]`. To retrieve this info, use the
* [DigitalOcean API](https://docs.digitalocean.com/reference/api/digitalocean/#tag/SSH-Keys)
* or CLI (`doctl compute ssh-key list`). Once a Droplet is created keys can not
* be added or removed via this provider. Modifying this field will prompt you
* to destroy and recreate the Droplet.
*/
readonly sshKeys: pulumi.Output<string[] | undefined>;
/**
* The status of the Droplet
*/
readonly status: pulumi.Output<string>;
/**
* A list of the tags to be applied to this Droplet.
*/
readonly tags: pulumi.Output<string[] | undefined>;
/**
* A string of the desired User Data provided [during Droplet creation](https://docs.digitalocean.com/products/droplets/how-to/provide-user-data/). Changing this forces a new resource to be created.
*/
readonly userData: pulumi.Output<string | undefined>;
/**
* The number of the instance's virtual CPUs
*/
readonly vcpus: pulumi.Output<number>;
/**
* A list of the IDs of each block storage volume to be attached to the Droplet.
*/
readonly volumeIds: pulumi.Output<string[]>;
/**
* The ID of the VPC where the Droplet will be located.
*/
readonly vpcUuid: pulumi.Output<string>;
/**
* Create a Droplet resource with the given unique name, arguments, and options.
*
* @param name The _unique_ name of the resource.
* @param args The arguments to use to populate this resource's properties.
* @param opts A bag of options that control this resource's behavior.
*/
constructor(name: string, args: DropletArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering Droplet resources.
*/
export interface DropletState {
/**
* An object specifying the backup policy for the Droplet. If omitted and `backups` is `true`, the backup plan will default to daily.
*/
backupPolicy?: pulumi.Input<inputs.DropletBackupPolicy>;
/**
* Boolean controlling if backups are made. Defaults to
* false.
*/
backups?: pulumi.Input<boolean>;
createdAt?: pulumi.Input<string>;
/**
* The size of the instance's disk in GB
*/
disk?: pulumi.Input<number>;
/**
* A boolean indicating whether to install the
* DigitalOcean agent used for providing access to the Droplet web console in
* the control panel. By default, the agent is installed on new Droplets but
* installation errors (i.e. OS not supported) are ignored. To prevent it from
* being installed, set to `false`. To make installation errors fatal, explicitly
* set it to `true`.
*/
dropletAgent?: pulumi.Input<boolean>;
/**
* The uniform resource name of the Droplet
*/
dropletUrn?: pulumi.Input<string>;
/**
* A boolean indicating whether the droplet
* should be gracefully shut down before it is deleted.
*
* > **NOTE:** If you use `volumeIds` on a Droplet, this provider will assume management over the full set volumes for the instance, and treat additional volumes as a drift. For this reason, `volumeIds` must not be mixed with external `digitalocean.VolumeAttachment` resources for a given instance.
*/
gracefulShutdown?: pulumi.Input<boolean>;
/**
* The Droplet image ID or slug. This could be either image ID or droplet snapshot ID. You can find image IDs and slugs using the [DigitalOcean API](https://docs.digitalocean.com/reference/api/digitalocean/#tag/Images).
*/
image?: pulumi.Input<string>;
/**
* The IPv4 address
*/
ipv4Address?: pulumi.Input<string>;
/**
* The private networking IPv4 address
*/
ipv4AddressPrivate?: pulumi.Input<string>;
/**
* Boolean controlling if IPv6 is enabled. Defaults to false.
* Once enabled for a Droplet, IPv6 can not be disabled. When enabling IPv6 on
* an existing Droplet, [additional OS-level configuration](https://docs.digitalocean.com/products/networking/ipv6/how-to/enable/#on-existing-droplets)
* is required.
*/
ipv6?: pulumi.Input<boolean>;
/**
* The IPv6 address
*/
ipv6Address?: pulumi.Input<string>;
/**
* Is the Droplet locked
*/
locked?: pulumi.Input<boolean>;
memory?: pulumi.Input<number>;
/**
* Boolean controlling whether monitoring agent is installed.
* Defaults to false. If set to `true`, you can configure monitor alert policies
* [monitor alert resource](https://www.terraform.io/providers/digitalocean/digitalocean/latest/docs/resources/monitor_alert)
*/
monitoring?: pulumi.Input<boolean>;
/**
* The Droplet name.
*/
name?: pulumi.Input<string>;
/**
* Droplet hourly price
*/
priceHourly?: pulumi.Input<number>;
/**
* Droplet monthly price
*/
priceMonthly?: pulumi.Input<number>;
/**
* **Deprecated** Boolean controlling if private networking
* is enabled. This parameter has been deprecated. Use `vpcUuid` instead to specify a VPC network for the Droplet. If no `vpcUuid` is provided, the Droplet will be placed in your account's default VPC for the region.
*
* @deprecated This parameter has been deprecated. Use `vpcUuid` instead to specify a VPC network for the Droplet. If no `vpcUuid` is provided, the Droplet will be placed in your account's default VPC for the region.
*/
privateNetworking?: pulumi.Input<boolean>;
/**
* The region where the Droplet will be created.
*/
region?: pulumi.Input<string | enums.Region>;
/**
* Boolean controlling whether to increase the disk
* size when resizing a Droplet. It defaults to `true`. When set to `false`,
* only the Droplet's RAM and CPU will be resized. **Increasing a Droplet's disk
* size is a permanent change**. Increasing only RAM and CPU is reversible.
*/
resizeDisk?: pulumi.Input<boolean>;
/**
* The unique slug that identifies the type of Droplet. You may list the available slugs using the [DigitalOcean API](https://docs.digitalocean.com/reference/api/digitalocean/#tag/Sizes).
*/
size?: pulumi.Input<string | enums.DropletSlug>;
/**
* A list of SSH key IDs or fingerprints to enable in
* the format `[12345, 123456]`. To retrieve this info, use the
* [DigitalOcean API](https://docs.digitalocean.com/reference/api/digitalocean/#tag/SSH-Keys)
* or CLI (`doctl compute ssh-key list`). Once a Droplet is created keys can not
* be added or removed via this provider. Modifying this field will prompt you
* to destroy and recreate the Droplet.
*/
sshKeys?: pulumi.Input<pulumi.Input<string>[]>;
/**
* The status of the Droplet
*/
status?: pulumi.Input<string>;
/**
* A list of the tags to be applied to this Droplet.
*/
tags?: pulumi.Input<pulumi.Input<string>[]>;
/**
* A string of the desired User Data provided [during Droplet creation](https://docs.digitalocean.com/products/droplets/how-to/provide-user-data/). Changing this forces a new resource to be created.
*/
userData?: pulumi.Input<string>;
/**
* The number of the instance's virtual CPUs
*/
vcpus?: pulumi.Input<number>;
/**
* A list of the IDs of each block storage volume to be attached to the Droplet.
*/
volumeIds?: pulumi.Input<pulumi.Input<string>[]>;
/**
* The ID of the VPC where the Droplet will be located.
*/
vpcUuid?: pulumi.Input<string>;
}
/**
* The set of arguments for constructing a Droplet resource.
*/
export interface DropletArgs {
/**
* An object specifying the backup policy for the Droplet. If omitted and `backups` is `true`, the backup plan will default to daily.
*/
backupPolicy?: pulumi.Input<inputs.DropletBackupPolicy>;
/**
* Boolean controlling if backups are made. Defaults to
* false.
*/
backups?: pulumi.Input<boolean>;
/**
* A boolean indicating whether to install the
* DigitalOcean agent used for providing access to the Droplet web console in
* the control panel. By default, the agent is installed on new Droplets but
* installation errors (i.e. OS not supported) are ignored. To prevent it from
* being installed, set to `false`. To make installation errors fatal, explicitly
* set it to `true`.
*/
dropletAgent?: pulumi.Input<boolean>;
/**
* A boolean indicating whether the droplet
* should be gracefully shut down before it is deleted.
*
* > **NOTE:** If you use `volumeIds` on a Droplet, this provider will assume management over the full set volumes for the instance, and treat additional volumes as a drift. For this reason, `volumeIds` must not be mixed with external `digitalocean.VolumeAttachment` resources for a given instance.
*/
gracefulShutdown?: pulumi.Input<boolean>;
/**
* The Droplet image ID or slug. This could be either image ID or droplet snapshot ID. You can find image IDs and slugs using the [DigitalOcean API](https://docs.digitalocean.com/reference/api/digitalocean/#tag/Images).
*/
image: pulumi.Input<string>;
/**
* Boolean controlling if IPv6 is enabled. Defaults to false.
* Once enabled for a Droplet, IPv6 can not be disabled. When enabling IPv6 on
* an existing Droplet, [additional OS-level configuration](https://docs.digitalocean.com/products/networking/ipv6/how-to/enable/#on-existing-droplets)
* is required.
*/
ipv6?: pulumi.Input<boolean>;
/**
* The IPv6 address
*/
ipv6Address?: pulumi.Input<string>;
/**
* Boolean controlling whether monitoring agent is installed.
* Defaults to false. If set to `true`, you can configure monitor alert policies
* [monitor alert resource](https://www.terraform.io/providers/digitalocean/digitalocean/latest/docs/resources/monitor_alert)
*/
monitoring?: pulumi.Input<boolean>;
/**
* The Droplet name.
*/
name?: pulumi.Input<string>;
/**
* **Deprecated** Boolean controlling if private networking
* is enabled. This parameter has been deprecated. Use `vpcUuid` instead to specify a VPC network for the Droplet. If no `vpcUuid` is provided, the Droplet will be placed in your account's default VPC for the region.
*
* @deprecated This parameter has been deprecated. Use `vpcUuid` instead to specify a VPC network for the Droplet. If no `vpcUuid` is provided, the Droplet will be placed in your account's default VPC for the region.
*/
privateNetworking?: pulumi.Input<boolean>;
/**
* The region where the Droplet will be created.
*/
region?: pulumi.Input<string | enums.Region>;
/**
* Boolean controlling whether to increase the disk
* size when resizing a Droplet. It defaults to `true`. When set to `false`,
* only the Droplet's RAM and CPU will be resized. **Increasing a Droplet's disk
* size is a permanent change**. Increasing only RAM and CPU is reversible.
*/
resizeDisk?: pulumi.Input<boolean>;
/**
* The unique slug that identifies the type of Droplet. You may list the available slugs using the [DigitalOcean API](https://docs.digitalocean.com/reference/api/digitalocean/#tag/Sizes).
*/
size: pulumi.Input<string | enums.DropletSlug>;
/**
* A list of SSH key IDs or fingerprints to enable in
* the format `[12345, 123456]`. To retrieve this info, use the
* [DigitalOcean API](https://docs.digitalocean.com/reference/api/digitalocean/#tag/SSH-Keys)
* or CLI (`doctl compute ssh-key list`). Once a Droplet is created keys can not
* be added or removed via this provider. Modifying this field will prompt you
* to destroy and recreate the Droplet.
*/
sshKeys?: pulumi.Input<pulumi.Input<string>[]>;
/**
* A list of the tags to be applied to this Droplet.
*/
tags?: pulumi.Input<pulumi.Input<string>[]>;
/**
* A string of the desired User Data provided [during Droplet creation](https://docs.digitalocean.com/products/droplets/how-to/provide-user-data/). Changing this forces a new resource to be created.
*/
userData?: pulumi.Input<string>;
/**
* A list of the IDs of each block storage volume to be attached to the Droplet.
*/
volumeIds?: pulumi.Input<pulumi.Input<string>[]>;
/**
* The ID of the VPC where the Droplet will be located.
*/
vpcUuid?: pulumi.Input<string>;
}