Expand description
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
resources:
igm-basic:
type: gcp:compute:InstanceTemplate
properties:
name: my-template
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
name: my-igm
versions:
- name: prod
instanceTemplate: ${["igm-basic"].selfLink}
baseInstanceName: igm-no-tp
zone: us-central1-c
targetSize: 2
default:
type: gcp:compute:Disk
properties:
name: my-disk-name
type: pd-ssd
zone: ${igm.zone}
image: debian-11-bullseye-v20220719
physicalBlockSizeBytes: 4096
withDisk:
type: gcp:compute:PerInstanceConfig
name: with_disk
properties:
zone: ${igm.zone}
instanceGroupManager: ${igm.name}
name: instance-1
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
§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}}
When using the pulumi import
command, 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}}
Structs§
- Use builder syntax to set the inputs and finish with
build_struct()
.
Functions§
- Registers a new resource with the given unique name and arguments