gcp.compute.PerInstanceConfig
Explore with Pulumi AI
A config defined for a single managed instance that belongs to an instance group manager. It preserves the instance name across instance group manager operations and can define stateful disks or metadata that are unique to the instance.
To get more information about PerInstanceConfig, see:
- API documentation
- How-to Guides
Example Usage
Stateful Igm
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
return await Deployment.RunAsync(() =>
{
var myImage = Gcp.Compute.GetImage.Invoke(new()
{
Family = "debian-11",
Project = "debian-cloud",
});
var igm_basic = new Gcp.Compute.InstanceTemplate("igm-basic", new()
{
MachineType = "e2-medium",
CanIpForward = false,
Tags = new[]
{
"foo",
"bar",
},
Disks = new[]
{
new Gcp.Compute.Inputs.InstanceTemplateDiskArgs
{
SourceImage = myImage.Apply(getImageResult => getImageResult.SelfLink),
AutoDelete = true,
Boot = true,
},
},
NetworkInterfaces = new[]
{
new Gcp.Compute.Inputs.InstanceTemplateNetworkInterfaceArgs
{
Network = "default",
},
},
ServiceAccount = new Gcp.Compute.Inputs.InstanceTemplateServiceAccountArgs
{
Scopes = new[]
{
"userinfo-email",
"compute-ro",
"storage-ro",
},
},
});
var igm_no_tp = new Gcp.Compute.InstanceGroupManager("igm-no-tp", new()
{
Description = "Test instance group manager",
Versions = new[]
{
new Gcp.Compute.Inputs.InstanceGroupManagerVersionArgs
{
Name = "prod",
InstanceTemplate = igm_basic.SelfLink,
},
},
BaseInstanceName = "igm-no-tp",
Zone = "us-central1-c",
TargetSize = 2,
});
var @default = new Gcp.Compute.Disk("default", new()
{
Type = "pd-ssd",
Zone = google_compute_instance_group_manager.Igm.Zone,
Image = "debian-11-bullseye-v20220719",
PhysicalBlockSizeBytes = 4096,
});
var withDisk = new Gcp.Compute.PerInstanceConfig("withDisk", new()
{
Zone = google_compute_instance_group_manager.Igm.Zone,
InstanceGroupManager = google_compute_instance_group_manager.Igm.Name,
PreservedState = new Gcp.Compute.Inputs.PerInstanceConfigPreservedStateArgs
{
Metadata =
{
{ "foo", "bar" },
{ "instance_template", igm_basic.SelfLink },
},
Disks = new[]
{
new Gcp.Compute.Inputs.PerInstanceConfigPreservedStateDiskArgs
{
DeviceName = "my-stateful-disk",
Source = @default.Id,
Mode = "READ_ONLY",
},
},
},
});
});
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
myImage, err := compute.LookupImage(ctx, &compute.LookupImageArgs{
Family: pulumi.StringRef("debian-11"),
Project: pulumi.StringRef("debian-cloud"),
}, nil)
if err != nil {
return err
}
_, err = compute.NewInstanceTemplate(ctx, "igm-basic", &compute.InstanceTemplateArgs{
MachineType: pulumi.String("e2-medium"),
CanIpForward: pulumi.Bool(false),
Tags: pulumi.StringArray{
pulumi.String("foo"),
pulumi.String("bar"),
},
Disks: compute.InstanceTemplateDiskArray{
&compute.InstanceTemplateDiskArgs{
SourceImage: *pulumi.String(myImage.SelfLink),
AutoDelete: pulumi.Bool(true),
Boot: pulumi.Bool(true),
},
},
NetworkInterfaces: compute.InstanceTemplateNetworkInterfaceArray{
&compute.InstanceTemplateNetworkInterfaceArgs{
Network: pulumi.String("default"),
},
},
ServiceAccount: &compute.InstanceTemplateServiceAccountArgs{
Scopes: pulumi.StringArray{
pulumi.String("userinfo-email"),
pulumi.String("compute-ro"),
pulumi.String("storage-ro"),
},
},
})
if err != nil {
return err
}
_, err = compute.NewInstanceGroupManager(ctx, "igm-no-tp", &compute.InstanceGroupManagerArgs{
Description: pulumi.String("Test instance group manager"),
Versions: compute.InstanceGroupManagerVersionArray{
&compute.InstanceGroupManagerVersionArgs{
Name: pulumi.String("prod"),
InstanceTemplate: igm_basic.SelfLink,
},
},
BaseInstanceName: pulumi.String("igm-no-tp"),
Zone: pulumi.String("us-central1-c"),
TargetSize: pulumi.Int(2),
})
if err != nil {
return err
}
_, err = compute.NewDisk(ctx, "default", &compute.DiskArgs{
Type: pulumi.String("pd-ssd"),
Zone: pulumi.Any(google_compute_instance_group_manager.Igm.Zone),
Image: pulumi.String("debian-11-bullseye-v20220719"),
PhysicalBlockSizeBytes: pulumi.Int(4096),
})
if err != nil {
return err
}
_, err = compute.NewPerInstanceConfig(ctx, "withDisk", &compute.PerInstanceConfigArgs{
Zone: pulumi.Any(google_compute_instance_group_manager.Igm.Zone),
InstanceGroupManager: pulumi.Any(google_compute_instance_group_manager.Igm.Name),
PreservedState: &compute.PerInstanceConfigPreservedStateArgs{
Metadata: pulumi.StringMap{
"foo": pulumi.String("bar"),
"instance_template": igm_basic.SelfLink,
},
Disks: compute.PerInstanceConfigPreservedStateDiskArray{
&compute.PerInstanceConfigPreservedStateDiskArgs{
DeviceName: pulumi.String("my-stateful-disk"),
Source: _default.ID(),
Mode: pulumi.String("READ_ONLY"),
},
},
},
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.compute.ComputeFunctions;
import com.pulumi.gcp.compute.inputs.GetImageArgs;
import com.pulumi.gcp.compute.InstanceTemplate;
import com.pulumi.gcp.compute.InstanceTemplateArgs;
import com.pulumi.gcp.compute.inputs.InstanceTemplateDiskArgs;
import com.pulumi.gcp.compute.inputs.InstanceTemplateNetworkInterfaceArgs;
import com.pulumi.gcp.compute.inputs.InstanceTemplateServiceAccountArgs;
import com.pulumi.gcp.compute.InstanceGroupManager;
import com.pulumi.gcp.compute.InstanceGroupManagerArgs;
import com.pulumi.gcp.compute.inputs.InstanceGroupManagerVersionArgs;
import com.pulumi.gcp.compute.Disk;
import com.pulumi.gcp.compute.DiskArgs;
import com.pulumi.gcp.compute.PerInstanceConfig;
import com.pulumi.gcp.compute.PerInstanceConfigArgs;
import com.pulumi.gcp.compute.inputs.PerInstanceConfigPreservedStateArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var myImage = ComputeFunctions.getImage(GetImageArgs.builder()
.family("debian-11")
.project("debian-cloud")
.build());
var igm_basic = new InstanceTemplate("igm-basic", InstanceTemplateArgs.builder()
.machineType("e2-medium")
.canIpForward(false)
.tags(
"foo",
"bar")
.disks(InstanceTemplateDiskArgs.builder()
.sourceImage(myImage.applyValue(getImageResult -> getImageResult.selfLink()))
.autoDelete(true)
.boot(true)
.build())
.networkInterfaces(InstanceTemplateNetworkInterfaceArgs.builder()
.network("default")
.build())
.serviceAccount(InstanceTemplateServiceAccountArgs.builder()
.scopes(
"userinfo-email",
"compute-ro",
"storage-ro")
.build())
.build());
var igm_no_tp = new InstanceGroupManager("igm-no-tp", InstanceGroupManagerArgs.builder()
.description("Test instance group manager")
.versions(InstanceGroupManagerVersionArgs.builder()
.name("prod")
.instanceTemplate(igm_basic.selfLink())
.build())
.baseInstanceName("igm-no-tp")
.zone("us-central1-c")
.targetSize(2)
.build());
var default_ = new Disk("default", DiskArgs.builder()
.type("pd-ssd")
.zone(google_compute_instance_group_manager.igm().zone())
.image("debian-11-bullseye-v20220719")
.physicalBlockSizeBytes(4096)
.build());
var withDisk = new PerInstanceConfig("withDisk", PerInstanceConfigArgs.builder()
.zone(google_compute_instance_group_manager.igm().zone())
.instanceGroupManager(google_compute_instance_group_manager.igm().name())
.preservedState(PerInstanceConfigPreservedStateArgs.builder()
.metadata(Map.ofEntries(
Map.entry("foo", "bar"),
Map.entry("instance_template", igm_basic.selfLink())
))
.disks(PerInstanceConfigPreservedStateDiskArgs.builder()
.deviceName("my-stateful-disk")
.source(default_.id())
.mode("READ_ONLY")
.build())
.build())
.build());
}
}
import pulumi
import pulumi_gcp as gcp
my_image = gcp.compute.get_image(family="debian-11",
project="debian-cloud")
igm_basic = gcp.compute.InstanceTemplate("igm-basic",
machine_type="e2-medium",
can_ip_forward=False,
tags=[
"foo",
"bar",
],
disks=[gcp.compute.InstanceTemplateDiskArgs(
source_image=my_image.self_link,
auto_delete=True,
boot=True,
)],
network_interfaces=[gcp.compute.InstanceTemplateNetworkInterfaceArgs(
network="default",
)],
service_account=gcp.compute.InstanceTemplateServiceAccountArgs(
scopes=[
"userinfo-email",
"compute-ro",
"storage-ro",
],
))
igm_no_tp = gcp.compute.InstanceGroupManager("igm-no-tp",
description="Test instance group manager",
versions=[gcp.compute.InstanceGroupManagerVersionArgs(
name="prod",
instance_template=igm_basic.self_link,
)],
base_instance_name="igm-no-tp",
zone="us-central1-c",
target_size=2)
default = gcp.compute.Disk("default",
type="pd-ssd",
zone=google_compute_instance_group_manager["igm"]["zone"],
image="debian-11-bullseye-v20220719",
physical_block_size_bytes=4096)
with_disk = gcp.compute.PerInstanceConfig("withDisk",
zone=google_compute_instance_group_manager["igm"]["zone"],
instance_group_manager=google_compute_instance_group_manager["igm"]["name"],
preserved_state=gcp.compute.PerInstanceConfigPreservedStateArgs(
metadata={
"foo": "bar",
"instance_template": igm_basic.self_link,
},
disks=[gcp.compute.PerInstanceConfigPreservedStateDiskArgs(
device_name="my-stateful-disk",
source=default.id,
mode="READ_ONLY",
)],
))
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const myImage = gcp.compute.getImage({
family: "debian-11",
project: "debian-cloud",
});
const igm_basic = new gcp.compute.InstanceTemplate("igm-basic", {
machineType: "e2-medium",
canIpForward: false,
tags: [
"foo",
"bar",
],
disks: [{
sourceImage: myImage.then(myImage => myImage.selfLink),
autoDelete: true,
boot: true,
}],
networkInterfaces: [{
network: "default",
}],
serviceAccount: {
scopes: [
"userinfo-email",
"compute-ro",
"storage-ro",
],
},
});
const igm_no_tp = new gcp.compute.InstanceGroupManager("igm-no-tp", {
description: "Test instance group manager",
versions: [{
name: "prod",
instanceTemplate: igm_basic.selfLink,
}],
baseInstanceName: "igm-no-tp",
zone: "us-central1-c",
targetSize: 2,
});
const _default = new gcp.compute.Disk("default", {
type: "pd-ssd",
zone: google_compute_instance_group_manager.igm.zone,
image: "debian-11-bullseye-v20220719",
physicalBlockSizeBytes: 4096,
});
const withDisk = new gcp.compute.PerInstanceConfig("withDisk", {
zone: google_compute_instance_group_manager.igm.zone,
instanceGroupManager: google_compute_instance_group_manager.igm.name,
preservedState: {
metadata: {
foo: "bar",
instance_template: igm_basic.selfLink,
},
disks: [{
deviceName: "my-stateful-disk",
source: _default.id,
mode: "READ_ONLY",
}],
},
});
resources:
igm-basic:
type: gcp:compute:InstanceTemplate
properties:
machineType: e2-medium
canIpForward: false
tags:
- foo
- bar
disks:
- sourceImage: ${myImage.selfLink}
autoDelete: true
boot: true
networkInterfaces:
- network: default
serviceAccount:
scopes:
- userinfo-email
- compute-ro
- storage-ro
igm-no-tp:
type: gcp:compute:InstanceGroupManager
properties:
description: Test instance group manager
versions:
- name: prod
instanceTemplate: ${["igm-basic"].selfLink}
baseInstanceName: igm-no-tp
zone: us-central1-c
targetSize: 2
default:
type: gcp:compute:Disk
properties:
type: pd-ssd
zone: ${google_compute_instance_group_manager.igm.zone}
image: debian-11-bullseye-v20220719
physicalBlockSizeBytes: 4096
withDisk:
type: gcp:compute:PerInstanceConfig
properties:
zone: ${google_compute_instance_group_manager.igm.zone}
instanceGroupManager: ${google_compute_instance_group_manager.igm.name}
preservedState:
metadata:
foo: bar
instance_template: ${["igm-basic"].selfLink}
disks:
- deviceName: my-stateful-disk
source: ${default.id}
mode: READ_ONLY
variables:
myImage:
fn::invoke:
Function: gcp:compute:getImage
Arguments:
family: debian-11
project: debian-cloud
Create PerInstanceConfig Resource
new PerInstanceConfig(name: string, args: PerInstanceConfigArgs, opts?: CustomResourceOptions);
@overload
def PerInstanceConfig(resource_name: str,
opts: Optional[ResourceOptions] = None,
instance_group_manager: Optional[str] = None,
minimal_action: Optional[str] = None,
most_disruptive_allowed_action: Optional[str] = None,
name: Optional[str] = None,
preserved_state: Optional[PerInstanceConfigPreservedStateArgs] = None,
project: Optional[str] = None,
remove_instance_state_on_destroy: Optional[bool] = None,
zone: Optional[str] = None)
@overload
def PerInstanceConfig(resource_name: str,
args: PerInstanceConfigArgs,
opts: Optional[ResourceOptions] = None)
func NewPerInstanceConfig(ctx *Context, name string, args PerInstanceConfigArgs, opts ...ResourceOption) (*PerInstanceConfig, error)
public PerInstanceConfig(string name, PerInstanceConfigArgs args, CustomResourceOptions? opts = null)
public PerInstanceConfig(String name, PerInstanceConfigArgs args)
public PerInstanceConfig(String name, PerInstanceConfigArgs args, CustomResourceOptions options)
type: gcp:compute:PerInstanceConfig
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args PerInstanceConfigArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args PerInstanceConfigArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args PerInstanceConfigArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args PerInstanceConfigArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args PerInstanceConfigArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
PerInstanceConfig Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The PerInstanceConfig resource accepts the following input properties:
- Instance
Group stringManager The instance group manager this instance config is part of.
- Minimal
Action string The minimal action to perform on the instance during an update. Default is
NONE
. Possible values are:- REPLACE
- RESTART
- REFRESH
- NONE
- Most
Disruptive stringAllowed Action The most disruptive action to perform on the instance during an update. Default is
REPLACE
. Possible values are:- REPLACE
- RESTART
- REFRESH
- NONE
- Name string
The name for this per-instance config and its corresponding instance.
- Preserved
State PerInstance Config Preserved State The preserved state for this instance. Structure is documented below.
- Project string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- Remove
Instance boolState On Destroy When true, deleting this config will immediately remove any specified state from the underlying instance. When false, deleting this config will not immediately remove any state from the underlying instance. State will be removed on the next instance recreation or update.
- Zone string
Zone where the containing instance group manager is located
- Instance
Group stringManager The instance group manager this instance config is part of.
- Minimal
Action string The minimal action to perform on the instance during an update. Default is
NONE
. Possible values are:- REPLACE
- RESTART
- REFRESH
- NONE
- Most
Disruptive stringAllowed Action The most disruptive action to perform on the instance during an update. Default is
REPLACE
. Possible values are:- REPLACE
- RESTART
- REFRESH
- NONE
- Name string
The name for this per-instance config and its corresponding instance.
- Preserved
State PerInstance Config Preserved State Args The preserved state for this instance. Structure is documented below.
- Project string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- Remove
Instance boolState On Destroy When true, deleting this config will immediately remove any specified state from the underlying instance. When false, deleting this config will not immediately remove any state from the underlying instance. State will be removed on the next instance recreation or update.
- Zone string
Zone where the containing instance group manager is located
- instance
Group StringManager The instance group manager this instance config is part of.
- minimal
Action String The minimal action to perform on the instance during an update. Default is
NONE
. Possible values are:- REPLACE
- RESTART
- REFRESH
- NONE
- most
Disruptive StringAllowed Action The most disruptive action to perform on the instance during an update. Default is
REPLACE
. Possible values are:- REPLACE
- RESTART
- REFRESH
- NONE
- name String
The name for this per-instance config and its corresponding instance.
- preserved
State PerInstance Config Preserved State The preserved state for this instance. Structure is documented below.
- project String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- remove
Instance BooleanState On Destroy When true, deleting this config will immediately remove any specified state from the underlying instance. When false, deleting this config will not immediately remove any state from the underlying instance. State will be removed on the next instance recreation or update.
- zone String
Zone where the containing instance group manager is located
- instance
Group stringManager The instance group manager this instance config is part of.
- minimal
Action string The minimal action to perform on the instance during an update. Default is
NONE
. Possible values are:- REPLACE
- RESTART
- REFRESH
- NONE
- most
Disruptive stringAllowed Action The most disruptive action to perform on the instance during an update. Default is
REPLACE
. Possible values are:- REPLACE
- RESTART
- REFRESH
- NONE
- name string
The name for this per-instance config and its corresponding instance.
- preserved
State PerInstance Config Preserved State The preserved state for this instance. Structure is documented below.
- project string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- remove
Instance booleanState On Destroy When true, deleting this config will immediately remove any specified state from the underlying instance. When false, deleting this config will not immediately remove any state from the underlying instance. State will be removed on the next instance recreation or update.
- zone string
Zone where the containing instance group manager is located
- instance_
group_ strmanager The instance group manager this instance config is part of.
- minimal_
action str The minimal action to perform on the instance during an update. Default is
NONE
. Possible values are:- REPLACE
- RESTART
- REFRESH
- NONE
- most_
disruptive_ strallowed_ action The most disruptive action to perform on the instance during an update. Default is
REPLACE
. Possible values are:- REPLACE
- RESTART
- REFRESH
- NONE
- name str
The name for this per-instance config and its corresponding instance.
- preserved_
state PerInstance Config Preserved State Args The preserved state for this instance. Structure is documented below.
- project str
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- remove_
instance_ boolstate_ on_ destroy When true, deleting this config will immediately remove any specified state from the underlying instance. When false, deleting this config will not immediately remove any state from the underlying instance. State will be removed on the next instance recreation or update.
- zone str
Zone where the containing instance group manager is located
- instance
Group StringManager The instance group manager this instance config is part of.
- minimal
Action String The minimal action to perform on the instance during an update. Default is
NONE
. Possible values are:- REPLACE
- RESTART
- REFRESH
- NONE
- most
Disruptive StringAllowed Action The most disruptive action to perform on the instance during an update. Default is
REPLACE
. Possible values are:- REPLACE
- RESTART
- REFRESH
- NONE
- name String
The name for this per-instance config and its corresponding instance.
- preserved
State Property Map The preserved state for this instance. Structure is documented below.
- project String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- remove
Instance BooleanState On Destroy When true, deleting this config will immediately remove any specified state from the underlying instance. When false, deleting this config will not immediately remove any state from the underlying instance. State will be removed on the next instance recreation or update.
- zone String
Zone where the containing instance group manager is located
Outputs
All input properties are implicitly available as output properties. Additionally, the PerInstanceConfig resource produces the following output properties:
- Id string
The provider-assigned unique ID for this managed resource.
- Id string
The provider-assigned unique ID for this managed resource.
- id String
The provider-assigned unique ID for this managed resource.
- id string
The provider-assigned unique ID for this managed resource.
- id str
The provider-assigned unique ID for this managed resource.
- id String
The provider-assigned unique ID for this managed resource.
Look up Existing PerInstanceConfig Resource
Get an existing PerInstanceConfig resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: PerInstanceConfigState, opts?: CustomResourceOptions): PerInstanceConfig
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
instance_group_manager: Optional[str] = None,
minimal_action: Optional[str] = None,
most_disruptive_allowed_action: Optional[str] = None,
name: Optional[str] = None,
preserved_state: Optional[PerInstanceConfigPreservedStateArgs] = None,
project: Optional[str] = None,
remove_instance_state_on_destroy: Optional[bool] = None,
zone: Optional[str] = None) -> PerInstanceConfig
func GetPerInstanceConfig(ctx *Context, name string, id IDInput, state *PerInstanceConfigState, opts ...ResourceOption) (*PerInstanceConfig, error)
public static PerInstanceConfig Get(string name, Input<string> id, PerInstanceConfigState? state, CustomResourceOptions? opts = null)
public static PerInstanceConfig get(String name, Output<String> id, PerInstanceConfigState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Instance
Group stringManager The instance group manager this instance config is part of.
- Minimal
Action string The minimal action to perform on the instance during an update. Default is
NONE
. Possible values are:- REPLACE
- RESTART
- REFRESH
- NONE
- Most
Disruptive stringAllowed Action The most disruptive action to perform on the instance during an update. Default is
REPLACE
. Possible values are:- REPLACE
- RESTART
- REFRESH
- NONE
- Name string
The name for this per-instance config and its corresponding instance.
- Preserved
State PerInstance Config Preserved State The preserved state for this instance. Structure is documented below.
- Project string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- Remove
Instance boolState On Destroy When true, deleting this config will immediately remove any specified state from the underlying instance. When false, deleting this config will not immediately remove any state from the underlying instance. State will be removed on the next instance recreation or update.
- Zone string
Zone where the containing instance group manager is located
- Instance
Group stringManager The instance group manager this instance config is part of.
- Minimal
Action string The minimal action to perform on the instance during an update. Default is
NONE
. Possible values are:- REPLACE
- RESTART
- REFRESH
- NONE
- Most
Disruptive stringAllowed Action The most disruptive action to perform on the instance during an update. Default is
REPLACE
. Possible values are:- REPLACE
- RESTART
- REFRESH
- NONE
- Name string
The name for this per-instance config and its corresponding instance.
- Preserved
State PerInstance Config Preserved State Args The preserved state for this instance. Structure is documented below.
- Project string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- Remove
Instance boolState On Destroy When true, deleting this config will immediately remove any specified state from the underlying instance. When false, deleting this config will not immediately remove any state from the underlying instance. State will be removed on the next instance recreation or update.
- Zone string
Zone where the containing instance group manager is located
- instance
Group StringManager The instance group manager this instance config is part of.
- minimal
Action String The minimal action to perform on the instance during an update. Default is
NONE
. Possible values are:- REPLACE
- RESTART
- REFRESH
- NONE
- most
Disruptive StringAllowed Action The most disruptive action to perform on the instance during an update. Default is
REPLACE
. Possible values are:- REPLACE
- RESTART
- REFRESH
- NONE
- name String
The name for this per-instance config and its corresponding instance.
- preserved
State PerInstance Config Preserved State The preserved state for this instance. Structure is documented below.
- project String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- remove
Instance BooleanState On Destroy When true, deleting this config will immediately remove any specified state from the underlying instance. When false, deleting this config will not immediately remove any state from the underlying instance. State will be removed on the next instance recreation or update.
- zone String
Zone where the containing instance group manager is located
- instance
Group stringManager The instance group manager this instance config is part of.
- minimal
Action string The minimal action to perform on the instance during an update. Default is
NONE
. Possible values are:- REPLACE
- RESTART
- REFRESH
- NONE
- most
Disruptive stringAllowed Action The most disruptive action to perform on the instance during an update. Default is
REPLACE
. Possible values are:- REPLACE
- RESTART
- REFRESH
- NONE
- name string
The name for this per-instance config and its corresponding instance.
- preserved
State PerInstance Config Preserved State The preserved state for this instance. Structure is documented below.
- project string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- remove
Instance booleanState On Destroy When true, deleting this config will immediately remove any specified state from the underlying instance. When false, deleting this config will not immediately remove any state from the underlying instance. State will be removed on the next instance recreation or update.
- zone string
Zone where the containing instance group manager is located
- instance_
group_ strmanager The instance group manager this instance config is part of.
- minimal_
action str The minimal action to perform on the instance during an update. Default is
NONE
. Possible values are:- REPLACE
- RESTART
- REFRESH
- NONE
- most_
disruptive_ strallowed_ action The most disruptive action to perform on the instance during an update. Default is
REPLACE
. Possible values are:- REPLACE
- RESTART
- REFRESH
- NONE
- name str
The name for this per-instance config and its corresponding instance.
- preserved_
state PerInstance Config Preserved State Args The preserved state for this instance. Structure is documented below.
- project str
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- remove_
instance_ boolstate_ on_ destroy When true, deleting this config will immediately remove any specified state from the underlying instance. When false, deleting this config will not immediately remove any state from the underlying instance. State will be removed on the next instance recreation or update.
- zone str
Zone where the containing instance group manager is located
- instance
Group StringManager The instance group manager this instance config is part of.
- minimal
Action String The minimal action to perform on the instance during an update. Default is
NONE
. Possible values are:- REPLACE
- RESTART
- REFRESH
- NONE
- most
Disruptive StringAllowed Action The most disruptive action to perform on the instance during an update. Default is
REPLACE
. Possible values are:- REPLACE
- RESTART
- REFRESH
- NONE
- name String
The name for this per-instance config and its corresponding instance.
- preserved
State Property Map The preserved state for this instance. Structure is documented below.
- project String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- remove
Instance BooleanState On Destroy When true, deleting this config will immediately remove any specified state from the underlying instance. When false, deleting this config will not immediately remove any state from the underlying instance. State will be removed on the next instance recreation or update.
- zone String
Zone where the containing instance group manager is located
Supporting Types
PerInstanceConfigPreservedState, PerInstanceConfigPreservedStateArgs
- Disks
List<Per
Instance Config Preserved State Disk> Stateful disks for the instance. Structure is documented below.
- External
Ips List<PerInstance Config Preserved State External Ip> Preserved external IPs defined for this instance. This map is keyed with the name of the network interface. Structure is documented below.
- Internal
Ips List<PerInstance Config Preserved State Internal Ip> Preserved internal IPs defined for this instance. This map is keyed with the name of the network interface. Structure is documented below.
- Metadata Dictionary<string, string>
Preserved metadata defined for this instance. This is a list of key->value pairs.
- Disks
[]Per
Instance Config Preserved State Disk Stateful disks for the instance. Structure is documented below.
- External
Ips []PerInstance Config Preserved State External Ip Preserved external IPs defined for this instance. This map is keyed with the name of the network interface. Structure is documented below.
- Internal
Ips []PerInstance Config Preserved State Internal Ip Preserved internal IPs defined for this instance. This map is keyed with the name of the network interface. Structure is documented below.
- Metadata map[string]string
Preserved metadata defined for this instance. This is a list of key->value pairs.
- disks
List<Per
Instance Config Preserved State Disk> Stateful disks for the instance. Structure is documented below.
- external
Ips List<PerInstance Config Preserved State External Ip> Preserved external IPs defined for this instance. This map is keyed with the name of the network interface. Structure is documented below.
- internal
Ips List<PerInstance Config Preserved State Internal Ip> Preserved internal IPs defined for this instance. This map is keyed with the name of the network interface. Structure is documented below.
- metadata Map<String,String>
Preserved metadata defined for this instance. This is a list of key->value pairs.
- disks
Per
Instance Config Preserved State Disk[] Stateful disks for the instance. Structure is documented below.
- external
Ips PerInstance Config Preserved State External Ip[] Preserved external IPs defined for this instance. This map is keyed with the name of the network interface. Structure is documented below.
- internal
Ips PerInstance Config Preserved State Internal Ip[] Preserved internal IPs defined for this instance. This map is keyed with the name of the network interface. Structure is documented below.
- metadata {[key: string]: string}
Preserved metadata defined for this instance. This is a list of key->value pairs.
- disks
Sequence[Per
Instance Config Preserved State Disk] Stateful disks for the instance. Structure is documented below.
- external_
ips Sequence[PerInstance Config Preserved State External Ip] Preserved external IPs defined for this instance. This map is keyed with the name of the network interface. Structure is documented below.
- internal_
ips Sequence[PerInstance Config Preserved State Internal Ip] Preserved internal IPs defined for this instance. This map is keyed with the name of the network interface. Structure is documented below.
- metadata Mapping[str, str]
Preserved metadata defined for this instance. This is a list of key->value pairs.
- disks List<Property Map>
Stateful disks for the instance. Structure is documented below.
- external
Ips List<Property Map> Preserved external IPs defined for this instance. This map is keyed with the name of the network interface. Structure is documented below.
- internal
Ips List<Property Map> Preserved internal IPs defined for this instance. This map is keyed with the name of the network interface. Structure is documented below.
- metadata Map<String>
Preserved metadata defined for this instance. This is a list of key->value pairs.
PerInstanceConfigPreservedStateDisk, PerInstanceConfigPreservedStateDiskArgs
- Device
Name string A unique device name that is reflected into the /dev/ tree of a Linux operating system running within the instance.
- Source string
The URI of an existing persistent disk to attach under the specified device-name in the format
projects/project-id/zones/zone/disks/disk-name
.- Delete
Rule string A value that prescribes what should happen to the stateful disk when the VM instance is deleted. The available options are
NEVER
andON_PERMANENT_INSTANCE_DELETION
.NEVER
- detach the disk when the VM is deleted, but do not delete the disk.ON_PERMANENT_INSTANCE_DELETION
will delete the stateful disk when the VM is permanently deleted from the instance group. Default value isNEVER
. Possible values are:NEVER
,ON_PERMANENT_INSTANCE_DELETION
.- Mode string
The mode of the disk. Default value is
READ_WRITE
. Possible values are:READ_ONLY
,READ_WRITE
.
- Device
Name string A unique device name that is reflected into the /dev/ tree of a Linux operating system running within the instance.
- Source string
The URI of an existing persistent disk to attach under the specified device-name in the format
projects/project-id/zones/zone/disks/disk-name
.- Delete
Rule string A value that prescribes what should happen to the stateful disk when the VM instance is deleted. The available options are
NEVER
andON_PERMANENT_INSTANCE_DELETION
.NEVER
- detach the disk when the VM is deleted, but do not delete the disk.ON_PERMANENT_INSTANCE_DELETION
will delete the stateful disk when the VM is permanently deleted from the instance group. Default value isNEVER
. Possible values are:NEVER
,ON_PERMANENT_INSTANCE_DELETION
.- Mode string
The mode of the disk. Default value is
READ_WRITE
. Possible values are:READ_ONLY
,READ_WRITE
.
- device
Name String A unique device name that is reflected into the /dev/ tree of a Linux operating system running within the instance.
- source String
The URI of an existing persistent disk to attach under the specified device-name in the format
projects/project-id/zones/zone/disks/disk-name
.- delete
Rule String A value that prescribes what should happen to the stateful disk when the VM instance is deleted. The available options are
NEVER
andON_PERMANENT_INSTANCE_DELETION
.NEVER
- detach the disk when the VM is deleted, but do not delete the disk.ON_PERMANENT_INSTANCE_DELETION
will delete the stateful disk when the VM is permanently deleted from the instance group. Default value isNEVER
. Possible values are:NEVER
,ON_PERMANENT_INSTANCE_DELETION
.- mode String
The mode of the disk. Default value is
READ_WRITE
. Possible values are:READ_ONLY
,READ_WRITE
.
- device
Name string A unique device name that is reflected into the /dev/ tree of a Linux operating system running within the instance.
- source string
The URI of an existing persistent disk to attach under the specified device-name in the format
projects/project-id/zones/zone/disks/disk-name
.- delete
Rule string A value that prescribes what should happen to the stateful disk when the VM instance is deleted. The available options are
NEVER
andON_PERMANENT_INSTANCE_DELETION
.NEVER
- detach the disk when the VM is deleted, but do not delete the disk.ON_PERMANENT_INSTANCE_DELETION
will delete the stateful disk when the VM is permanently deleted from the instance group. Default value isNEVER
. Possible values are:NEVER
,ON_PERMANENT_INSTANCE_DELETION
.- mode string
The mode of the disk. Default value is
READ_WRITE
. Possible values are:READ_ONLY
,READ_WRITE
.
- device_
name str A unique device name that is reflected into the /dev/ tree of a Linux operating system running within the instance.
- source str
The URI of an existing persistent disk to attach under the specified device-name in the format
projects/project-id/zones/zone/disks/disk-name
.- delete_
rule str A value that prescribes what should happen to the stateful disk when the VM instance is deleted. The available options are
NEVER
andON_PERMANENT_INSTANCE_DELETION
.NEVER
- detach the disk when the VM is deleted, but do not delete the disk.ON_PERMANENT_INSTANCE_DELETION
will delete the stateful disk when the VM is permanently deleted from the instance group. Default value isNEVER
. Possible values are:NEVER
,ON_PERMANENT_INSTANCE_DELETION
.- mode str
The mode of the disk. Default value is
READ_WRITE
. Possible values are:READ_ONLY
,READ_WRITE
.
- device
Name String A unique device name that is reflected into the /dev/ tree of a Linux operating system running within the instance.
- source String
The URI of an existing persistent disk to attach under the specified device-name in the format
projects/project-id/zones/zone/disks/disk-name
.- delete
Rule String A value that prescribes what should happen to the stateful disk when the VM instance is deleted. The available options are
NEVER
andON_PERMANENT_INSTANCE_DELETION
.NEVER
- detach the disk when the VM is deleted, but do not delete the disk.ON_PERMANENT_INSTANCE_DELETION
will delete the stateful disk when the VM is permanently deleted from the instance group. Default value isNEVER
. Possible values are:NEVER
,ON_PERMANENT_INSTANCE_DELETION
.- mode String
The mode of the disk. Default value is
READ_WRITE
. Possible values are:READ_ONLY
,READ_WRITE
.
PerInstanceConfigPreservedStateExternalIp, PerInstanceConfigPreservedStateExternalIpArgs
- Interface
Name string The identifier for this object. Format specified above.
- Auto
Delete string These stateful IPs will never be released during autohealing, update or VM instance recreate operations. This flag is used to configure if the IP reservation should be deleted after it is no longer used by the group, e.g. when the given instance or the whole group is deleted. Default value is
NEVER
. Possible values are:NEVER
,ON_PERMANENT_INSTANCE_DELETION
.- Ip
Address PerInstance Config Preserved State External Ip Ip Address Ip address representation Structure is documented below.
- Interface
Name string The identifier for this object. Format specified above.
- Auto
Delete string These stateful IPs will never be released during autohealing, update or VM instance recreate operations. This flag is used to configure if the IP reservation should be deleted after it is no longer used by the group, e.g. when the given instance or the whole group is deleted. Default value is
NEVER
. Possible values are:NEVER
,ON_PERMANENT_INSTANCE_DELETION
.- Ip
Address PerInstance Config Preserved State External Ip Ip Address Ip address representation Structure is documented below.
- interface
Name String The identifier for this object. Format specified above.
- auto
Delete String These stateful IPs will never be released during autohealing, update or VM instance recreate operations. This flag is used to configure if the IP reservation should be deleted after it is no longer used by the group, e.g. when the given instance or the whole group is deleted. Default value is
NEVER
. Possible values are:NEVER
,ON_PERMANENT_INSTANCE_DELETION
.- ip
Address PerInstance Config Preserved State External Ip Ip Address Ip address representation Structure is documented below.
- interface
Name string The identifier for this object. Format specified above.
- auto
Delete string These stateful IPs will never be released during autohealing, update or VM instance recreate operations. This flag is used to configure if the IP reservation should be deleted after it is no longer used by the group, e.g. when the given instance or the whole group is deleted. Default value is
NEVER
. Possible values are:NEVER
,ON_PERMANENT_INSTANCE_DELETION
.- ip
Address PerInstance Config Preserved State External Ip Ip Address Ip address representation Structure is documented below.
- interface_
name str The identifier for this object. Format specified above.
- auto_
delete str These stateful IPs will never be released during autohealing, update or VM instance recreate operations. This flag is used to configure if the IP reservation should be deleted after it is no longer used by the group, e.g. when the given instance or the whole group is deleted. Default value is
NEVER
. Possible values are:NEVER
,ON_PERMANENT_INSTANCE_DELETION
.- ip_
address PerInstance Config Preserved State External Ip Ip Address Ip address representation Structure is documented below.
- interface
Name String The identifier for this object. Format specified above.
- auto
Delete String These stateful IPs will never be released during autohealing, update or VM instance recreate operations. This flag is used to configure if the IP reservation should be deleted after it is no longer used by the group, e.g. when the given instance or the whole group is deleted. Default value is
NEVER
. Possible values are:NEVER
,ON_PERMANENT_INSTANCE_DELETION
.- ip
Address Property Map Ip address representation Structure is documented below.
PerInstanceConfigPreservedStateExternalIpIpAddress, PerInstanceConfigPreservedStateExternalIpIpAddressArgs
- Address string
The URL of the reservation for this IP address.
- Address string
The URL of the reservation for this IP address.
- address String
The URL of the reservation for this IP address.
- address string
The URL of the reservation for this IP address.
- address str
The URL of the reservation for this IP address.
- address String
The URL of the reservation for this IP address.
PerInstanceConfigPreservedStateInternalIp, PerInstanceConfigPreservedStateInternalIpArgs
- Interface
Name string The identifier for this object. Format specified above.
- Auto
Delete string These stateful IPs will never be released during autohealing, update or VM instance recreate operations. This flag is used to configure if the IP reservation should be deleted after it is no longer used by the group, e.g. when the given instance or the whole group is deleted. Default value is
NEVER
. Possible values are:NEVER
,ON_PERMANENT_INSTANCE_DELETION
.- Ip
Address PerInstance Config Preserved State Internal Ip Ip Address Ip address representation Structure is documented below.
- Interface
Name string The identifier for this object. Format specified above.
- Auto
Delete string These stateful IPs will never be released during autohealing, update or VM instance recreate operations. This flag is used to configure if the IP reservation should be deleted after it is no longer used by the group, e.g. when the given instance or the whole group is deleted. Default value is
NEVER
. Possible values are:NEVER
,ON_PERMANENT_INSTANCE_DELETION
.- Ip
Address PerInstance Config Preserved State Internal Ip Ip Address Ip address representation Structure is documented below.
- interface
Name String The identifier for this object. Format specified above.
- auto
Delete String These stateful IPs will never be released during autohealing, update or VM instance recreate operations. This flag is used to configure if the IP reservation should be deleted after it is no longer used by the group, e.g. when the given instance or the whole group is deleted. Default value is
NEVER
. Possible values are:NEVER
,ON_PERMANENT_INSTANCE_DELETION
.- ip
Address PerInstance Config Preserved State Internal Ip Ip Address Ip address representation Structure is documented below.
- interface
Name string The identifier for this object. Format specified above.
- auto
Delete string These stateful IPs will never be released during autohealing, update or VM instance recreate operations. This flag is used to configure if the IP reservation should be deleted after it is no longer used by the group, e.g. when the given instance or the whole group is deleted. Default value is
NEVER
. Possible values are:NEVER
,ON_PERMANENT_INSTANCE_DELETION
.- ip
Address PerInstance Config Preserved State Internal Ip Ip Address Ip address representation Structure is documented below.
- interface_
name str The identifier for this object. Format specified above.
- auto_
delete str These stateful IPs will never be released during autohealing, update or VM instance recreate operations. This flag is used to configure if the IP reservation should be deleted after it is no longer used by the group, e.g. when the given instance or the whole group is deleted. Default value is
NEVER
. Possible values are:NEVER
,ON_PERMANENT_INSTANCE_DELETION
.- ip_
address PerInstance Config Preserved State Internal Ip Ip Address Ip address representation Structure is documented below.
- interface
Name String The identifier for this object. Format specified above.
- auto
Delete String These stateful IPs will never be released during autohealing, update or VM instance recreate operations. This flag is used to configure if the IP reservation should be deleted after it is no longer used by the group, e.g. when the given instance or the whole group is deleted. Default value is
NEVER
. Possible values are:NEVER
,ON_PERMANENT_INSTANCE_DELETION
.- ip
Address Property Map Ip address representation Structure is documented below.
PerInstanceConfigPreservedStateInternalIpIpAddress, PerInstanceConfigPreservedStateInternalIpIpAddressArgs
- Address string
The URL of the reservation for this IP address.
- Address string
The URL of the reservation for this IP address.
- address String
The URL of the reservation for this IP address.
- address string
The URL of the reservation for this IP address.
- address str
The URL of the reservation for this IP address.
- address String
The URL of the reservation for this IP address.
Import
PerInstanceConfig can be imported using any of these accepted formats* projects/{{project}}/zones/{{zone}}/instanceGroupManagers/{{instance_group_manager}}/{{name}}
* {{project}}/{{zone}}/{{instance_group_manager}}/{{name}}
* {{zone}}/{{instance_group_manager}}/{{name}}
* {{instance_group_manager}}/{{name}}
In Terraform v1.5.0 and later, use an import
block to import PerInstanceConfig using one of the formats above. For exampletf import {
id = “projects/{{project}}/zones/{{zone}}/instanceGroupManagers/{{instance_group_manager}}/{{name}}”
to = google_compute_per_instance_config.default }
$ pulumi import gcp:compute/perInstanceConfig:PerInstanceConfig When using the [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import), PerInstanceConfig can be imported using one of the formats above. For example
$ pulumi import gcp:compute/perInstanceConfig:PerInstanceConfig default projects/{{project}}/zones/{{zone}}/instanceGroupManagers/{{instance_group_manager}}/{{name}}
$ pulumi import gcp:compute/perInstanceConfig:PerInstanceConfig default {{project}}/{{zone}}/{{instance_group_manager}}/{{name}}
$ pulumi import gcp:compute/perInstanceConfig:PerInstanceConfig default {{zone}}/{{instance_group_manager}}/{{name}}
$ pulumi import gcp:compute/perInstanceConfig:PerInstanceConfig default {{instance_group_manager}}/{{name}}
Package Details
- Repository
- Google Cloud (GCP) Classic pulumi/pulumi-gcp
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
google-beta
Terraform Provider.