/
instanceTemplate.ts
601 lines (592 loc) · 28.7 KB
/
instanceTemplate.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
import * as pulumi from "@pulumi/pulumi";
import * as utilities from "../utilities";
/**
* Manages a VM instance template resource within GCE. For more information see
* [the official documentation](https://cloud.google.com/compute/docs/instance-templates)
* and
* [API](https://cloud.google.com/compute/docs/reference/latest/instanceTemplates).
*
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const myImage = pulumi.output(gcp.compute.getImage({
* family: "debian-9",
* project: "debian-cloud",
* }));
* const foobar = new gcp.compute.Disk("foobar", {
* image: myImage.selfLink,
* size: 10,
* type: "pd-ssd",
* zone: "us-central1-a",
* });
* const defaultInstanceTemplate = new gcp.compute.InstanceTemplate("default", {
* canIpForward: false,
* description: "This template is used to create app server instances.",
* disks: [
* // Create a new boot disk from an image
* {
* autoDelete: true,
* boot: true,
* sourceImage: "debian-cloud/debian-9",
* },
* // Use an existing disk resource
* {
* autoDelete: false,
* boot: false,
* // Instance Templates reference disks by name, not self link
* source: foobar.name,
* },
* ],
* instanceDescription: "description assigned to instances",
* labels: {
* environment: "dev",
* },
* machineType: "n1-standard-1",
* metadata: {
* foo: "bar",
* },
* networkInterfaces: [{
* network: "default",
* }],
* scheduling: {
* automaticRestart: true,
* onHostMaintenance: "MIGRATE",
* },
* serviceAccount: {
* scopes: [
* "userinfo-email",
* "compute-ro",
* "storage-ro",
* ],
* },
* tags: [
* "foo",
* "bar",
* ],
* });
* ```
*
* ## Using with Instance Group Manager
*
* Instance Templates cannot be updated after creation with the Google
* Cloud Platform API. In order to update an Instance Template, this provider will
* destroy the existing resource and create a replacement. In order to effectively
* use an Instance Template resource with an [Instance Group Manager resource][1],
* it's recommended to specify `createBeforeDestroy` in a [lifecycle][2] block.
* Either omit the Instance Template `name` attribute, or specify a partial name
* with `namePrefix`. Example:
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const instanceTemplate = new gcp.compute.InstanceTemplate("instanceTemplate", {
* // boot disk
* disks: [{}],
* machineType: "n1-standard-1",
* namePrefix: "instance-template-",
* // networking
* networkInterfaces: [{}],
* region: "us-central1",
* });
* const instanceGroupManager = new gcp.compute.InstanceGroupManager("instanceGroupManager", {
* baseInstanceName: "instance-group-manager",
* instanceTemplate: instanceTemplate.selfLink,
* targetSize: 1,
* zone: "us-central1-f",
* });
* ```
*
* With this setup this provider generates a unique name for your Instance
* Template and can then update the Instance Group manager without conflict before
* destroying the previous Instance Template.
*
* ## Deploying the Latest Image
*
* A common way to use instance templates and managed instance groups is to deploy the
* latest image in a family, usually the latest build of your application. There are two
* ways to do this in this provider, and they have their pros and cons. The difference ends
* up being in how "latest" is interpreted. You can either deploy the latest image available
* when this provider runs, or you can have each instance check what the latest image is when
* it's being created, either as part of a scaling event or being rebuilt by the instance
* group manager.
*
* If you're not sure, we recommend deploying the latest image available when this provider runs,
* because this means all the instances in your group will be based on the same image, always,
* and means that no upgrades or changes to your instances happen outside of a deployment.
* You can achieve this by using the `gcp.compute.Image`
* data source, which will retrieve the latest image on every deployment, and will update
* the template to use that specific image:
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const myImage = pulumi.output(gcp.compute.getImage({
* family: "debian-9",
* project: "debian-cloud",
* }));
* const instanceTemplate = new gcp.compute.InstanceTemplate("instanceTemplate", {
* // boot disk
* disks: [{
* sourceImage: google_compute_image_my_image.selfLink,
* }],
* machineType: "n1-standard-1",
* namePrefix: "instance-template-",
* region: "us-central1",
* });
* ```
*
* To have instances update to the latest on every scaling event or instance re-creation,
* use the family as the image for the disk, and it will use GCP's default behavior, setting
* the image for the template to the family:
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const instanceTemplate = new gcp.compute.InstanceTemplate("instanceTemplate", {
* // boot disk
* disks: [{
* sourceImage: "debian-cloud/debian-9",
* }],
* machineType: "n1-standard-1",
* namePrefix: "instance-template-",
* region: "us-central1",
* });
* ```
*
* > This content is derived from https://github.com/terraform-providers/terraform-provider-google/blob/master/website/docs/r/compute_instance_template.html.markdown.
*/
export class InstanceTemplate extends pulumi.CustomResource {
/**
* Get an existing InstanceTemplate 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.
*/
public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: InstanceTemplateState, opts?: pulumi.CustomResourceOptions): InstanceTemplate {
return new InstanceTemplate(name, <any>state, { ...opts, id: id });
}
/** @internal */
public static readonly __pulumiType = 'gcp:compute/instanceTemplate:InstanceTemplate';
/**
* Returns true if the given object is an instance of InstanceTemplate. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
public static isInstance(obj: any): obj is InstanceTemplate {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === InstanceTemplate.__pulumiType;
}
/**
* Whether to allow sending and receiving of
* packets with non-matching source or destination IPs. This defaults to false.
*/
public readonly canIpForward!: pulumi.Output<boolean | undefined>;
/**
* A brief description of this resource.
*/
public readonly description!: pulumi.Output<string | undefined>;
/**
* Disks to attach to instances created from this template.
* This can be specified multiple times for multiple disks. Structure is
* documented below.
*/
public readonly disks!: pulumi.Output<{ autoDelete?: boolean, boot: boolean, deviceName: string, diskEncryptionKey?: { kmsKeySelfLink?: string }, diskName?: string, diskSizeGb?: number, diskType: string, interface: string, labels?: {[key: string]: string}, mode: string, source?: string, sourceImage: string, type: string }[]>;
/**
* List of the type and count of accelerator cards attached to the instance. Structure documented below.
*/
public readonly guestAccelerators!: pulumi.Output<{ count: number, type: string }[] | undefined>;
/**
* A brief description to use for instances
* created from this template.
*/
public readonly instanceDescription!: pulumi.Output<string | undefined>;
/**
* A set of key/value label pairs to assign to instances
* created from this template,
*/
public readonly labels!: pulumi.Output<{[key: string]: string} | undefined>;
/**
* The machine type to create.
*/
public readonly machineType!: pulumi.Output<string>;
/**
* Metadata key/value pairs to make available from
* within instances created from this template.
*/
public readonly metadata!: pulumi.Output<{[key: string]: any} | undefined>;
/**
* The unique fingerprint of the metadata.
*/
public /*out*/ readonly metadataFingerprint!: pulumi.Output<string>;
/**
* An alternative to using the
* startup-script metadata key, mostly to match the computeInstance resource.
* This replaces the startup-script metadata key on the created instance and
* thus the two mechanisms are not allowed to be used simultaneously.
*/
public readonly metadataStartupScript!: pulumi.Output<string | undefined>;
/**
* Specifies a minimum CPU platform. Applicable values are the friendly names of CPU platforms, such as
* `Intel Haswell` or `Intel Skylake`. See the complete list [here](https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform).
*/
public readonly minCpuPlatform!: pulumi.Output<string | undefined>;
/**
* The name of the instance template. If you leave
* this blank, this provider will auto-generate a unique name.
*/
public readonly name!: pulumi.Output<string>;
/**
* Creates a unique name beginning with the specified
* prefix. Conflicts with `name`.
*/
public readonly namePrefix!: pulumi.Output<string>;
/**
* Networks to attach to instances created from
* this template. This can be specified multiple times for multiple networks.
* Structure is documented below.
*/
public readonly networkInterfaces!: pulumi.Output<{ accessConfigs?: { natIp: string, networkTier: string }[], aliasIpRanges?: { ipCidrRange: string, subnetworkRangeName?: string }[], network: string, networkIp?: string, subnetwork: string, subnetworkProject: string }[] | undefined>;
/**
* The ID of the project in which the resource belongs. If it
* is not provided, the provider project is used.
*/
public readonly project!: pulumi.Output<string>;
/**
* An instance template is a global resource that is not
* bound to a zone or a region. However, you can still specify some regional
* resources in an instance template, which restricts the template to the
* region where that resource resides. For example, a custom `subnetwork`
* resource is tied to a specific region. Defaults to the region of the
* Provider if no value is given.
*/
public readonly region!: pulumi.Output<string>;
/**
* The scheduling strategy to use. More details about
* this configuration option are detailed below.
*/
public readonly scheduling!: pulumi.Output<{ automaticRestart?: boolean, nodeAffinities?: { key: string, operator: string, values: string[] }[], onHostMaintenance: string, preemptible?: boolean }>;
/**
* The URI of the created resource.
*/
public /*out*/ readonly selfLink!: pulumi.Output<string>;
/**
* Service account to attach to the instance. Structure is documented below.
*/
public readonly serviceAccount!: pulumi.Output<{ email: string, scopes: string[] } | undefined>;
/**
* Enable [Shielded VM](https://cloud.google.com/security/shielded-cloud/shielded-vm) on this instance. Shielded VM provides verifiable integrity to prevent against malware and rootkits. Defaults to disabled. Structure is documented below.
* **Note**: `shieldedInstanceConfig` can only be used with boot images with shielded vm support. See the complete list [here](https://cloud.google.com/compute/docs/images#shielded-images).
*/
public readonly shieldedInstanceConfig!: pulumi.Output<{ enableIntegrityMonitoring?: boolean, enableSecureBoot?: boolean, enableVtpm?: boolean }>;
/**
* Tags to attach to the instance.
*/
public readonly tags!: pulumi.Output<string[] | undefined>;
/**
* The unique fingerprint of the tags.
*/
public /*out*/ readonly tagsFingerprint!: pulumi.Output<string>;
/**
* Create a InstanceTemplate 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: InstanceTemplateArgs, opts?: pulumi.CustomResourceOptions)
constructor(name: string, argsOrState?: InstanceTemplateArgs | InstanceTemplateState, opts?: pulumi.CustomResourceOptions) {
let inputs: pulumi.Inputs = {};
if (opts && opts.id) {
const state = argsOrState as InstanceTemplateState | undefined;
inputs["canIpForward"] = state ? state.canIpForward : undefined;
inputs["description"] = state ? state.description : undefined;
inputs["disks"] = state ? state.disks : undefined;
inputs["guestAccelerators"] = state ? state.guestAccelerators : undefined;
inputs["instanceDescription"] = state ? state.instanceDescription : undefined;
inputs["labels"] = state ? state.labels : undefined;
inputs["machineType"] = state ? state.machineType : undefined;
inputs["metadata"] = state ? state.metadata : undefined;
inputs["metadataFingerprint"] = state ? state.metadataFingerprint : undefined;
inputs["metadataStartupScript"] = state ? state.metadataStartupScript : undefined;
inputs["minCpuPlatform"] = state ? state.minCpuPlatform : undefined;
inputs["name"] = state ? state.name : undefined;
inputs["namePrefix"] = state ? state.namePrefix : undefined;
inputs["networkInterfaces"] = state ? state.networkInterfaces : undefined;
inputs["project"] = state ? state.project : undefined;
inputs["region"] = state ? state.region : undefined;
inputs["scheduling"] = state ? state.scheduling : undefined;
inputs["selfLink"] = state ? state.selfLink : undefined;
inputs["serviceAccount"] = state ? state.serviceAccount : undefined;
inputs["shieldedInstanceConfig"] = state ? state.shieldedInstanceConfig : undefined;
inputs["tags"] = state ? state.tags : undefined;
inputs["tagsFingerprint"] = state ? state.tagsFingerprint : undefined;
} else {
const args = argsOrState as InstanceTemplateArgs | undefined;
if (!args || args.disks === undefined) {
throw new Error("Missing required property 'disks'");
}
if (!args || args.machineType === undefined) {
throw new Error("Missing required property 'machineType'");
}
inputs["canIpForward"] = args ? args.canIpForward : undefined;
inputs["description"] = args ? args.description : undefined;
inputs["disks"] = args ? args.disks : undefined;
inputs["guestAccelerators"] = args ? args.guestAccelerators : undefined;
inputs["instanceDescription"] = args ? args.instanceDescription : undefined;
inputs["labels"] = args ? args.labels : undefined;
inputs["machineType"] = args ? args.machineType : undefined;
inputs["metadata"] = args ? args.metadata : undefined;
inputs["metadataStartupScript"] = args ? args.metadataStartupScript : undefined;
inputs["minCpuPlatform"] = args ? args.minCpuPlatform : undefined;
inputs["name"] = args ? args.name : undefined;
inputs["namePrefix"] = args ? args.namePrefix : undefined;
inputs["networkInterfaces"] = args ? args.networkInterfaces : undefined;
inputs["project"] = args ? args.project : undefined;
inputs["region"] = args ? args.region : undefined;
inputs["scheduling"] = args ? args.scheduling : undefined;
inputs["serviceAccount"] = args ? args.serviceAccount : undefined;
inputs["shieldedInstanceConfig"] = args ? args.shieldedInstanceConfig : undefined;
inputs["tags"] = args ? args.tags : undefined;
inputs["metadataFingerprint"] = undefined /*out*/;
inputs["selfLink"] = undefined /*out*/;
inputs["tagsFingerprint"] = undefined /*out*/;
}
if (!opts) {
opts = {}
}
if (!opts.version) {
opts.version = utilities.getVersion();
}
super(InstanceTemplate.__pulumiType, name, inputs, opts);
}
}
/**
* Input properties used for looking up and filtering InstanceTemplate resources.
*/
export interface InstanceTemplateState {
/**
* Whether to allow sending and receiving of
* packets with non-matching source or destination IPs. This defaults to false.
*/
readonly canIpForward?: pulumi.Input<boolean>;
/**
* A brief description of this resource.
*/
readonly description?: pulumi.Input<string>;
/**
* Disks to attach to instances created from this template.
* This can be specified multiple times for multiple disks. Structure is
* documented below.
*/
readonly disks?: pulumi.Input<pulumi.Input<{ autoDelete?: pulumi.Input<boolean>, boot?: pulumi.Input<boolean>, deviceName?: pulumi.Input<string>, diskEncryptionKey?: pulumi.Input<{ kmsKeySelfLink?: pulumi.Input<string> }>, diskName?: pulumi.Input<string>, diskSizeGb?: pulumi.Input<number>, diskType?: pulumi.Input<string>, interface?: pulumi.Input<string>, labels?: pulumi.Input<{[key: string]: pulumi.Input<string>}>, mode?: pulumi.Input<string>, source?: pulumi.Input<string>, sourceImage?: pulumi.Input<string>, type?: pulumi.Input<string> }>[]>;
/**
* List of the type and count of accelerator cards attached to the instance. Structure documented below.
*/
readonly guestAccelerators?: pulumi.Input<pulumi.Input<{ count: pulumi.Input<number>, type: pulumi.Input<string> }>[]>;
/**
* A brief description to use for instances
* created from this template.
*/
readonly instanceDescription?: pulumi.Input<string>;
/**
* A set of key/value label pairs to assign to instances
* created from this template,
*/
readonly labels?: pulumi.Input<{[key: string]: pulumi.Input<string>}>;
/**
* The machine type to create.
*/
readonly machineType?: pulumi.Input<string>;
/**
* Metadata key/value pairs to make available from
* within instances created from this template.
*/
readonly metadata?: pulumi.Input<{[key: string]: any}>;
/**
* The unique fingerprint of the metadata.
*/
readonly metadataFingerprint?: pulumi.Input<string>;
/**
* An alternative to using the
* startup-script metadata key, mostly to match the computeInstance resource.
* This replaces the startup-script metadata key on the created instance and
* thus the two mechanisms are not allowed to be used simultaneously.
*/
readonly metadataStartupScript?: pulumi.Input<string>;
/**
* Specifies a minimum CPU platform. Applicable values are the friendly names of CPU platforms, such as
* `Intel Haswell` or `Intel Skylake`. See the complete list [here](https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform).
*/
readonly minCpuPlatform?: pulumi.Input<string>;
/**
* The name of the instance template. If you leave
* this blank, this provider will auto-generate a unique name.
*/
readonly name?: pulumi.Input<string>;
/**
* Creates a unique name beginning with the specified
* prefix. Conflicts with `name`.
*/
readonly namePrefix?: pulumi.Input<string>;
/**
* Networks to attach to instances created from
* this template. This can be specified multiple times for multiple networks.
* Structure is documented below.
*/
readonly networkInterfaces?: pulumi.Input<pulumi.Input<{ accessConfigs?: pulumi.Input<pulumi.Input<{ natIp?: pulumi.Input<string>, networkTier?: pulumi.Input<string> }>[]>, aliasIpRanges?: pulumi.Input<pulumi.Input<{ ipCidrRange: pulumi.Input<string>, subnetworkRangeName?: pulumi.Input<string> }>[]>, network?: pulumi.Input<string>, networkIp?: pulumi.Input<string>, subnetwork?: pulumi.Input<string>, subnetworkProject?: pulumi.Input<string> }>[]>;
/**
* The ID of the project in which the resource belongs. If it
* is not provided, the provider project is used.
*/
readonly project?: pulumi.Input<string>;
/**
* An instance template is a global resource that is not
* bound to a zone or a region. However, you can still specify some regional
* resources in an instance template, which restricts the template to the
* region where that resource resides. For example, a custom `subnetwork`
* resource is tied to a specific region. Defaults to the region of the
* Provider if no value is given.
*/
readonly region?: pulumi.Input<string>;
/**
* The scheduling strategy to use. More details about
* this configuration option are detailed below.
*/
readonly scheduling?: pulumi.Input<{ automaticRestart?: pulumi.Input<boolean>, nodeAffinities?: pulumi.Input<pulumi.Input<{ key: pulumi.Input<string>, operator: pulumi.Input<string>, values: pulumi.Input<pulumi.Input<string>[]> }>[]>, onHostMaintenance?: pulumi.Input<string>, preemptible?: pulumi.Input<boolean> }>;
/**
* The URI of the created resource.
*/
readonly selfLink?: pulumi.Input<string>;
/**
* Service account to attach to the instance. Structure is documented below.
*/
readonly serviceAccount?: pulumi.Input<{ email?: pulumi.Input<string>, scopes: pulumi.Input<pulumi.Input<string>[]> }>;
/**
* Enable [Shielded VM](https://cloud.google.com/security/shielded-cloud/shielded-vm) on this instance. Shielded VM provides verifiable integrity to prevent against malware and rootkits. Defaults to disabled. Structure is documented below.
* **Note**: `shieldedInstanceConfig` can only be used with boot images with shielded vm support. See the complete list [here](https://cloud.google.com/compute/docs/images#shielded-images).
*/
readonly shieldedInstanceConfig?: pulumi.Input<{ enableIntegrityMonitoring?: pulumi.Input<boolean>, enableSecureBoot?: pulumi.Input<boolean>, enableVtpm?: pulumi.Input<boolean> }>;
/**
* Tags to attach to the instance.
*/
readonly tags?: pulumi.Input<pulumi.Input<string>[]>;
/**
* The unique fingerprint of the tags.
*/
readonly tagsFingerprint?: pulumi.Input<string>;
}
/**
* The set of arguments for constructing a InstanceTemplate resource.
*/
export interface InstanceTemplateArgs {
/**
* Whether to allow sending and receiving of
* packets with non-matching source or destination IPs. This defaults to false.
*/
readonly canIpForward?: pulumi.Input<boolean>;
/**
* A brief description of this resource.
*/
readonly description?: pulumi.Input<string>;
/**
* Disks to attach to instances created from this template.
* This can be specified multiple times for multiple disks. Structure is
* documented below.
*/
readonly disks: pulumi.Input<pulumi.Input<{ autoDelete?: pulumi.Input<boolean>, boot?: pulumi.Input<boolean>, deviceName?: pulumi.Input<string>, diskEncryptionKey?: pulumi.Input<{ kmsKeySelfLink?: pulumi.Input<string> }>, diskName?: pulumi.Input<string>, diskSizeGb?: pulumi.Input<number>, diskType?: pulumi.Input<string>, interface?: pulumi.Input<string>, labels?: pulumi.Input<{[key: string]: pulumi.Input<string>}>, mode?: pulumi.Input<string>, source?: pulumi.Input<string>, sourceImage?: pulumi.Input<string>, type?: pulumi.Input<string> }>[]>;
/**
* List of the type and count of accelerator cards attached to the instance. Structure documented below.
*/
readonly guestAccelerators?: pulumi.Input<pulumi.Input<{ count: pulumi.Input<number>, type: pulumi.Input<string> }>[]>;
/**
* A brief description to use for instances
* created from this template.
*/
readonly instanceDescription?: pulumi.Input<string>;
/**
* A set of key/value label pairs to assign to instances
* created from this template,
*/
readonly labels?: pulumi.Input<{[key: string]: pulumi.Input<string>}>;
/**
* The machine type to create.
*/
readonly machineType: pulumi.Input<string>;
/**
* Metadata key/value pairs to make available from
* within instances created from this template.
*/
readonly metadata?: pulumi.Input<{[key: string]: any}>;
/**
* An alternative to using the
* startup-script metadata key, mostly to match the computeInstance resource.
* This replaces the startup-script metadata key on the created instance and
* thus the two mechanisms are not allowed to be used simultaneously.
*/
readonly metadataStartupScript?: pulumi.Input<string>;
/**
* Specifies a minimum CPU platform. Applicable values are the friendly names of CPU platforms, such as
* `Intel Haswell` or `Intel Skylake`. See the complete list [here](https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform).
*/
readonly minCpuPlatform?: pulumi.Input<string>;
/**
* The name of the instance template. If you leave
* this blank, this provider will auto-generate a unique name.
*/
readonly name?: pulumi.Input<string>;
/**
* Creates a unique name beginning with the specified
* prefix. Conflicts with `name`.
*/
readonly namePrefix?: pulumi.Input<string>;
/**
* Networks to attach to instances created from
* this template. This can be specified multiple times for multiple networks.
* Structure is documented below.
*/
readonly networkInterfaces?: pulumi.Input<pulumi.Input<{ accessConfigs?: pulumi.Input<pulumi.Input<{ natIp?: pulumi.Input<string>, networkTier?: pulumi.Input<string> }>[]>, aliasIpRanges?: pulumi.Input<pulumi.Input<{ ipCidrRange: pulumi.Input<string>, subnetworkRangeName?: pulumi.Input<string> }>[]>, network?: pulumi.Input<string>, networkIp?: pulumi.Input<string>, subnetwork?: pulumi.Input<string>, subnetworkProject?: pulumi.Input<string> }>[]>;
/**
* The ID of the project in which the resource belongs. If it
* is not provided, the provider project is used.
*/
readonly project?: pulumi.Input<string>;
/**
* An instance template is a global resource that is not
* bound to a zone or a region. However, you can still specify some regional
* resources in an instance template, which restricts the template to the
* region where that resource resides. For example, a custom `subnetwork`
* resource is tied to a specific region. Defaults to the region of the
* Provider if no value is given.
*/
readonly region?: pulumi.Input<string>;
/**
* The scheduling strategy to use. More details about
* this configuration option are detailed below.
*/
readonly scheduling?: pulumi.Input<{ automaticRestart?: pulumi.Input<boolean>, nodeAffinities?: pulumi.Input<pulumi.Input<{ key: pulumi.Input<string>, operator: pulumi.Input<string>, values: pulumi.Input<pulumi.Input<string>[]> }>[]>, onHostMaintenance?: pulumi.Input<string>, preemptible?: pulumi.Input<boolean> }>;
/**
* Service account to attach to the instance. Structure is documented below.
*/
readonly serviceAccount?: pulumi.Input<{ email?: pulumi.Input<string>, scopes: pulumi.Input<pulumi.Input<string>[]> }>;
/**
* Enable [Shielded VM](https://cloud.google.com/security/shielded-cloud/shielded-vm) on this instance. Shielded VM provides verifiable integrity to prevent against malware and rootkits. Defaults to disabled. Structure is documented below.
* **Note**: `shieldedInstanceConfig` can only be used with boot images with shielded vm support. See the complete list [here](https://cloud.google.com/compute/docs/images#shielded-images).
*/
readonly shieldedInstanceConfig?: pulumi.Input<{ enableIntegrityMonitoring?: pulumi.Input<boolean>, enableSecureBoot?: pulumi.Input<boolean>, enableVtpm?: pulumi.Input<boolean> }>;
/**
* Tags to attach to the instance.
*/
readonly tags?: pulumi.Input<pulumi.Input<string>[]>;
}