@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
601 lines (600 loc) • 28.3 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
import * as inputs from "../types/input";
import * as outputs from "../types/output";
/**
* The Google Compute Engine Instance Group Manager API creates and manages pools
* of homogeneous Compute Engine virtual machine instances from a common instance
* template. For more information, see [the official documentation](https://cloud.google.com/compute/docs/instance-groups/manager)
* and [API](https://cloud.google.com/compute/docs/reference/latest/instanceGroupManagers)
*
* > **Note:** Use [gcp.compute.RegionInstanceGroupManager](https://www.terraform.io/docs/providers/google/r/compute_region_instance_group_manager.html) to create a regional (multi-zone) instance group manager.
*
* ## Example Usage
*
* ### With Top Level Instance Template (`Google` Provider)
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const autohealing = new gcp.compute.HealthCheck("autohealing", {
* name: "autohealing-health-check",
* checkIntervalSec: 5,
* timeoutSec: 5,
* healthyThreshold: 2,
* unhealthyThreshold: 10,
* httpHealthCheck: {
* requestPath: "/healthz",
* port: 8080,
* },
* });
* const appserver = new gcp.compute.InstanceGroupManager("appserver", {
* name: "appserver-igm",
* baseInstanceName: "app",
* zone: "us-central1-a",
* versions: [{
* instanceTemplate: appserverGoogleComputeInstanceTemplate.selfLinkUnique,
* }],
* allInstancesConfig: {
* metadata: {
* metadata_key: "metadata_value",
* },
* labels: {
* label_key: "label_value",
* },
* },
* targetPools: [appserverGoogleComputeTargetPool.id],
* targetSize: 2,
* namedPorts: [{
* name: "customhttp",
* port: 8888,
* }],
* autoHealingPolicies: {
* healthCheck: autohealing.id,
* initialDelaySec: 300,
* },
* });
* ```
*
* ### With Multiple Versions (`Google-Beta` Provider)
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const appserver = new gcp.compute.InstanceGroupManager("appserver", {
* name: "appserver-igm",
* baseInstanceName: "app",
* zone: "us-central1-a",
* targetSize: 5,
* versions: [
* {
* name: "appserver",
* instanceTemplate: appserverGoogleComputeInstanceTemplate.selfLinkUnique,
* },
* {
* name: "appserver-canary",
* instanceTemplate: appserver_canary.selfLinkUnique,
* targetSize: {
* fixed: 1,
* },
* },
* ],
* });
* ```
*
* ### With Standby Policy (`Google` Provider)
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const igm_sr = new gcp.compute.InstanceGroupManager("igm-sr", {
* name: "tf-sr-igm",
* baseInstanceName: "tf-sr-igm-instance",
* zone: "us-central1-a",
* targetSize: 5,
* versions: [{
* instanceTemplate: sr_igm.selfLink,
* name: "primary",
* }],
* standbyPolicy: {
* initialDelaySec: 30,
* mode: "MANUAL",
* },
* targetSuspendedSize: 2,
* targetStoppedSize: 1,
* });
* ```
*
* ## Import
*
* Instance group managers can be imported using any of these accepted formats:
*
* * `projects/{{project}}/zones/{{zone}}/instanceGroupManagers/{{name}}`
*
* * `{{project}}/{{zone}}/{{name}}`
*
* * `{{project}}/{{name}}`
*
* * `{{name}}`
*
* When using the `pulumi import` command, instance group managers can be imported using one of the formats above. For example:
*
* ```sh
* $ pulumi import gcp:compute/instanceGroupManager:InstanceGroupManager default projects/{{project}}/zones/{{zone}}/instanceGroupManagers/{{name}}
* ```
*
* ```sh
* $ pulumi import gcp:compute/instanceGroupManager:InstanceGroupManager default {{project}}/{{zone}}/{{name}}
* ```
*
* ```sh
* $ pulumi import gcp:compute/instanceGroupManager:InstanceGroupManager default {{project}}/{{name}}
* ```
*
* ```sh
* $ pulumi import gcp:compute/instanceGroupManager:InstanceGroupManager default {{name}}
* ```
*/
export declare class InstanceGroupManager extends pulumi.CustomResource {
/**
* Get an existing InstanceGroupManager 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?: InstanceGroupManagerState, opts?: pulumi.CustomResourceOptions): InstanceGroupManager;
/**
* Returns true if the given object is an instance of InstanceGroupManager. 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 InstanceGroupManager;
/**
* Properties to set on all instances in the group. After setting
* allInstancesConfig on the group, you must update the group's instances to
* apply the configuration.
*/
readonly allInstancesConfig: pulumi.Output<outputs.compute.InstanceGroupManagerAllInstancesConfig | undefined>;
/**
* The autohealing policies for this managed instance
* group. You can specify only one value. Structure is documented below. For more information, see the [official documentation](https://cloud.google.com/compute/docs/instance-groups/creating-groups-of-managed-instances#monitoring_groups).
*/
readonly autoHealingPolicies: pulumi.Output<outputs.compute.InstanceGroupManagerAutoHealingPolicies | undefined>;
/**
* The base instance name to use for
* instances in this group. The value must be a valid
* [RFC1035](https://www.ietf.org/rfc/rfc1035.txt) name. Supported characters
* are lowercase letters, numbers, and hyphens (-). Instances are named by
* appending a hyphen and a random four-character string to the base instance
* name.
*/
readonly baseInstanceName: pulumi.Output<string>;
/**
* Creation timestamp in RFC3339 text format.
*/
readonly creationTimestamp: pulumi.Output<string>;
/**
* An optional textual description of the instance
* group manager.
*/
readonly description: pulumi.Output<string | undefined>;
/**
* The fingerprint of the instance group manager.
*/
readonly fingerprint: pulumi.Output<string>;
/**
* The full URL of the instance group created by the manager.
*/
readonly instanceGroup: pulumi.Output<string>;
/**
* The unique identifier number for the resource. This identifier is defined by the server.
*/
readonly instanceGroupManagerId: pulumi.Output<number>;
/**
* The instance lifecycle policy for this managed instance group.
*/
readonly instanceLifecyclePolicy: pulumi.Output<outputs.compute.InstanceGroupManagerInstanceLifecyclePolicy>;
/**
* Pagination behavior of the `listManagedInstances` API
* method for this managed instance group. Valid values are: `PAGELESS`, `PAGINATED`.
* If `PAGELESS` (default), Pagination is disabled for the group's `listManagedInstances` API method.
* `maxResults` and `pageToken` query parameters are ignored and all instances are returned in a single
* response. If `PAGINATED`, pagination is enabled, `maxResults` and `pageToken` query parameters are
* respected.
*/
readonly listManagedInstancesResults: pulumi.Output<string | undefined>;
/**
* The name of the instance group manager. Must be 1-63
* characters long and comply with
* [RFC1035](https://www.ietf.org/rfc/rfc1035.txt). Supported characters
* include lowercase letters, numbers, and hyphens.
*/
readonly name: pulumi.Output<string>;
/**
* The named port configuration. See the section below
* for details on configuration.
*/
readonly namedPorts: pulumi.Output<outputs.compute.InstanceGroupManagerNamedPort[] | undefined>;
readonly operation: pulumi.Output<string>;
/**
* Input only additional params for instance group manager creation. Structure is documented below. For more information, see [API](https://cloud.google.com/compute/docs/reference/rest/beta/instanceGroupManagers/insert).
*
* - - -
*/
readonly params: pulumi.Output<outputs.compute.InstanceGroupManagerParams | undefined>;
/**
* The ID of the project in which the resource belongs. If it
* is not provided, the provider project is used.
*/
readonly project: pulumi.Output<string>;
/**
* The URL of the created resource.
*/
readonly selfLink: pulumi.Output<string>;
/**
* The standby policy for stopped and suspended instances. Structure is documented below. For more information, see the [official documentation](https://cloud.google.com/compute/docs/instance-groups/suspended-and-stopped-vms-in-mig).
*/
readonly standbyPolicy: pulumi.Output<outputs.compute.InstanceGroupManagerStandbyPolicy>;
/**
* Disks created on the instances that will be preserved on instance delete, update, etc. Structure is documented below. For more information see the [official documentation](https://cloud.google.com/compute/docs/instance-groups/configuring-stateful-disks-in-migs).
*/
readonly statefulDisks: pulumi.Output<outputs.compute.InstanceGroupManagerStatefulDisk[] | undefined>;
/**
* External network IPs assigned to the instances that will be preserved on instance delete, update, etc. This map is keyed with the network interface name. Structure is documented below.
*/
readonly statefulExternalIps: pulumi.Output<outputs.compute.InstanceGroupManagerStatefulExternalIp[] | undefined>;
/**
* Internal network IPs assigned to the instances that will be preserved on instance delete, update, etc. This map is keyed with the network interface name. Structure is documented below.
*/
readonly statefulInternalIps: pulumi.Output<outputs.compute.InstanceGroupManagerStatefulInternalIp[] | undefined>;
/**
* The status of this managed instance group.
*/
readonly statuses: pulumi.Output<outputs.compute.InstanceGroupManagerStatus[]>;
/**
* The full URL of all target pools to which new
* instances in the group are added. Updating the target pools attribute does
* not affect existing instances.
*/
readonly targetPools: pulumi.Output<string[] | undefined>;
/**
* The target number of running instances for this managed instance group. This value should always be explicitly set
* unless this resource is attached to an autoscaler, in which case it should never be set. Defaults to 0.
*/
readonly targetSize: pulumi.Output<number>;
/**
* The target number of stopped instances for this managed instance group.
*/
readonly targetStoppedSize: pulumi.Output<number>;
/**
* The target number of suspended instances for this managed instance group.
*/
readonly targetSuspendedSize: pulumi.Output<number>;
/**
* The update policy for this managed instance group. Structure is documented below. For more information, see the [official documentation](https://cloud.google.com/compute/docs/instance-groups/updating-managed-instance-groups) and [API](https://cloud.google.com/compute/docs/reference/rest/v1/instanceGroupManagers/patch).
*/
readonly updatePolicy: pulumi.Output<outputs.compute.InstanceGroupManagerUpdatePolicy>;
/**
* Application versions managed by this instance group. Each
* version deals with a specific instance template, allowing canary release scenarios.
* Structure is documented below.
*/
readonly versions: pulumi.Output<outputs.compute.InstanceGroupManagerVersion[]>;
/**
* Whether to wait for all instances to be created/updated before
* returning. Note that if this is set to true and the operation does not succeed, this provider will
* continue trying until it times out.
*/
readonly waitForInstances: pulumi.Output<boolean | undefined>;
/**
* When used with `waitForInstances` it specifies the status to wait for.
* When `STABLE` is specified this resource will wait until the instances are stable before returning. When `UPDATED` is
* set, it will wait for the version target to be reached and any per instance configs to be effective as well as all
* instances to be stable before returning. The possible values are `STABLE` and `UPDATED`
*/
readonly waitForInstancesStatus: pulumi.Output<string | undefined>;
/**
* The zone that instances in this group should be created
* in.
*
* - - -
*/
readonly zone: pulumi.Output<string>;
/**
* Create a InstanceGroupManager 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: InstanceGroupManagerArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering InstanceGroupManager resources.
*/
export interface InstanceGroupManagerState {
/**
* Properties to set on all instances in the group. After setting
* allInstancesConfig on the group, you must update the group's instances to
* apply the configuration.
*/
allInstancesConfig?: pulumi.Input<inputs.compute.InstanceGroupManagerAllInstancesConfig>;
/**
* The autohealing policies for this managed instance
* group. You can specify only one value. Structure is documented below. For more information, see the [official documentation](https://cloud.google.com/compute/docs/instance-groups/creating-groups-of-managed-instances#monitoring_groups).
*/
autoHealingPolicies?: pulumi.Input<inputs.compute.InstanceGroupManagerAutoHealingPolicies>;
/**
* The base instance name to use for
* instances in this group. The value must be a valid
* [RFC1035](https://www.ietf.org/rfc/rfc1035.txt) name. Supported characters
* are lowercase letters, numbers, and hyphens (-). Instances are named by
* appending a hyphen and a random four-character string to the base instance
* name.
*/
baseInstanceName?: pulumi.Input<string>;
/**
* Creation timestamp in RFC3339 text format.
*/
creationTimestamp?: pulumi.Input<string>;
/**
* An optional textual description of the instance
* group manager.
*/
description?: pulumi.Input<string>;
/**
* The fingerprint of the instance group manager.
*/
fingerprint?: pulumi.Input<string>;
/**
* The full URL of the instance group created by the manager.
*/
instanceGroup?: pulumi.Input<string>;
/**
* The unique identifier number for the resource. This identifier is defined by the server.
*/
instanceGroupManagerId?: pulumi.Input<number>;
/**
* The instance lifecycle policy for this managed instance group.
*/
instanceLifecyclePolicy?: pulumi.Input<inputs.compute.InstanceGroupManagerInstanceLifecyclePolicy>;
/**
* Pagination behavior of the `listManagedInstances` API
* method for this managed instance group. Valid values are: `PAGELESS`, `PAGINATED`.
* If `PAGELESS` (default), Pagination is disabled for the group's `listManagedInstances` API method.
* `maxResults` and `pageToken` query parameters are ignored and all instances are returned in a single
* response. If `PAGINATED`, pagination is enabled, `maxResults` and `pageToken` query parameters are
* respected.
*/
listManagedInstancesResults?: pulumi.Input<string>;
/**
* The name of the instance group manager. Must be 1-63
* characters long and comply with
* [RFC1035](https://www.ietf.org/rfc/rfc1035.txt). Supported characters
* include lowercase letters, numbers, and hyphens.
*/
name?: pulumi.Input<string>;
/**
* The named port configuration. See the section below
* for details on configuration.
*/
namedPorts?: pulumi.Input<pulumi.Input<inputs.compute.InstanceGroupManagerNamedPort>[]>;
operation?: pulumi.Input<string>;
/**
* Input only additional params for instance group manager creation. Structure is documented below. For more information, see [API](https://cloud.google.com/compute/docs/reference/rest/beta/instanceGroupManagers/insert).
*
* - - -
*/
params?: pulumi.Input<inputs.compute.InstanceGroupManagerParams>;
/**
* The ID of the project in which the resource belongs. If it
* is not provided, the provider project is used.
*/
project?: pulumi.Input<string>;
/**
* The URL of the created resource.
*/
selfLink?: pulumi.Input<string>;
/**
* The standby policy for stopped and suspended instances. Structure is documented below. For more information, see the [official documentation](https://cloud.google.com/compute/docs/instance-groups/suspended-and-stopped-vms-in-mig).
*/
standbyPolicy?: pulumi.Input<inputs.compute.InstanceGroupManagerStandbyPolicy>;
/**
* Disks created on the instances that will be preserved on instance delete, update, etc. Structure is documented below. For more information see the [official documentation](https://cloud.google.com/compute/docs/instance-groups/configuring-stateful-disks-in-migs).
*/
statefulDisks?: pulumi.Input<pulumi.Input<inputs.compute.InstanceGroupManagerStatefulDisk>[]>;
/**
* External network IPs assigned to the instances that will be preserved on instance delete, update, etc. This map is keyed with the network interface name. Structure is documented below.
*/
statefulExternalIps?: pulumi.Input<pulumi.Input<inputs.compute.InstanceGroupManagerStatefulExternalIp>[]>;
/**
* Internal network IPs assigned to the instances that will be preserved on instance delete, update, etc. This map is keyed with the network interface name. Structure is documented below.
*/
statefulInternalIps?: pulumi.Input<pulumi.Input<inputs.compute.InstanceGroupManagerStatefulInternalIp>[]>;
/**
* The status of this managed instance group.
*/
statuses?: pulumi.Input<pulumi.Input<inputs.compute.InstanceGroupManagerStatus>[]>;
/**
* The full URL of all target pools to which new
* instances in the group are added. Updating the target pools attribute does
* not affect existing instances.
*/
targetPools?: pulumi.Input<pulumi.Input<string>[]>;
/**
* The target number of running instances for this managed instance group. This value should always be explicitly set
* unless this resource is attached to an autoscaler, in which case it should never be set. Defaults to 0.
*/
targetSize?: pulumi.Input<number>;
/**
* The target number of stopped instances for this managed instance group.
*/
targetStoppedSize?: pulumi.Input<number>;
/**
* The target number of suspended instances for this managed instance group.
*/
targetSuspendedSize?: pulumi.Input<number>;
/**
* The update policy for this managed instance group. Structure is documented below. For more information, see the [official documentation](https://cloud.google.com/compute/docs/instance-groups/updating-managed-instance-groups) and [API](https://cloud.google.com/compute/docs/reference/rest/v1/instanceGroupManagers/patch).
*/
updatePolicy?: pulumi.Input<inputs.compute.InstanceGroupManagerUpdatePolicy>;
/**
* Application versions managed by this instance group. Each
* version deals with a specific instance template, allowing canary release scenarios.
* Structure is documented below.
*/
versions?: pulumi.Input<pulumi.Input<inputs.compute.InstanceGroupManagerVersion>[]>;
/**
* Whether to wait for all instances to be created/updated before
* returning. Note that if this is set to true and the operation does not succeed, this provider will
* continue trying until it times out.
*/
waitForInstances?: pulumi.Input<boolean>;
/**
* When used with `waitForInstances` it specifies the status to wait for.
* When `STABLE` is specified this resource will wait until the instances are stable before returning. When `UPDATED` is
* set, it will wait for the version target to be reached and any per instance configs to be effective as well as all
* instances to be stable before returning. The possible values are `STABLE` and `UPDATED`
*/
waitForInstancesStatus?: pulumi.Input<string>;
/**
* The zone that instances in this group should be created
* in.
*
* - - -
*/
zone?: pulumi.Input<string>;
}
/**
* The set of arguments for constructing a InstanceGroupManager resource.
*/
export interface InstanceGroupManagerArgs {
/**
* Properties to set on all instances in the group. After setting
* allInstancesConfig on the group, you must update the group's instances to
* apply the configuration.
*/
allInstancesConfig?: pulumi.Input<inputs.compute.InstanceGroupManagerAllInstancesConfig>;
/**
* The autohealing policies for this managed instance
* group. You can specify only one value. Structure is documented below. For more information, see the [official documentation](https://cloud.google.com/compute/docs/instance-groups/creating-groups-of-managed-instances#monitoring_groups).
*/
autoHealingPolicies?: pulumi.Input<inputs.compute.InstanceGroupManagerAutoHealingPolicies>;
/**
* The base instance name to use for
* instances in this group. The value must be a valid
* [RFC1035](https://www.ietf.org/rfc/rfc1035.txt) name. Supported characters
* are lowercase letters, numbers, and hyphens (-). Instances are named by
* appending a hyphen and a random four-character string to the base instance
* name.
*/
baseInstanceName: pulumi.Input<string>;
/**
* An optional textual description of the instance
* group manager.
*/
description?: pulumi.Input<string>;
/**
* The instance lifecycle policy for this managed instance group.
*/
instanceLifecyclePolicy?: pulumi.Input<inputs.compute.InstanceGroupManagerInstanceLifecyclePolicy>;
/**
* Pagination behavior of the `listManagedInstances` API
* method for this managed instance group. Valid values are: `PAGELESS`, `PAGINATED`.
* If `PAGELESS` (default), Pagination is disabled for the group's `listManagedInstances` API method.
* `maxResults` and `pageToken` query parameters are ignored and all instances are returned in a single
* response. If `PAGINATED`, pagination is enabled, `maxResults` and `pageToken` query parameters are
* respected.
*/
listManagedInstancesResults?: pulumi.Input<string>;
/**
* The name of the instance group manager. Must be 1-63
* characters long and comply with
* [RFC1035](https://www.ietf.org/rfc/rfc1035.txt). Supported characters
* include lowercase letters, numbers, and hyphens.
*/
name?: pulumi.Input<string>;
/**
* The named port configuration. See the section below
* for details on configuration.
*/
namedPorts?: pulumi.Input<pulumi.Input<inputs.compute.InstanceGroupManagerNamedPort>[]>;
/**
* Input only additional params for instance group manager creation. Structure is documented below. For more information, see [API](https://cloud.google.com/compute/docs/reference/rest/beta/instanceGroupManagers/insert).
*
* - - -
*/
params?: pulumi.Input<inputs.compute.InstanceGroupManagerParams>;
/**
* The ID of the project in which the resource belongs. If it
* is not provided, the provider project is used.
*/
project?: pulumi.Input<string>;
/**
* The standby policy for stopped and suspended instances. Structure is documented below. For more information, see the [official documentation](https://cloud.google.com/compute/docs/instance-groups/suspended-and-stopped-vms-in-mig).
*/
standbyPolicy?: pulumi.Input<inputs.compute.InstanceGroupManagerStandbyPolicy>;
/**
* Disks created on the instances that will be preserved on instance delete, update, etc. Structure is documented below. For more information see the [official documentation](https://cloud.google.com/compute/docs/instance-groups/configuring-stateful-disks-in-migs).
*/
statefulDisks?: pulumi.Input<pulumi.Input<inputs.compute.InstanceGroupManagerStatefulDisk>[]>;
/**
* External network IPs assigned to the instances that will be preserved on instance delete, update, etc. This map is keyed with the network interface name. Structure is documented below.
*/
statefulExternalIps?: pulumi.Input<pulumi.Input<inputs.compute.InstanceGroupManagerStatefulExternalIp>[]>;
/**
* Internal network IPs assigned to the instances that will be preserved on instance delete, update, etc. This map is keyed with the network interface name. Structure is documented below.
*/
statefulInternalIps?: pulumi.Input<pulumi.Input<inputs.compute.InstanceGroupManagerStatefulInternalIp>[]>;
/**
* The full URL of all target pools to which new
* instances in the group are added. Updating the target pools attribute does
* not affect existing instances.
*/
targetPools?: pulumi.Input<pulumi.Input<string>[]>;
/**
* The target number of running instances for this managed instance group. This value should always be explicitly set
* unless this resource is attached to an autoscaler, in which case it should never be set. Defaults to 0.
*/
targetSize?: pulumi.Input<number>;
/**
* The target number of stopped instances for this managed instance group.
*/
targetStoppedSize?: pulumi.Input<number>;
/**
* The target number of suspended instances for this managed instance group.
*/
targetSuspendedSize?: pulumi.Input<number>;
/**
* The update policy for this managed instance group. Structure is documented below. For more information, see the [official documentation](https://cloud.google.com/compute/docs/instance-groups/updating-managed-instance-groups) and [API](https://cloud.google.com/compute/docs/reference/rest/v1/instanceGroupManagers/patch).
*/
updatePolicy?: pulumi.Input<inputs.compute.InstanceGroupManagerUpdatePolicy>;
/**
* Application versions managed by this instance group. Each
* version deals with a specific instance template, allowing canary release scenarios.
* Structure is documented below.
*/
versions: pulumi.Input<pulumi.Input<inputs.compute.InstanceGroupManagerVersion>[]>;
/**
* Whether to wait for all instances to be created/updated before
* returning. Note that if this is set to true and the operation does not succeed, this provider will
* continue trying until it times out.
*/
waitForInstances?: pulumi.Input<boolean>;
/**
* When used with `waitForInstances` it specifies the status to wait for.
* When `STABLE` is specified this resource will wait until the instances are stable before returning. When `UPDATED` is
* set, it will wait for the version target to be reached and any per instance configs to be effective as well as all
* instances to be stable before returning. The possible values are `STABLE` and `UPDATED`
*/
waitForInstancesStatus?: pulumi.Input<string>;
/**
* The zone that instances in this group should be created
* in.
*
* - - -
*/
zone?: pulumi.Input<string>;
}