Class InstanceGroup
Creates a group of dissimilar Compute Engine virtual machine instances. For more information, see the official documentation and API
Example Usage - Empty instance group
using Pulumi;
using Gcp = Pulumi.Gcp;
class MyStack : Stack
{
public MyStack()
{
var test = new Gcp.Compute.InstanceGroup("test", new Gcp.Compute.InstanceGroupArgs
{
Description = "Test instance group",
Zone = "us-central1-a",
Network = google_compute_network.Default.Id,
});
}
}
Inherited Members
Namespace: Pulumi.Gcp.Compute
Assembly: Pulumi.Gcp.dll
Syntax
public class InstanceGroup : CustomResource
Constructors
View SourceInstanceGroup(String, InstanceGroupArgs, CustomResourceOptions)
Create a InstanceGroup resource with the given unique name, arguments, and options.
Declaration
public InstanceGroup(string name, InstanceGroupArgs args = null, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resource |
| InstanceGroupArgs | args | The arguments used to populate this resource's properties |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Properties
View SourceDescription
An optional textual description of the instance group.
Declaration
public Output<string> Description { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Instances
List of instances in the group. They should be given as self_link URLs. When adding instances they must all be in the same network and zone as the instance group.
Declaration
public Output<ImmutableArray<string>> Instances { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<System.String>> |
Name
The name which the port will be mapped to.
Declaration
public Output<string> Name { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
NamedPorts
The named port configuration. See the section below for details on configuration.
Declaration
public Output<ImmutableArray<InstanceGroupNamedPort>> NamedPorts { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<InstanceGroupNamedPort>> |
Network
The URL of the network the instance group is in. If
this is different from the network where the instances are in, the creation
fails. Defaults to the network where the instances are in (if neither
network nor instances is specified, this field will be blank).
Declaration
public Output<string> Network { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Project
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
Declaration
public Output<string> Project { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
SelfLink
The URI of the created resource.
Declaration
public Output<string> SelfLink { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Size
The number of instances in the group.
Declaration
public Output<int> Size { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Int32> |
Zone
The zone that this instance group should be created in.
Declaration
public Output<string> Zone { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Methods
View SourceGet(String, Input<String>, InstanceGroupState, CustomResourceOptions)
Get an existing InstanceGroup resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
Declaration
public static InstanceGroup Get(string name, Input<string> id, InstanceGroupState state = null, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resulting resource. |
| Input<System.String> | id | The unique provider ID of the resource to lookup. |
| InstanceGroupState | state | Any extra arguments used during the lookup. |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Returns
| Type | Description |
|---|---|
| InstanceGroup |