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, * }); * ``` * * ### With Resource Policies (`Google` Provider) * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const myImage = gcp.compute.getImage({ * family: "debian-11", * project: "debian-cloud", * }); * const workloadPolicy = new gcp.compute.ResourcePolicy("workload_policy", { * name: "tf-test-gce-policy", * region: "us-central1", * workloadPolicy: { * type: "HIGH_THROUGHPUT", * }, * }); * const igm_basic = new gcp.compute.InstanceTemplate("igm-basic", { * name: "igm-instance-template", * machineType: "a4-highgpu-8g", * canIpForward: false, * tags: [ * "foo", * "bar", * ], * disks: [{ * sourceImage: myImage.then(myImage => myImage.selfLink), * autoDelete: true, * boot: true, * diskType: "hyperdisk-balanced", * }], * networkInterfaces: [{ * network: "default", * }], * serviceAccount: { * scopes: [ * "userinfo-email", * "compute-ro", * "storage-ro", * ], * }, * }); * const igm_workload_policy = new gcp.compute.InstanceGroupManager("igm-workload-policy", { * description: "Terraform test instance group manager", * name: "igm-basic-workload-policy", * versions: [{ * name: "prod", * instanceTemplate: igm_basic.selfLink, * }], * baseInstanceName: "tf-test-igm-no-tp", * zone: "us-central1-b", * targetSize: 0, * resourcePolicies: { * workloadPolicy: workloadPolicy.selfLink, * }, * }); * ``` * * ## Import * * Instance group managers can be imported using any of these accepted formats: * * ```sh * * `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: * * ``` * $ terraform import google_compute_instance_group_manager.default projects/{{project}}/zones/{{zone}}/instanceGroupManagers/{{name}} * $ terraform import google_compute_instance_group_manager.default {{project}}/{{zone}}/{{name}} * $ terraform import google_compute_instance_group_manager.default {{project}}/{{name}} * $ terraform import google_compute_instance_group_manager.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, 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; /** * 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; /** * 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; /** * Creation timestamp in RFC3339 text format. */ readonly creationTimestamp: pulumi.Output; /** * An optional textual description of the instance * group manager. */ readonly description: pulumi.Output; /** * The fingerprint of the instance group manager. */ readonly fingerprint: pulumi.Output; /** * The full URL of the instance group created by the manager. */ readonly instanceGroup: pulumi.Output; /** * The unique identifier number for the resource. This identifier is defined by the server. */ readonly instanceGroupManagerId: pulumi.Output; /** * The instance lifecycle policy for this managed instance group. */ readonly instanceLifecyclePolicy: pulumi.Output; /** * 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; /** * 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; /** * The named port configuration. See the section below * for details on configuration. */ readonly namedPorts: pulumi.Output; readonly operation: pulumi.Output; /** * ) 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; /** * The ID of the project in which the resource belongs. If it * is not provided, the provider project is used. */ readonly project: pulumi.Output; /** * Resource policies for this managed instance group. Structure is documented below. * * - - - */ readonly resourcePolicies: pulumi.Output; /** * The URL of the created resource. */ readonly selfLink: pulumi.Output; /** * 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; /** * 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; /** * 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; /** * 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; /** * The status of this managed instance group. */ readonly statuses: pulumi.Output; /** * 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; /** * The target number of running instances for this managed * instance group. This value will fight with autoscaler settings when set, and generally shouldn't be set * when using one. If a value is required, such as to specify a creation-time target size for the MIG, * `lifecycle.ignore_changes` can be used to prevent Terraform from modifying the value. Defaults to `0`. */ readonly targetSize: pulumi.Output; /** * The target number of stopped instances for this managed instance group. */ readonly targetStoppedSize: pulumi.Output; /** * The target number of suspended instances for this managed instance group. */ readonly targetSuspendedSize: pulumi.Output; /** * 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; /** * 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; /** * 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; /** * 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; /** * The zone that instances in this group should be created * in. * * - - - */ readonly zone: pulumi.Output; /** * 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; /** * 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; /** * 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; /** * Creation timestamp in RFC3339 text format. */ creationTimestamp?: pulumi.Input; /** * An optional textual description of the instance * group manager. */ description?: pulumi.Input; /** * The fingerprint of the instance group manager. */ fingerprint?: pulumi.Input; /** * The full URL of the instance group created by the manager. */ instanceGroup?: pulumi.Input; /** * The unique identifier number for the resource. This identifier is defined by the server. */ instanceGroupManagerId?: pulumi.Input; /** * The instance lifecycle policy for this managed instance group. */ instanceLifecyclePolicy?: pulumi.Input; /** * 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; /** * 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; /** * The named port configuration. See the section below * for details on configuration. */ namedPorts?: pulumi.Input[]>; operation?: pulumi.Input; /** * ) 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; /** * The ID of the project in which the resource belongs. If it * is not provided, the provider project is used. */ project?: pulumi.Input; /** * Resource policies for this managed instance group. Structure is documented below. * * - - - */ resourcePolicies?: pulumi.Input; /** * The URL of the created resource. */ selfLink?: pulumi.Input; /** * 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; /** * 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[]>; /** * 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[]>; /** * 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[]>; /** * The status of this managed instance group. */ statuses?: pulumi.Input[]>; /** * 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[]>; /** * The target number of running instances for this managed * instance group. This value will fight with autoscaler settings when set, and generally shouldn't be set * when using one. If a value is required, such as to specify a creation-time target size for the MIG, * `lifecycle.ignore_changes` can be used to prevent Terraform from modifying the value. Defaults to `0`. */ targetSize?: pulumi.Input; /** * The target number of stopped instances for this managed instance group. */ targetStoppedSize?: pulumi.Input; /** * The target number of suspended instances for this managed instance group. */ targetSuspendedSize?: pulumi.Input; /** * 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; /** * 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[]>; /** * 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; /** * 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; /** * The zone that instances in this group should be created * in. * * - - - */ zone?: pulumi.Input; } /** * 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; /** * 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; /** * 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; /** * An optional textual description of the instance * group manager. */ description?: pulumi.Input; /** * The instance lifecycle policy for this managed instance group. */ instanceLifecyclePolicy?: pulumi.Input; /** * 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; /** * 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; /** * The named port configuration. See the section below * for details on configuration. */ namedPorts?: pulumi.Input[]>; /** * ) 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; /** * The ID of the project in which the resource belongs. If it * is not provided, the provider project is used. */ project?: pulumi.Input; /** * Resource policies for this managed instance group. Structure is documented below. * * - - - */ resourcePolicies?: pulumi.Input; /** * 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; /** * 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[]>; /** * 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[]>; /** * 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[]>; /** * 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[]>; /** * The target number of running instances for this managed * instance group. This value will fight with autoscaler settings when set, and generally shouldn't be set * when using one. If a value is required, such as to specify a creation-time target size for the MIG, * `lifecycle.ignore_changes` can be used to prevent Terraform from modifying the value. Defaults to `0`. */ targetSize?: pulumi.Input; /** * The target number of stopped instances for this managed instance group. */ targetStoppedSize?: pulumi.Input; /** * The target number of suspended instances for this managed instance group. */ targetSuspendedSize?: pulumi.Input; /** * 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; /** * 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[]>; /** * 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; /** * 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; /** * The zone that instances in this group should be created * in. * * - - - */ zone?: pulumi.Input; }