import * as pulumi from "@pulumi/pulumi"; /** * Provides a Civo instance resource. This can be used to create, modify, and delete instances. * * ## Example Usage * * * View instances after creation on the [CLI](https://www.civo.com/docs/overview/civo-cli): * * View instances after creation on the [Dashboard](https://dashboard.civo.com/instances) * * View node sizes on [CLI](https://www.civo.com/docs/overview/civo-cli): * * ### Simple and smallest instance with its own network * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as civo from "@pulumi/civo"; * * const exampleNetwork = new civo.Network("example", {label: "example-network"}); * const example = new civo.Firewall("example", { * name: "example-firewall", * createDefaultRules: true, * networkId: exampleNetwork.id, * }); * // Query instance disk image * const debian = civo.getDiskImage({ * filters: [{ * key: "name", * values: ["debian-10"], * }], * }); * // Create a new instance * const exampleInstance = new civo.Instance("example", { * hostname: "example", * tags: [ * "example", * "documentation", * ], * notes: "This is an example instance", * firewallId: example.id, * networkId: exampleNetwork.id, * size: "g3.xsmall", * diskImage: debian.then(debian => debian.diskimages?.[0]?.id), * }); * ``` * * With this configuration, an initial password for the instance gets written to the state on output `initialPassword` which you can use to access the instance. * * Alternative you can get the password with the [CLI](https://www.civo.com/docs/overview/civo-cli): * * ### Instance with ssh login * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as civo from "@pulumi/civo"; * import * as std from "@pulumi/std"; * * const exampleNetwork = new civo.Network("example", {label: "example-network"}); * const example = new civo.Firewall("example", { * name: "example-firewall", * createDefaultRules: true, * networkId: exampleNetwork.id, * }); * // Query instance disk image * const debian = civo.getDiskImage({ * filters: [{ * key: "name", * values: ["debian-10"], * }], * }); * // To create the example key, run this command: * // ssh-keygen -f ~/.ssh/example-tf -C "terraform-example@localmachine" * const exampleSshKey = new civo.SshKey("example", { * name: "example", * publicKey: std.file({ * input: "~/.ssh/example-tf.pub", * }).then(invoke => invoke.result), * }); * // Create a new instance * const exampleInstance = new civo.Instance("example", { * hostname: "example", * tags: [ * "example", * "documentation", * ], * notes: "This is an example instance", * sshkeyId: exampleSshKey.id, * firewallId: example.id, * networkId: exampleNetwork.id, * size: "g3.xsmall", * diskImage: debian.then(debian => debian.diskimages?.[0]?.id), * volumeType: "csi-s3", * }); * ``` * * ## Import * * using ID * * ```sh * $ pulumi import civo:index/instance:Instance example 18bd98ad-1b6e-4f87-b48f-e690b4fd7413 * ``` */ export declare class Instance extends pulumi.CustomResource { /** * Get an existing Instance 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, state?: InstanceState, opts?: pulumi.CustomResourceOptions): Instance; /** * Returns true if the given object is an instance of Instance. 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 Instance; /** * (Number) Instance's CPU cores */ readonly cpuCores: pulumi.Output; /** * (String) Timestamp when the instance was created */ readonly createdAt: pulumi.Output; /** * (Number) Instance's disk (GB) */ readonly diskGb: pulumi.Output; /** * The ID for the disk image to use to build the instance */ readonly diskImage: pulumi.Output; /** * The ID of the firewall to use, from the current list. If left blank or not sent, the default firewall will be used (open * to all) */ readonly firewallId: pulumi.Output; /** * A fully qualified domain name that should be set as the instance's hostname */ readonly hostname: pulumi.Output; /** * (String, Sensitive) Initial password for login */ readonly initialPassword: pulumi.Output; /** * The name of the initial user created on the server (optional; this will default to the template's defaultUsername and * fallback to civo) */ readonly initialUser: pulumi.Output; /** * This must be the ID of the network from the network listing (optional; default network used when not specified) */ readonly networkId: pulumi.Output; /** * Add some notes to the instance */ readonly notes: pulumi.Output; /** * (String) Instance's private IP address */ readonly privateIp: pulumi.Output; /** * The private IPv4 address for the instance (optional) */ readonly privateIpv4: pulumi.Output; /** * (String) Instance's public IP address */ readonly publicIp: pulumi.Output; /** * This should be either 'none' or 'create' (default: 'create') */ readonly publicIpRequired: pulumi.Output; /** * (Number) Instance's RAM (MB) */ readonly ramMb: pulumi.Output; /** * The region for the instance, if not declare we use the region in declared in the provider */ readonly region: pulumi.Output; /** * Can be either the UUID, name, or the IP address of the reserved IP */ readonly reservedIpv4: pulumi.Output; /** * A fully qualified domain name that should be used as the instance's IP's reverse DNS (optional, uses the hostname if * unspecified) */ readonly reverseDns: pulumi.Output; /** * The contents of a script that will be uploaded to /usr/local/bin/civo-user-init-script on your instance, * read/write/executable only by root and then will be executed at the end of the cloud initialization */ readonly script: pulumi.Output; /** * The name of the size, from the current list, e.g. g3.xsmall */ readonly size: pulumi.Output; /** * (String) Instance's source ID */ readonly sourceId: pulumi.Output; /** * (String) Instance's source type */ readonly sourceType: pulumi.Output; /** * The ID of an already uploaded SSH public key to use for login to the default user (optional; if one isn't provided a * random password will be set and returned in the initialPassword field) */ readonly sshkeyId: pulumi.Output; /** * (String) Instance's status */ readonly status: pulumi.Output; /** * An optional list of tags, represented as a key, value pair */ readonly tags: pulumi.Output; /** * The type of volume to use, either 'ssd' or 'bssd' (optional; default 'ssd') */ readonly volumeType: pulumi.Output; readonly writePassword: pulumi.Output; /** * Create a Instance 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: InstanceArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering Instance resources. */ export interface InstanceState { /** * (Number) Instance's CPU cores */ cpuCores?: pulumi.Input; /** * (String) Timestamp when the instance was created */ createdAt?: pulumi.Input; /** * (Number) Instance's disk (GB) */ diskGb?: pulumi.Input; /** * The ID for the disk image to use to build the instance */ diskImage?: pulumi.Input; /** * The ID of the firewall to use, from the current list. If left blank or not sent, the default firewall will be used (open * to all) */ firewallId?: pulumi.Input; /** * A fully qualified domain name that should be set as the instance's hostname */ hostname?: pulumi.Input; /** * (String, Sensitive) Initial password for login */ initialPassword?: pulumi.Input; /** * The name of the initial user created on the server (optional; this will default to the template's defaultUsername and * fallback to civo) */ initialUser?: pulumi.Input; /** * This must be the ID of the network from the network listing (optional; default network used when not specified) */ networkId?: pulumi.Input; /** * Add some notes to the instance */ notes?: pulumi.Input; /** * (String) Instance's private IP address */ privateIp?: pulumi.Input; /** * The private IPv4 address for the instance (optional) */ privateIpv4?: pulumi.Input; /** * (String) Instance's public IP address */ publicIp?: pulumi.Input; /** * This should be either 'none' or 'create' (default: 'create') */ publicIpRequired?: pulumi.Input; /** * (Number) Instance's RAM (MB) */ ramMb?: pulumi.Input; /** * The region for the instance, if not declare we use the region in declared in the provider */ region?: pulumi.Input; /** * Can be either the UUID, name, or the IP address of the reserved IP */ reservedIpv4?: pulumi.Input; /** * A fully qualified domain name that should be used as the instance's IP's reverse DNS (optional, uses the hostname if * unspecified) */ reverseDns?: pulumi.Input; /** * The contents of a script that will be uploaded to /usr/local/bin/civo-user-init-script on your instance, * read/write/executable only by root and then will be executed at the end of the cloud initialization */ script?: pulumi.Input; /** * The name of the size, from the current list, e.g. g3.xsmall */ size?: pulumi.Input; /** * (String) Instance's source ID */ sourceId?: pulumi.Input; /** * (String) Instance's source type */ sourceType?: pulumi.Input; /** * The ID of an already uploaded SSH public key to use for login to the default user (optional; if one isn't provided a * random password will be set and returned in the initialPassword field) */ sshkeyId?: pulumi.Input; /** * (String) Instance's status */ status?: pulumi.Input; /** * An optional list of tags, represented as a key, value pair */ tags?: pulumi.Input[]>; /** * The type of volume to use, either 'ssd' or 'bssd' (optional; default 'ssd') */ volumeType?: pulumi.Input; writePassword?: pulumi.Input; } /** * The set of arguments for constructing a Instance resource. */ export interface InstanceArgs { /** * The ID for the disk image to use to build the instance */ diskImage: pulumi.Input; /** * The ID of the firewall to use, from the current list. If left blank or not sent, the default firewall will be used (open * to all) */ firewallId: pulumi.Input; /** * A fully qualified domain name that should be set as the instance's hostname */ hostname?: pulumi.Input; /** * The name of the initial user created on the server (optional; this will default to the template's defaultUsername and * fallback to civo) */ initialUser?: pulumi.Input; /** * This must be the ID of the network from the network listing (optional; default network used when not specified) */ networkId?: pulumi.Input; /** * Add some notes to the instance */ notes?: pulumi.Input; /** * The private IPv4 address for the instance (optional) */ privateIpv4?: pulumi.Input; /** * This should be either 'none' or 'create' (default: 'create') */ publicIpRequired?: pulumi.Input; /** * The region for the instance, if not declare we use the region in declared in the provider */ region?: pulumi.Input; /** * Can be either the UUID, name, or the IP address of the reserved IP */ reservedIpv4?: pulumi.Input; /** * A fully qualified domain name that should be used as the instance's IP's reverse DNS (optional, uses the hostname if * unspecified) */ reverseDns?: pulumi.Input; /** * The contents of a script that will be uploaded to /usr/local/bin/civo-user-init-script on your instance, * read/write/executable only by root and then will be executed at the end of the cloud initialization */ script?: pulumi.Input; /** * The name of the size, from the current list, e.g. g3.xsmall */ size?: pulumi.Input; /** * The ID of an already uploaded SSH public key to use for login to the default user (optional; if one isn't provided a * random password will be set and returned in the initialPassword field) */ sshkeyId?: pulumi.Input; /** * An optional list of tags, represented as a key, value pair */ tags?: pulumi.Input[]>; /** * The type of volume to use, either 'ssd' or 'bssd' (optional; default 'ssd') */ volumeType?: pulumi.Input; writePassword?: pulumi.Input; }