UNPKG

@pulumi/digitalocean

Version:

A Pulumi package for creating and managing DigitalOcean cloud resources.

170 lines (169 loc) 6.36 kB
import * as pulumi from "@pulumi/pulumi"; import * as inputs from "./types/input"; import * as outputs from "./types/output"; /** * Provides a DigitalOcean Droplet Autoscale resource. This can be used to create, modify, * read and delete Droplet Autoscale pools. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as digitalocean from "@pulumi/digitalocean"; * import * as std from "@pulumi/std"; * * const my_ssh_key = new digitalocean.SshKey("my-ssh-key", { * name: "terraform-example", * publicKey: std.file({ * input: "/Users/terraform/.ssh/id_rsa.pub", * }).then(invoke => invoke.result), * }); * const my_tag = new digitalocean.Tag("my-tag", {name: "terraform-example"}); * const my_autoscale_pool = new digitalocean.DropletAutoscale("my-autoscale-pool", { * name: "terraform-example", * config: { * minInstances: 10, * maxInstances: 50, * targetCpuUtilization: 0.5, * targetMemoryUtilization: 0.5, * cooldownMinutes: 5, * }, * dropletTemplate: { * size: "c-2", * region: "nyc3", * image: "ubuntu-24-04-x64", * tags: [my_tag.id], * sshKeys: [my_ssh_key.id], * withDropletAgent: true, * ipv6: true, * userData: ` * #cloud-config * runcmd: * - apt-get update * - apt-get install -y stress-ng * `, * }, * }); * ``` * * ## Import * * Droplet Autoscale pools can be imported using their `id`, e.g. * * ```sh * $ pulumi import digitalocean:index/dropletAutoscale:DropletAutoscale my-autoscale-pool 38e66834-d741-47ec-88e7-c70cbdcz0445 * ``` */ export declare class DropletAutoscale extends pulumi.CustomResource { /** * Get an existing DropletAutoscale 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?: DropletAutoscaleState, opts?: pulumi.CustomResourceOptions): DropletAutoscale; /** * Returns true if the given object is an instance of DropletAutoscale. 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 DropletAutoscale; /** * The configuration parameters for Droplet Autoscale pool, the supported arguments are * documented below. */ readonly config: pulumi.Output<outputs.DropletAutoscaleConfig>; /** * Created at timestamp for the Droplet Autoscale pool. */ readonly createdAt: pulumi.Output<string>; /** * The current average resource utilization of the Droplet Autoscale pool, this attribute further * embeds `memory` and `cpu` attributes to respectively report utilization data. */ readonly currentUtilizations: pulumi.Output<outputs.DropletAutoscaleCurrentUtilization[]>; /** * The droplet template parameters for Droplet Autoscale pool, the supported arguments * are documented below. */ readonly dropletTemplate: pulumi.Output<outputs.DropletAutoscaleDropletTemplate>; /** * The name of the Droplet Autoscale pool. */ readonly name: pulumi.Output<string>; /** * Droplet Autoscale pool health status; this reflects if the pool is currently healthy and ready to accept * traffic, or in an error state and needs user intervention. */ readonly status: pulumi.Output<string>; /** * Updated at timestamp for the Droplet Autoscale pool. */ readonly updatedAt: pulumi.Output<string>; /** * Create a DropletAutoscale 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: DropletAutoscaleArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering DropletAutoscale resources. */ export interface DropletAutoscaleState { /** * The configuration parameters for Droplet Autoscale pool, the supported arguments are * documented below. */ config?: pulumi.Input<inputs.DropletAutoscaleConfig>; /** * Created at timestamp for the Droplet Autoscale pool. */ createdAt?: pulumi.Input<string>; /** * The current average resource utilization of the Droplet Autoscale pool, this attribute further * embeds `memory` and `cpu` attributes to respectively report utilization data. */ currentUtilizations?: pulumi.Input<pulumi.Input<inputs.DropletAutoscaleCurrentUtilization>[]>; /** * The droplet template parameters for Droplet Autoscale pool, the supported arguments * are documented below. */ dropletTemplate?: pulumi.Input<inputs.DropletAutoscaleDropletTemplate>; /** * The name of the Droplet Autoscale pool. */ name?: pulumi.Input<string>; /** * Droplet Autoscale pool health status; this reflects if the pool is currently healthy and ready to accept * traffic, or in an error state and needs user intervention. */ status?: pulumi.Input<string>; /** * Updated at timestamp for the Droplet Autoscale pool. */ updatedAt?: pulumi.Input<string>; } /** * The set of arguments for constructing a DropletAutoscale resource. */ export interface DropletAutoscaleArgs { /** * The configuration parameters for Droplet Autoscale pool, the supported arguments are * documented below. */ config: pulumi.Input<inputs.DropletAutoscaleConfig>; /** * The droplet template parameters for Droplet Autoscale pool, the supported arguments * are documented below. */ dropletTemplate: pulumi.Input<inputs.DropletAutoscaleDropletTemplate>; /** * The name of the Droplet Autoscale pool. */ name?: pulumi.Input<string>; }