pulumi_wasm_providers_gcp_mini::compute

Module instance_group

source
Expand description

Creates a group of dissimilar Compute Engine virtual machine instances. For more information, see the official documentation and API

§Example Usage

§Empty Instance Group

use pulumi_wasm_rust::Output;
use pulumi_wasm_rust::{add_export, pulumi_main};
#[pulumi_main]
fn test_main() -> Result<(), Error> {
    let test = instance_group::create(
        "test",
        InstanceGroupArgs::builder()
            .description("Test instance group")
            .name("test")
            .network("${default.id}")
            .zone("us-central1-a")
            .build_struct(),
    );
}

§Example Usage - With instances and named ports

resources:
  webservers:
    type: gcp:compute:InstanceGroup
    properties:
      name: webservers
      description: Test instance group
      instances:
        - ${test.id}
        - ${test2.id}
      namedPorts:
        - name: http
          port: '8080'
        - name: https
          port: '8443'
      zone: us-central1-a

§Import

Instance groups can be imported using the zone and name with an optional project, e.g.

  • projects/{{project_id}}/zones/{{zone}}/instanceGroups/{{instance_group_id}}

  • {{project_id}}/{{zone}}/{{instance_group_id}}

  • {{zone}}/{{instance_group_id}}

When using the pulumi import command, instance groups can be imported using one of the formats above. For example:

$ pulumi import gcp:compute/instanceGroup:InstanceGroup default {{zone}}/{{instance_group_id}}
$ pulumi import gcp:compute/instanceGroup:InstanceGroup default {{project_id}}/{{zone}}/{{instance_group_id}}
$ pulumi import gcp:compute/instanceGroup:InstanceGroup default projects/{{project_id}}/zones/{{zone}}/instanceGroups/{{instance_group_id}}

Structs§

Functions§

  • Registers a new resource with the given unique name and arguments