@pulumi/openstack
Version:
A Pulumi package for creating and managing OpenStack cloud resources.
558 lines (557 loc) • 23.4 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
import * as inputs from "../types/input";
import * as outputs from "../types/output";
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<pulumi.ID>, 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;
/**
* The first detected Fixed IPv4 address.
*/
readonly accessIpV4: pulumi.Output<string>;
/**
* The first detected Fixed IPv6 address.
*/
readonly accessIpV6: pulumi.Output<string>;
/**
* The administrative password to assign to the server.
* Changing this changes the root password on the existing server.
*/
readonly adminPass: pulumi.Output<string | undefined>;
readonly allMetadata: pulumi.Output<{
[key: string]: string;
}>;
/**
* The collection of tags assigned on the instance, which have
* been explicitly and implicitly added.
*/
readonly allTags: pulumi.Output<string[]>;
/**
* The availability zone in which to create
* the server. Conflicts with `availabilityZoneHints`. Changing this creates
* a new server.
*/
readonly availabilityZone: pulumi.Output<string>;
/**
* The availability zone in which to
* create the server. This argument is preferred to `availabilityZone`, when
* scheduling the server on a
* [particular](https://docs.openstack.org/nova/latest/admin/availability-zones.html)
* host or node. Conflicts with `availabilityZone`. Changing this creates a
* new server.
*/
readonly availabilityZoneHints: pulumi.Output<string | undefined>;
/**
* Configuration of block devices. The blockDevice
* structure is documented below. Changing this creates a new server.
* You can specify multiple block devices which will create an instance with
* multiple disks. This configuration is very flexible, so please see the
* following [reference](https://docs.openstack.org/nova/latest/user/block-device-mapping.html)
* for more information.
*/
readonly blockDevices: pulumi.Output<outputs.compute.InstanceBlockDevice[] | undefined>;
/**
* Whether to use the configDrive feature to
* configure the instance. Changing this creates a new server.
*/
readonly configDrive: pulumi.Output<boolean | undefined>;
/**
* The creation time of the instance.
*/
readonly created: pulumi.Output<string>;
/**
* The flavor ID of
* the desired flavor for the server. Changing this resizes the existing server.
*/
readonly flavorId: pulumi.Output<string>;
/**
* The name of the
* desired flavor for the server. Changing this resizes the existing server.
*/
readonly flavorName: pulumi.Output<string>;
/**
* Whether to force the OpenStack instance to be
* forcefully deleted. This is useful for environments that have reclaim / soft
* deletion enabled.
*/
readonly forceDelete: pulumi.Output<boolean | undefined>;
/**
* Specifies the exact hypervisor hostname on
* which to create the instance. When provided, this parameter is included in
* the request to Nova, directing the scheduler to launch the instance on the
* specified host. Note: This option requires administrative privileges and a
* Nova microversion of 2.74 or later. Conflicts with `personality`. Changing
* this value forces a new instance to be created.
*/
readonly hypervisorHostname: pulumi.Output<string>;
/**
* (Optional; Required if `imageName` is empty and not booting
* from a volume. Do not specify if booting from a volume.) The image ID of
* the desired image for the server. Changing this rebuilds the existing
* server.
*/
readonly imageId: pulumi.Output<string>;
/**
* (Optional; Required if `imageId` is empty and not booting
* from a volume. Do not specify if booting from a volume.) The name of the
* desired image for the server. Changing this rebuilds the existing server.
*/
readonly imageName: pulumi.Output<string>;
/**
* The name of a key pair to put on the server. The key
* pair must already be created and associated with the tenant's account.
* Changing this creates a new server.
*/
readonly keyPair: pulumi.Output<string | undefined>;
/**
* Metadata key/value pairs to make available from
* within the instance. Changing this updates the existing server metadata.
*/
readonly metadata: pulumi.Output<{
[key: string]: string;
} | undefined>;
/**
* A unique name for the resource.
*/
readonly name: pulumi.Output<string>;
/**
* Special string for `network` option to create
* the server. `networkMode` can be `"auto"` or `"none"`.
* Please see the following [reference](https://docs.openstack.org/api-ref/compute/?expanded=create-server-detail#id11) for more information. Conflicts with `network`.
*/
readonly networkMode: pulumi.Output<string | undefined>;
/**
* An array of one or more networks to attach to the
* instance. The network object structure is documented below. Changing this
* creates a new server.
*/
readonly networks: pulumi.Output<outputs.compute.InstanceNetwork[]>;
/**
* Customize the personality of an instance by
* defining one or more files and their contents. The personality structure is
* described below. Conflicts with `hypervisorHostname`. Changing this rebuilds
* the existing server.
*/
readonly personalities: pulumi.Output<outputs.compute.InstancePersonality[] | undefined>;
/**
* Provide the VM state. Only 'active', 'shutoff', 'paused'
* and 'shelved_offloaded' are supported values.
* *Note*: If the initial powerState is the shutoff or paused
* the VM will be stopped immediately after build and the provisioners like
* remote-exec or files are not supported.
*/
readonly powerState: pulumi.Output<string | undefined>;
/**
* The region in which to create the server instance. If
* omitted, the `region` argument of the provider is used. Changing this
* creates a new server.
*/
readonly region: pulumi.Output<string>;
/**
* Provide the Nova scheduler with hints on how
* the instance should be launched. The available hints are described below.
*/
readonly schedulerHints: pulumi.Output<outputs.compute.InstanceSchedulerHint[] | undefined>;
/**
* An array of one or more security group names
* to associate with the server. Changing this results in adding/removing
* security groups from the existing server. *Note*: When attaching the
* instance to networks using Ports, place the security groups on the Port
* and not the instance. *Note*: Names should be used and not ids, as ids
* trigger unnecessary updates.
*/
readonly securityGroups: pulumi.Output<string[]>;
/**
* Whether to try stop instance gracefully
* before destroying it, thus giving chance for guest OS daemons to stop correctly.
* If instance doesn't stop within timeout, it will be destroyed anyway.
*/
readonly stopBeforeDestroy: pulumi.Output<boolean | undefined>;
/**
* A set of string tags for the instance. Changing this
* updates the existing instance tags.
*/
readonly tags: pulumi.Output<string[] | undefined>;
/**
* The time when the instance was last updated.
*/
readonly updated: pulumi.Output<string>;
/**
* The user data to provide when launching the instance.
* Changing this creates a new server.
*/
readonly userData: pulumi.Output<string | undefined>;
/**
* Map of additional vendor-specific options.
* Supported options are described below.
*/
readonly vendorOptions: pulumi.Output<outputs.compute.InstanceVendorOptions | undefined>;
/**
* 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 {
/**
* The first detected Fixed IPv4 address.
*/
accessIpV4?: pulumi.Input<string>;
/**
* The first detected Fixed IPv6 address.
*/
accessIpV6?: pulumi.Input<string>;
/**
* The administrative password to assign to the server.
* Changing this changes the root password on the existing server.
*/
adminPass?: pulumi.Input<string>;
allMetadata?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* The collection of tags assigned on the instance, which have
* been explicitly and implicitly added.
*/
allTags?: pulumi.Input<pulumi.Input<string>[]>;
/**
* The availability zone in which to create
* the server. Conflicts with `availabilityZoneHints`. Changing this creates
* a new server.
*/
availabilityZone?: pulumi.Input<string>;
/**
* The availability zone in which to
* create the server. This argument is preferred to `availabilityZone`, when
* scheduling the server on a
* [particular](https://docs.openstack.org/nova/latest/admin/availability-zones.html)
* host or node. Conflicts with `availabilityZone`. Changing this creates a
* new server.
*/
availabilityZoneHints?: pulumi.Input<string>;
/**
* Configuration of block devices. The blockDevice
* structure is documented below. Changing this creates a new server.
* You can specify multiple block devices which will create an instance with
* multiple disks. This configuration is very flexible, so please see the
* following [reference](https://docs.openstack.org/nova/latest/user/block-device-mapping.html)
* for more information.
*/
blockDevices?: pulumi.Input<pulumi.Input<inputs.compute.InstanceBlockDevice>[]>;
/**
* Whether to use the configDrive feature to
* configure the instance. Changing this creates a new server.
*/
configDrive?: pulumi.Input<boolean>;
/**
* The creation time of the instance.
*/
created?: pulumi.Input<string>;
/**
* The flavor ID of
* the desired flavor for the server. Changing this resizes the existing server.
*/
flavorId?: pulumi.Input<string>;
/**
* The name of the
* desired flavor for the server. Changing this resizes the existing server.
*/
flavorName?: pulumi.Input<string>;
/**
* Whether to force the OpenStack instance to be
* forcefully deleted. This is useful for environments that have reclaim / soft
* deletion enabled.
*/
forceDelete?: pulumi.Input<boolean>;
/**
* Specifies the exact hypervisor hostname on
* which to create the instance. When provided, this parameter is included in
* the request to Nova, directing the scheduler to launch the instance on the
* specified host. Note: This option requires administrative privileges and a
* Nova microversion of 2.74 or later. Conflicts with `personality`. Changing
* this value forces a new instance to be created.
*/
hypervisorHostname?: pulumi.Input<string>;
/**
* (Optional; Required if `imageName` is empty and not booting
* from a volume. Do not specify if booting from a volume.) The image ID of
* the desired image for the server. Changing this rebuilds the existing
* server.
*/
imageId?: pulumi.Input<string>;
/**
* (Optional; Required if `imageId` is empty and not booting
* from a volume. Do not specify if booting from a volume.) The name of the
* desired image for the server. Changing this rebuilds the existing server.
*/
imageName?: pulumi.Input<string>;
/**
* The name of a key pair to put on the server. The key
* pair must already be created and associated with the tenant's account.
* Changing this creates a new server.
*/
keyPair?: pulumi.Input<string>;
/**
* Metadata key/value pairs to make available from
* within the instance. Changing this updates the existing server metadata.
*/
metadata?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* A unique name for the resource.
*/
name?: pulumi.Input<string>;
/**
* Special string for `network` option to create
* the server. `networkMode` can be `"auto"` or `"none"`.
* Please see the following [reference](https://docs.openstack.org/api-ref/compute/?expanded=create-server-detail#id11) for more information. Conflicts with `network`.
*/
networkMode?: pulumi.Input<string>;
/**
* An array of one or more networks to attach to the
* instance. The network object structure is documented below. Changing this
* creates a new server.
*/
networks?: pulumi.Input<pulumi.Input<inputs.compute.InstanceNetwork>[]>;
/**
* Customize the personality of an instance by
* defining one or more files and their contents. The personality structure is
* described below. Conflicts with `hypervisorHostname`. Changing this rebuilds
* the existing server.
*/
personalities?: pulumi.Input<pulumi.Input<inputs.compute.InstancePersonality>[]>;
/**
* Provide the VM state. Only 'active', 'shutoff', 'paused'
* and 'shelved_offloaded' are supported values.
* *Note*: If the initial powerState is the shutoff or paused
* the VM will be stopped immediately after build and the provisioners like
* remote-exec or files are not supported.
*/
powerState?: pulumi.Input<string>;
/**
* The region in which to create the server instance. If
* omitted, the `region` argument of the provider is used. Changing this
* creates a new server.
*/
region?: pulumi.Input<string>;
/**
* Provide the Nova scheduler with hints on how
* the instance should be launched. The available hints are described below.
*/
schedulerHints?: pulumi.Input<pulumi.Input<inputs.compute.InstanceSchedulerHint>[]>;
/**
* An array of one or more security group names
* to associate with the server. Changing this results in adding/removing
* security groups from the existing server. *Note*: When attaching the
* instance to networks using Ports, place the security groups on the Port
* and not the instance. *Note*: Names should be used and not ids, as ids
* trigger unnecessary updates.
*/
securityGroups?: pulumi.Input<pulumi.Input<string>[]>;
/**
* Whether to try stop instance gracefully
* before destroying it, thus giving chance for guest OS daemons to stop correctly.
* If instance doesn't stop within timeout, it will be destroyed anyway.
*/
stopBeforeDestroy?: pulumi.Input<boolean>;
/**
* A set of string tags for the instance. Changing this
* updates the existing instance tags.
*/
tags?: pulumi.Input<pulumi.Input<string>[]>;
/**
* The time when the instance was last updated.
*/
updated?: pulumi.Input<string>;
/**
* The user data to provide when launching the instance.
* Changing this creates a new server.
*/
userData?: pulumi.Input<string>;
/**
* Map of additional vendor-specific options.
* Supported options are described below.
*/
vendorOptions?: pulumi.Input<inputs.compute.InstanceVendorOptions>;
}
/**
* The set of arguments for constructing a Instance resource.
*/
export interface InstanceArgs {
/**
* The administrative password to assign to the server.
* Changing this changes the root password on the existing server.
*/
adminPass?: pulumi.Input<string>;
/**
* The availability zone in which to create
* the server. Conflicts with `availabilityZoneHints`. Changing this creates
* a new server.
*/
availabilityZone?: pulumi.Input<string>;
/**
* The availability zone in which to
* create the server. This argument is preferred to `availabilityZone`, when
* scheduling the server on a
* [particular](https://docs.openstack.org/nova/latest/admin/availability-zones.html)
* host or node. Conflicts with `availabilityZone`. Changing this creates a
* new server.
*/
availabilityZoneHints?: pulumi.Input<string>;
/**
* Configuration of block devices. The blockDevice
* structure is documented below. Changing this creates a new server.
* You can specify multiple block devices which will create an instance with
* multiple disks. This configuration is very flexible, so please see the
* following [reference](https://docs.openstack.org/nova/latest/user/block-device-mapping.html)
* for more information.
*/
blockDevices?: pulumi.Input<pulumi.Input<inputs.compute.InstanceBlockDevice>[]>;
/**
* Whether to use the configDrive feature to
* configure the instance. Changing this creates a new server.
*/
configDrive?: pulumi.Input<boolean>;
/**
* The flavor ID of
* the desired flavor for the server. Changing this resizes the existing server.
*/
flavorId?: pulumi.Input<string>;
/**
* The name of the
* desired flavor for the server. Changing this resizes the existing server.
*/
flavorName?: pulumi.Input<string>;
/**
* Whether to force the OpenStack instance to be
* forcefully deleted. This is useful for environments that have reclaim / soft
* deletion enabled.
*/
forceDelete?: pulumi.Input<boolean>;
/**
* Specifies the exact hypervisor hostname on
* which to create the instance. When provided, this parameter is included in
* the request to Nova, directing the scheduler to launch the instance on the
* specified host. Note: This option requires administrative privileges and a
* Nova microversion of 2.74 or later. Conflicts with `personality`. Changing
* this value forces a new instance to be created.
*/
hypervisorHostname?: pulumi.Input<string>;
/**
* (Optional; Required if `imageName` is empty and not booting
* from a volume. Do not specify if booting from a volume.) The image ID of
* the desired image for the server. Changing this rebuilds the existing
* server.
*/
imageId?: pulumi.Input<string>;
/**
* (Optional; Required if `imageId` is empty and not booting
* from a volume. Do not specify if booting from a volume.) The name of the
* desired image for the server. Changing this rebuilds the existing server.
*/
imageName?: pulumi.Input<string>;
/**
* The name of a key pair to put on the server. The key
* pair must already be created and associated with the tenant's account.
* Changing this creates a new server.
*/
keyPair?: pulumi.Input<string>;
/**
* Metadata key/value pairs to make available from
* within the instance. Changing this updates the existing server metadata.
*/
metadata?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* A unique name for the resource.
*/
name?: pulumi.Input<string>;
/**
* Special string for `network` option to create
* the server. `networkMode` can be `"auto"` or `"none"`.
* Please see the following [reference](https://docs.openstack.org/api-ref/compute/?expanded=create-server-detail#id11) for more information. Conflicts with `network`.
*/
networkMode?: pulumi.Input<string>;
/**
* An array of one or more networks to attach to the
* instance. The network object structure is documented below. Changing this
* creates a new server.
*/
networks?: pulumi.Input<pulumi.Input<inputs.compute.InstanceNetwork>[]>;
/**
* Customize the personality of an instance by
* defining one or more files and their contents. The personality structure is
* described below. Conflicts with `hypervisorHostname`. Changing this rebuilds
* the existing server.
*/
personalities?: pulumi.Input<pulumi.Input<inputs.compute.InstancePersonality>[]>;
/**
* Provide the VM state. Only 'active', 'shutoff', 'paused'
* and 'shelved_offloaded' are supported values.
* *Note*: If the initial powerState is the shutoff or paused
* the VM will be stopped immediately after build and the provisioners like
* remote-exec or files are not supported.
*/
powerState?: pulumi.Input<string>;
/**
* The region in which to create the server instance. If
* omitted, the `region` argument of the provider is used. Changing this
* creates a new server.
*/
region?: pulumi.Input<string>;
/**
* Provide the Nova scheduler with hints on how
* the instance should be launched. The available hints are described below.
*/
schedulerHints?: pulumi.Input<pulumi.Input<inputs.compute.InstanceSchedulerHint>[]>;
/**
* An array of one or more security group names
* to associate with the server. Changing this results in adding/removing
* security groups from the existing server. *Note*: When attaching the
* instance to networks using Ports, place the security groups on the Port
* and not the instance. *Note*: Names should be used and not ids, as ids
* trigger unnecessary updates.
*/
securityGroups?: pulumi.Input<pulumi.Input<string>[]>;
/**
* Whether to try stop instance gracefully
* before destroying it, thus giving chance for guest OS daemons to stop correctly.
* If instance doesn't stop within timeout, it will be destroyed anyway.
*/
stopBeforeDestroy?: pulumi.Input<boolean>;
/**
* A set of string tags for the instance. Changing this
* updates the existing instance tags.
*/
tags?: pulumi.Input<pulumi.Input<string>[]>;
/**
* The user data to provide when launching the instance.
* Changing this creates a new server.
*/
userData?: pulumi.Input<string>;
/**
* Map of additional vendor-specific options.
* Supported options are described below.
*/
vendorOptions?: pulumi.Input<inputs.compute.InstanceVendorOptions>;
}