UNPKG

@pulumi/gcp

Version:

A Pulumi package for creating and managing Google Cloud Platform resources.

166 lines (165 loc) 6.58 kB
import * as pulumi from "@pulumi/pulumi"; /** * Represents the Instance membership to the Instance Group. * * > **NOTE** You can use this resource instead of the `instances` field in the * `gcp.compute.InstanceGroup`, however it's not recommended to use it alongside this field. * It might cause inconsistencies, as they can end up competing over control. * * > **NOTE** This resource has been added to avoid a situation, where after * Instance is recreated, it's removed from Instance Group and it's needed to * perform `apply` twice. To avoid situations like this, please use this resource * with the lifecycle `replaceTriggeredBy` method, with the passed Instance's ID. * * To get more information about InstanceGroupMembership, see: * * * [API documentation](https://cloud.google.com/compute/docs/reference/rest/v1/instanceGroups) * * How-to Guides * * [Add instances](https://cloud.google.com/compute/docs/reference/rest/v1/instanceGroups/addInstances) * * [List instances](https://cloud.google.com/compute/docs/reference/rest/v1/instanceGroups/listInstances) * * [Remove instances](https://cloud.google.com/compute/docs/reference/rest/v1/instanceGroups/removeInstances) * * ## Example Usage * * ### Instance Group Membership * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const default_network = new gcp.compute.Network("default-network", {name: "network"}); * const default_instance = new gcp.compute.Instance("default-instance", { * name: "instance", * machineType: "e2-medium", * bootDisk: { * initializeParams: { * image: "debian-cloud/debian-11", * }, * }, * networkInterfaces: [{ * network: default_network.name, * }], * }); * const default_instance_group = new gcp.compute.InstanceGroup("default-instance-group", {name: "instance-group"}); * const default_ig_membership = new gcp.compute.InstanceGroupMembership("default-ig-membership", { * instance: default_instance.selfLink, * instanceGroup: default_instance_group.name, * }); * ``` * * ## Import * * InstanceGroupMembership can be imported using any of these accepted formats: * * * `projects/{{project}}/zones/{{zone}}/instanceGroups/{{instance_group}}/{{instance}}` * * * `{{project}}/{{zone}}/{{instance_group}}/{{instance}}` * * * `{{zone}}/{{instance_group}}/{{instance}}` * * * `{{instance_group}}/{{instance}}` * * When using the `pulumi import` command, InstanceGroupMembership can be imported using one of the formats above. For example: * * ```sh * $ pulumi import gcp:compute/instanceGroupMembership:InstanceGroupMembership default projects/{{project}}/zones/{{zone}}/instanceGroups/{{instance_group}}/{{instance}} * ``` * * ```sh * $ pulumi import gcp:compute/instanceGroupMembership:InstanceGroupMembership default {{project}}/{{zone}}/{{instance_group}}/{{instance}} * ``` * * ```sh * $ pulumi import gcp:compute/instanceGroupMembership:InstanceGroupMembership default {{zone}}/{{instance_group}}/{{instance}} * ``` * * ```sh * $ pulumi import gcp:compute/instanceGroupMembership:InstanceGroupMembership default {{instance_group}}/{{instance}} * ``` */ export declare class InstanceGroupMembership extends pulumi.CustomResource { /** * Get an existing InstanceGroupMembership 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?: InstanceGroupMembershipState, opts?: pulumi.CustomResourceOptions): InstanceGroupMembership; /** * Returns true if the given object is an instance of InstanceGroupMembership. 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 InstanceGroupMembership; /** * An instance being added to the InstanceGroup */ readonly instance: pulumi.Output<string>; /** * Represents an Instance Group resource name that the instance belongs to. */ readonly instanceGroup: pulumi.Output<string>; /** * 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>; /** * A reference to the zone where the instance group resides. */ readonly zone: pulumi.Output<string | undefined>; /** * Create a InstanceGroupMembership 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: InstanceGroupMembershipArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering InstanceGroupMembership resources. */ export interface InstanceGroupMembershipState { /** * An instance being added to the InstanceGroup */ instance?: pulumi.Input<string>; /** * Represents an Instance Group resource name that the instance belongs to. */ instanceGroup?: pulumi.Input<string>; /** * The ID of the project in which the resource belongs. * If it is not provided, the provider project is used. */ project?: pulumi.Input<string>; /** * A reference to the zone where the instance group resides. */ zone?: pulumi.Input<string>; } /** * The set of arguments for constructing a InstanceGroupMembership resource. */ export interface InstanceGroupMembershipArgs { /** * An instance being added to the InstanceGroup */ instance: pulumi.Input<string>; /** * Represents an Instance Group resource name that the instance belongs to. */ instanceGroup: pulumi.Input<string>; /** * The ID of the project in which the resource belongs. * If it is not provided, the provider project is used. */ project?: pulumi.Input<string>; /** * A reference to the zone where the instance group resides. */ zone?: pulumi.Input<string>; }