/
instance.go
653 lines (593 loc) · 41.8 KB
/
instance.go
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
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
// *** 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! ***
package linode
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
// Provides a Linode Instance resource. This can be used to create, modify, and delete Linodes.
// For more information, see [Getting Started with Linode](https://linode.com/docs/getting-started/) and the [Linode APIv4 docs](https://developers.linode.com/api/v4#operation/createLinodeInstance).
//
// ## Example Usage
// ### Simple Linode Instance
//
// The following example shows how one might use this resource to configure a Linode instance.
//
// ```go
// package main
//
// import (
// "github.com/pulumi/pulumi-linode/sdk/v2/go/linode"
// "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := linode.NewInstance(ctx, "web", &linode.InstanceArgs{
// AuthorizedKeys: pulumi.StringArray{
// pulumi.String("ssh-rsa AAAA...Gw== user@example.local"),
// },
// Group: pulumi.String("foo"),
// Image: pulumi.String("linode/ubuntu18.04"),
// Label: pulumi.String("simple_instance"),
// PrivateIp: pulumi.Bool(true),
// Region: pulumi.String("us-central"),
// RootPass: pulumi.String("terr4form-test"),
// SwapSize: pulumi.Int(256),
// Tags: pulumi.StringArray{
// pulumi.String("foo"),
// },
// Type: pulumi.String("g6-standard-1"),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
// ```
// ### Linode Instance with explicit Configs and Disks
//
// Using explicit Instance Configs and Disks it is possible to create a more elaborate Linode instance. This can be used to provision multiple disks and volumes during Instance creation.
//
// ```go
// package main
//
// import (
// "github.com/pulumi/pulumi-linode/sdk/v2/go/linode"
// "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// me, err := linode.GetProfile(ctx, nil, nil)
// if err != nil {
// return err
// }
// webVolume, err := linode.NewVolume(ctx, "webVolume", &linode.VolumeArgs{
// Label: pulumi.String("web_volume"),
// Region: pulumi.String("us-central"),
// Size: pulumi.Int(20),
// })
// if err != nil {
// return err
// }
// _, err = linode.NewInstance(ctx, "web", &linode.InstanceArgs{
// BootConfigLabel: pulumi.String("boot_config"),
// Configs: linode.InstanceConfigArray{
// &linode.InstanceConfigArgs{
// Devices: &linode.InstanceConfigDevicesArgs{
// Sda: &linode.InstanceConfigDevicesSdaArgs{
// DiskLabel: pulumi.String("boot"),
// },
// Sdb: &linode.InstanceConfigDevicesSdbArgs{
// VolumeId: webVolume.ID(),
// },
// },
// Kernel: pulumi.String("linode/latest-64bit"),
// Label: pulumi.String("boot_config"),
// RootDevice: pulumi.String("/dev/sda"),
// },
// },
// Disks: linode.InstanceDiskArray{
// &linode.InstanceDiskArgs{
// AuthorizedKeys: pulumi.StringArray{
// pulumi.String("ssh-rsa AAAA...Gw== user@example.local"),
// },
// AuthorizedUsers: pulumi.StringArray{
// pulumi.String(me.Username),
// },
// Image: pulumi.String("linode/ubuntu18.04"),
// Label: pulumi.String("boot"),
// RootPass: pulumi.String("terr4form-test"),
// Size: pulumi.Int(3000),
// },
// },
// Group: pulumi.String("foo"),
// Label: pulumi.String("complex_instance"),
// PrivateIp: pulumi.Bool(true),
// Region: pulumi.String("us-central"),
// Tags: pulumi.StringArray{
// pulumi.String("foo"),
// },
// Type: pulumi.String("g6-nanode-1"),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
// ```
// ## Attributes
//
// This Linode Instance resource exports the following attributes:
//
// * `status` - The status of the instance, indicating the current readiness state. (`running`, `offline`, ...)
//
// * `ipAddress` - A string containing the Linode's public IP address.
//
// * `privateIpAddress` - This Linode's Private IPv4 Address, if enabled. The regional private IP address range, 192.168.128.0/17, is shared by all Linode Instances in a region.
//
// * `ipv6` - This Linode's IPv6 SLAAC addresses. This address is specific to a Linode, and may not be shared. The prefix (`/64`) is included in this attribute.
//
// * `ipv4` - This Linode's IPv4 Addresses. Each Linode is assigned a single public IPv4 address upon creation, and may get a single private IPv4 address if needed. You may need to open a support ticket to get additional IPv4 addresses.
//
// * `specs.0.disk` - The amount of storage space, in GB. this Linode has access to. A typical Linode will divide this space between a primary disk with an image deployed to it, and a swap disk, usually 512 MB. This is the default configuration created when deploying a Linode with an image through POST /linode/instances.
//
// * `specs.0.memory` - The amount of RAM, in MB, this Linode has access to. Typically a Linode will choose to boot with all of its available RAM, but this can be configured in a Config profile.
//
// * `specs.0.vcpus` - The number of vcpus this Linode has access to. Typically a Linode will choose to boot with all of its available vcpus, but this can be configured in a Config Profile.
//
// * `specs.0.transfer` - The amount of network transfer this Linode is allotted each month.
//
// * `backups` - Information about this Linode's backups status.
//
// * `enabled` - If this Linode has the Backup service enabled.
//
// * `schedule`
//
// * `day` - The day of the week that your Linode's weekly Backup is taken. If not set manually, a day will be chosen for you. Backups are taken every day, but backups taken on this day are preferred when selecting backups to retain for a longer period. If not set manually, then when backups are initially enabled, this may come back as "Scheduling" until the day is automatically selected.
//
// * `window` - The window ('W0'-'W22') in which your backups will be taken, in UTC. A backups window is a two-hour span of time in which the backup may occur. For example, 'W10' indicates that your backups should be taken between 10:00 and 12:00. If you do not choose a backup window, one will be selected for you automatically. If not set manually, when backups are initially enabled this may come back as Scheduling until the window is automatically selected.
//
// ## Import
//
// Linodes Instances can be imported using the Linode `id`, e.g.
//
// ```sh
// $ pulumi import linode:index/instance:Instance mylinode 1234567
// ```
//
// When importing an instance, all `disk` and `config` values must be represented. Imported disks must include their `label` value.
//
// **Any disk that is not precisely represented may be removed resulting in data loss.** Imported configs should include all `devices`, and must include `label`, `kernel`, and the `root_device`.
//
// The instance must include a `boot_config_label` referring to the correct configuration profile. The Linode Guide, [Import Existing Infrastructure to Terraform](https://www.linode.com/docs/applications/configuration-management/import-existing-infrastructure-to-terraform/), offers resource importing examples for Instances and other Linode resource types.
type Instance struct {
pulumi.CustomResourceState
Alerts InstanceAlertsOutput `pulumi:"alerts"`
// A list of SSH public keys to deploy for the root user on the newly created Linode. Only accepted if `image` is provided. *This value can not be imported.* *Changing `authorizedKeys` forces the creation of a new Linode Instance.*
AuthorizedKeys pulumi.StringArrayOutput `pulumi:"authorizedKeys"`
// A list of Linode usernames. If the usernames have associated SSH keys, the keys will be appended to the `root` user's `~/.ssh/authorized_keys` file automatically. *This value can not be imported.* *Changing `authorizedUsers` forces the creation of a new Linode Instance.*
AuthorizedUsers pulumi.StringArrayOutput `pulumi:"authorizedUsers"`
// A Backup ID from another Linode's available backups. Your User must have readWrite access to that Linode, the Backup must have a status of successful, and the Linode must be deployed to the same region as the Backup. See /linode/instances/{linodeId}/backups for a Linode's available backups. This field and the image field are mutually exclusive. *This value can not be imported.* *Changing `backupId` forces the creation of a new Linode Instance.*
BackupId pulumi.IntPtrOutput `pulumi:"backupId"`
// Information about this Linode's backups status.
Backups InstanceBackupsOutput `pulumi:"backups"`
// If this field is set to true, the created Linode will automatically be enrolled in the Linode Backup service. This will incur an additional charge. The cost for the Backup service is dependent on the Type of Linode deployed.
BackupsEnabled pulumi.BoolOutput `pulumi:"backupsEnabled"`
// The Label of the Instance Config that should be used to boot the Linode instance. If there is only one `config`, the `label` of that `config` will be used as the `bootConfigLabel`. *This value can not be imported.*
BootConfigLabel pulumi.StringOutput `pulumi:"bootConfigLabel"`
// Configuration profiles define the VM settings and boot behavior of the Linode Instance.
Configs InstanceConfigArrayOutput `pulumi:"configs"`
Disks InstanceDiskArrayOutput `pulumi:"disks"`
// The display group of the Linode instance.
Group pulumi.StringPtrOutput `pulumi:"group"`
// An Image ID to deploy the Disk from. Official Linode Images start with linode/, while your Images start with private/. See /images for more information on the Images available for you to use. Examples are `linode/debian9`, `linode/fedora28`, `linode/ubuntu16.04lts`, `linode/arch`, and `private/12345`. See all images [here](https://api.linode.com/v4/linode/kernels). *Changing `image` forces the creation of a new Linode Instance.*
Image pulumi.StringPtrOutput `pulumi:"image"`
// This Linode's Public IPv4 Address. If there are multiple public IPv4 addresses on this Instance, an arbitrary address
// will be used for this field.
IpAddress pulumi.StringOutput `pulumi:"ipAddress"`
// This Linode's IPv4 Addresses. Each Linode is assigned a single public IPv4 address upon creation, and may get a single
// private IPv4 address if needed. You may need to open a support ticket to get additional IPv4 addresses.
Ipv4s pulumi.StringArrayOutput `pulumi:"ipv4s"`
// This Linode's IPv6 SLAAC addresses. This address is specific to a Linode, and may not be shared.
Ipv6 pulumi.StringOutput `pulumi:"ipv6"`
// The Config's label for display purposes. Also used by `bootConfigLabel`.
Label pulumi.StringOutput `pulumi:"label"`
// If true, the created Linode will have private networking enabled, allowing use of the 192.168.128.0/17 network within the Linode's region. It can be enabled on an existing Linode but it can't be disabled.
PrivateIp pulumi.BoolPtrOutput `pulumi:"privateIp"`
// This Linode's Private IPv4 Address. The regional private IP address range is 192.168.128/17 address shared by all Linode
// Instances in a region.
PrivateIpAddress pulumi.StringOutput `pulumi:"privateIpAddress"`
// This is the location where the Linode is deployed. Examples are `"us-east"`, `"us-west"`, `"ap-south"`, etc. See all regions [here](https://api.linode.com/v4/regions). *Changing `region` forces the creation of a new Linode Instance.*.
Region pulumi.StringOutput `pulumi:"region"`
// The initial password for the `root` user account. *This value can not be imported.* *Changing `rootPass` forces the creation of a new Linode Instance.* *If omitted, a random password will be generated but will not be stored in state.*
RootPass pulumi.StringPtrOutput `pulumi:"rootPass"`
Specs InstanceSpecsOutput `pulumi:"specs"`
// An object containing responses to any User Defined Fields present in the StackScript being deployed to this Linode. Only accepted if 'stackscript_id' is given. The required values depend on the StackScript being deployed. *This value can not be imported.* *Changing `stackscriptData` forces the creation of a new Linode Instance.*
StackscriptData pulumi.MapOutput `pulumi:"stackscriptData"`
// The StackScript to deploy to the newly created Linode. If provided, 'image' must also be provided, and must be an Image that is compatible with this StackScript. *This value can not be imported.* *Changing `stackscriptId` forces the creation of a new Linode Instance.*
StackscriptId pulumi.IntPtrOutput `pulumi:"stackscriptId"`
// The status of the instance, indicating the current readiness state.
Status pulumi.StringOutput `pulumi:"status"`
// When deploying from an Image, this field is optional with a Linode API default of 512mb, otherwise it is ignored. This is used to set the swap disk size for the newly-created Linode.
SwapSize pulumi.IntOutput `pulumi:"swapSize"`
// A list of tags applied to this object. Tags are for organizational purposes only.
Tags pulumi.StringArrayOutput `pulumi:"tags"`
// The Linode type defines the pricing, CPU, disk, and RAM specs of the instance. Examples are `"g6-nanode-1"`, `"g6-standard-2"`, `"g6-highmem-16"`, `"g6-dedicated-16"`, etc. See all types [here](https://api.linode.com/v4/linode/types).
Type pulumi.StringPtrOutput `pulumi:"type"`
// The watchdog, named Lassie, is a Shutdown Watchdog that monitors your Linode and will reboot it if it powers off unexpectedly. It works by issuing a boot job when your Linode powers off without a shutdown job being responsible. To prevent a loop, Lassie will give up if there have been more than 5 boot jobs issued within 15 minutes.
WatchdogEnabled pulumi.BoolPtrOutput `pulumi:"watchdogEnabled"`
}
// NewInstance registers a new resource with the given unique name, arguments, and options.
func NewInstance(ctx *pulumi.Context,
name string, args *InstanceArgs, opts ...pulumi.ResourceOption) (*Instance, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.Region == nil {
return nil, errors.New("invalid value for required argument 'Region'")
}
var resource Instance
err := ctx.RegisterResource("linode:index/instance:Instance", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetInstance gets an existing Instance resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetInstance(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *InstanceState, opts ...pulumi.ResourceOption) (*Instance, error) {
var resource Instance
err := ctx.ReadResource("linode:index/instance:Instance", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering Instance resources.
type instanceState struct {
Alerts *InstanceAlerts `pulumi:"alerts"`
// A list of SSH public keys to deploy for the root user on the newly created Linode. Only accepted if `image` is provided. *This value can not be imported.* *Changing `authorizedKeys` forces the creation of a new Linode Instance.*
AuthorizedKeys []string `pulumi:"authorizedKeys"`
// A list of Linode usernames. If the usernames have associated SSH keys, the keys will be appended to the `root` user's `~/.ssh/authorized_keys` file automatically. *This value can not be imported.* *Changing `authorizedUsers` forces the creation of a new Linode Instance.*
AuthorizedUsers []string `pulumi:"authorizedUsers"`
// A Backup ID from another Linode's available backups. Your User must have readWrite access to that Linode, the Backup must have a status of successful, and the Linode must be deployed to the same region as the Backup. See /linode/instances/{linodeId}/backups for a Linode's available backups. This field and the image field are mutually exclusive. *This value can not be imported.* *Changing `backupId` forces the creation of a new Linode Instance.*
BackupId *int `pulumi:"backupId"`
// Information about this Linode's backups status.
Backups *InstanceBackups `pulumi:"backups"`
// If this field is set to true, the created Linode will automatically be enrolled in the Linode Backup service. This will incur an additional charge. The cost for the Backup service is dependent on the Type of Linode deployed.
BackupsEnabled *bool `pulumi:"backupsEnabled"`
// The Label of the Instance Config that should be used to boot the Linode instance. If there is only one `config`, the `label` of that `config` will be used as the `bootConfigLabel`. *This value can not be imported.*
BootConfigLabel *string `pulumi:"bootConfigLabel"`
// Configuration profiles define the VM settings and boot behavior of the Linode Instance.
Configs []InstanceConfig `pulumi:"configs"`
Disks []InstanceDisk `pulumi:"disks"`
// The display group of the Linode instance.
Group *string `pulumi:"group"`
// An Image ID to deploy the Disk from. Official Linode Images start with linode/, while your Images start with private/. See /images for more information on the Images available for you to use. Examples are `linode/debian9`, `linode/fedora28`, `linode/ubuntu16.04lts`, `linode/arch`, and `private/12345`. See all images [here](https://api.linode.com/v4/linode/kernels). *Changing `image` forces the creation of a new Linode Instance.*
Image *string `pulumi:"image"`
// This Linode's Public IPv4 Address. If there are multiple public IPv4 addresses on this Instance, an arbitrary address
// will be used for this field.
IpAddress *string `pulumi:"ipAddress"`
// This Linode's IPv4 Addresses. Each Linode is assigned a single public IPv4 address upon creation, and may get a single
// private IPv4 address if needed. You may need to open a support ticket to get additional IPv4 addresses.
Ipv4s []string `pulumi:"ipv4s"`
// This Linode's IPv6 SLAAC addresses. This address is specific to a Linode, and may not be shared.
Ipv6 *string `pulumi:"ipv6"`
// The Config's label for display purposes. Also used by `bootConfigLabel`.
Label *string `pulumi:"label"`
// If true, the created Linode will have private networking enabled, allowing use of the 192.168.128.0/17 network within the Linode's region. It can be enabled on an existing Linode but it can't be disabled.
PrivateIp *bool `pulumi:"privateIp"`
// This Linode's Private IPv4 Address. The regional private IP address range is 192.168.128/17 address shared by all Linode
// Instances in a region.
PrivateIpAddress *string `pulumi:"privateIpAddress"`
// This is the location where the Linode is deployed. Examples are `"us-east"`, `"us-west"`, `"ap-south"`, etc. See all regions [here](https://api.linode.com/v4/regions). *Changing `region` forces the creation of a new Linode Instance.*.
Region *string `pulumi:"region"`
// The initial password for the `root` user account. *This value can not be imported.* *Changing `rootPass` forces the creation of a new Linode Instance.* *If omitted, a random password will be generated but will not be stored in state.*
RootPass *string `pulumi:"rootPass"`
Specs *InstanceSpecs `pulumi:"specs"`
// An object containing responses to any User Defined Fields present in the StackScript being deployed to this Linode. Only accepted if 'stackscript_id' is given. The required values depend on the StackScript being deployed. *This value can not be imported.* *Changing `stackscriptData` forces the creation of a new Linode Instance.*
StackscriptData map[string]interface{} `pulumi:"stackscriptData"`
// The StackScript to deploy to the newly created Linode. If provided, 'image' must also be provided, and must be an Image that is compatible with this StackScript. *This value can not be imported.* *Changing `stackscriptId` forces the creation of a new Linode Instance.*
StackscriptId *int `pulumi:"stackscriptId"`
// The status of the instance, indicating the current readiness state.
Status *string `pulumi:"status"`
// When deploying from an Image, this field is optional with a Linode API default of 512mb, otherwise it is ignored. This is used to set the swap disk size for the newly-created Linode.
SwapSize *int `pulumi:"swapSize"`
// A list of tags applied to this object. Tags are for organizational purposes only.
Tags []string `pulumi:"tags"`
// The Linode type defines the pricing, CPU, disk, and RAM specs of the instance. Examples are `"g6-nanode-1"`, `"g6-standard-2"`, `"g6-highmem-16"`, `"g6-dedicated-16"`, etc. See all types [here](https://api.linode.com/v4/linode/types).
Type *string `pulumi:"type"`
// The watchdog, named Lassie, is a Shutdown Watchdog that monitors your Linode and will reboot it if it powers off unexpectedly. It works by issuing a boot job when your Linode powers off without a shutdown job being responsible. To prevent a loop, Lassie will give up if there have been more than 5 boot jobs issued within 15 minutes.
WatchdogEnabled *bool `pulumi:"watchdogEnabled"`
}
type InstanceState struct {
Alerts InstanceAlertsPtrInput
// A list of SSH public keys to deploy for the root user on the newly created Linode. Only accepted if `image` is provided. *This value can not be imported.* *Changing `authorizedKeys` forces the creation of a new Linode Instance.*
AuthorizedKeys pulumi.StringArrayInput
// A list of Linode usernames. If the usernames have associated SSH keys, the keys will be appended to the `root` user's `~/.ssh/authorized_keys` file automatically. *This value can not be imported.* *Changing `authorizedUsers` forces the creation of a new Linode Instance.*
AuthorizedUsers pulumi.StringArrayInput
// A Backup ID from another Linode's available backups. Your User must have readWrite access to that Linode, the Backup must have a status of successful, and the Linode must be deployed to the same region as the Backup. See /linode/instances/{linodeId}/backups for a Linode's available backups. This field and the image field are mutually exclusive. *This value can not be imported.* *Changing `backupId` forces the creation of a new Linode Instance.*
BackupId pulumi.IntPtrInput
// Information about this Linode's backups status.
Backups InstanceBackupsPtrInput
// If this field is set to true, the created Linode will automatically be enrolled in the Linode Backup service. This will incur an additional charge. The cost for the Backup service is dependent on the Type of Linode deployed.
BackupsEnabled pulumi.BoolPtrInput
// The Label of the Instance Config that should be used to boot the Linode instance. If there is only one `config`, the `label` of that `config` will be used as the `bootConfigLabel`. *This value can not be imported.*
BootConfigLabel pulumi.StringPtrInput
// Configuration profiles define the VM settings and boot behavior of the Linode Instance.
Configs InstanceConfigArrayInput
Disks InstanceDiskArrayInput
// The display group of the Linode instance.
Group pulumi.StringPtrInput
// An Image ID to deploy the Disk from. Official Linode Images start with linode/, while your Images start with private/. See /images for more information on the Images available for you to use. Examples are `linode/debian9`, `linode/fedora28`, `linode/ubuntu16.04lts`, `linode/arch`, and `private/12345`. See all images [here](https://api.linode.com/v4/linode/kernels). *Changing `image` forces the creation of a new Linode Instance.*
Image pulumi.StringPtrInput
// This Linode's Public IPv4 Address. If there are multiple public IPv4 addresses on this Instance, an arbitrary address
// will be used for this field.
IpAddress pulumi.StringPtrInput
// This Linode's IPv4 Addresses. Each Linode is assigned a single public IPv4 address upon creation, and may get a single
// private IPv4 address if needed. You may need to open a support ticket to get additional IPv4 addresses.
Ipv4s pulumi.StringArrayInput
// This Linode's IPv6 SLAAC addresses. This address is specific to a Linode, and may not be shared.
Ipv6 pulumi.StringPtrInput
// The Config's label for display purposes. Also used by `bootConfigLabel`.
Label pulumi.StringPtrInput
// If true, the created Linode will have private networking enabled, allowing use of the 192.168.128.0/17 network within the Linode's region. It can be enabled on an existing Linode but it can't be disabled.
PrivateIp pulumi.BoolPtrInput
// This Linode's Private IPv4 Address. The regional private IP address range is 192.168.128/17 address shared by all Linode
// Instances in a region.
PrivateIpAddress pulumi.StringPtrInput
// This is the location where the Linode is deployed. Examples are `"us-east"`, `"us-west"`, `"ap-south"`, etc. See all regions [here](https://api.linode.com/v4/regions). *Changing `region` forces the creation of a new Linode Instance.*.
Region pulumi.StringPtrInput
// The initial password for the `root` user account. *This value can not be imported.* *Changing `rootPass` forces the creation of a new Linode Instance.* *If omitted, a random password will be generated but will not be stored in state.*
RootPass pulumi.StringPtrInput
Specs InstanceSpecsPtrInput
// An object containing responses to any User Defined Fields present in the StackScript being deployed to this Linode. Only accepted if 'stackscript_id' is given. The required values depend on the StackScript being deployed. *This value can not be imported.* *Changing `stackscriptData` forces the creation of a new Linode Instance.*
StackscriptData pulumi.MapInput
// The StackScript to deploy to the newly created Linode. If provided, 'image' must also be provided, and must be an Image that is compatible with this StackScript. *This value can not be imported.* *Changing `stackscriptId` forces the creation of a new Linode Instance.*
StackscriptId pulumi.IntPtrInput
// The status of the instance, indicating the current readiness state.
Status pulumi.StringPtrInput
// When deploying from an Image, this field is optional with a Linode API default of 512mb, otherwise it is ignored. This is used to set the swap disk size for the newly-created Linode.
SwapSize pulumi.IntPtrInput
// A list of tags applied to this object. Tags are for organizational purposes only.
Tags pulumi.StringArrayInput
// The Linode type defines the pricing, CPU, disk, and RAM specs of the instance. Examples are `"g6-nanode-1"`, `"g6-standard-2"`, `"g6-highmem-16"`, `"g6-dedicated-16"`, etc. See all types [here](https://api.linode.com/v4/linode/types).
Type pulumi.StringPtrInput
// The watchdog, named Lassie, is a Shutdown Watchdog that monitors your Linode and will reboot it if it powers off unexpectedly. It works by issuing a boot job when your Linode powers off without a shutdown job being responsible. To prevent a loop, Lassie will give up if there have been more than 5 boot jobs issued within 15 minutes.
WatchdogEnabled pulumi.BoolPtrInput
}
func (InstanceState) ElementType() reflect.Type {
return reflect.TypeOf((*instanceState)(nil)).Elem()
}
type instanceArgs struct {
Alerts *InstanceAlerts `pulumi:"alerts"`
// A list of SSH public keys to deploy for the root user on the newly created Linode. Only accepted if `image` is provided. *This value can not be imported.* *Changing `authorizedKeys` forces the creation of a new Linode Instance.*
AuthorizedKeys []string `pulumi:"authorizedKeys"`
// A list of Linode usernames. If the usernames have associated SSH keys, the keys will be appended to the `root` user's `~/.ssh/authorized_keys` file automatically. *This value can not be imported.* *Changing `authorizedUsers` forces the creation of a new Linode Instance.*
AuthorizedUsers []string `pulumi:"authorizedUsers"`
// A Backup ID from another Linode's available backups. Your User must have readWrite access to that Linode, the Backup must have a status of successful, and the Linode must be deployed to the same region as the Backup. See /linode/instances/{linodeId}/backups for a Linode's available backups. This field and the image field are mutually exclusive. *This value can not be imported.* *Changing `backupId` forces the creation of a new Linode Instance.*
BackupId *int `pulumi:"backupId"`
// If this field is set to true, the created Linode will automatically be enrolled in the Linode Backup service. This will incur an additional charge. The cost for the Backup service is dependent on the Type of Linode deployed.
BackupsEnabled *bool `pulumi:"backupsEnabled"`
// The Label of the Instance Config that should be used to boot the Linode instance. If there is only one `config`, the `label` of that `config` will be used as the `bootConfigLabel`. *This value can not be imported.*
BootConfigLabel *string `pulumi:"bootConfigLabel"`
// Configuration profiles define the VM settings and boot behavior of the Linode Instance.
Configs []InstanceConfig `pulumi:"configs"`
Disks []InstanceDisk `pulumi:"disks"`
// The display group of the Linode instance.
Group *string `pulumi:"group"`
// An Image ID to deploy the Disk from. Official Linode Images start with linode/, while your Images start with private/. See /images for more information on the Images available for you to use. Examples are `linode/debian9`, `linode/fedora28`, `linode/ubuntu16.04lts`, `linode/arch`, and `private/12345`. See all images [here](https://api.linode.com/v4/linode/kernels). *Changing `image` forces the creation of a new Linode Instance.*
Image *string `pulumi:"image"`
// The Config's label for display purposes. Also used by `bootConfigLabel`.
Label *string `pulumi:"label"`
// If true, the created Linode will have private networking enabled, allowing use of the 192.168.128.0/17 network within the Linode's region. It can be enabled on an existing Linode but it can't be disabled.
PrivateIp *bool `pulumi:"privateIp"`
// This is the location where the Linode is deployed. Examples are `"us-east"`, `"us-west"`, `"ap-south"`, etc. See all regions [here](https://api.linode.com/v4/regions). *Changing `region` forces the creation of a new Linode Instance.*.
Region string `pulumi:"region"`
// The initial password for the `root` user account. *This value can not be imported.* *Changing `rootPass` forces the creation of a new Linode Instance.* *If omitted, a random password will be generated but will not be stored in state.*
RootPass *string `pulumi:"rootPass"`
// An object containing responses to any User Defined Fields present in the StackScript being deployed to this Linode. Only accepted if 'stackscript_id' is given. The required values depend on the StackScript being deployed. *This value can not be imported.* *Changing `stackscriptData` forces the creation of a new Linode Instance.*
StackscriptData map[string]interface{} `pulumi:"stackscriptData"`
// The StackScript to deploy to the newly created Linode. If provided, 'image' must also be provided, and must be an Image that is compatible with this StackScript. *This value can not be imported.* *Changing `stackscriptId` forces the creation of a new Linode Instance.*
StackscriptId *int `pulumi:"stackscriptId"`
// When deploying from an Image, this field is optional with a Linode API default of 512mb, otherwise it is ignored. This is used to set the swap disk size for the newly-created Linode.
SwapSize *int `pulumi:"swapSize"`
// A list of tags applied to this object. Tags are for organizational purposes only.
Tags []string `pulumi:"tags"`
// The Linode type defines the pricing, CPU, disk, and RAM specs of the instance. Examples are `"g6-nanode-1"`, `"g6-standard-2"`, `"g6-highmem-16"`, `"g6-dedicated-16"`, etc. See all types [here](https://api.linode.com/v4/linode/types).
Type *string `pulumi:"type"`
// The watchdog, named Lassie, is a Shutdown Watchdog that monitors your Linode and will reboot it if it powers off unexpectedly. It works by issuing a boot job when your Linode powers off without a shutdown job being responsible. To prevent a loop, Lassie will give up if there have been more than 5 boot jobs issued within 15 minutes.
WatchdogEnabled *bool `pulumi:"watchdogEnabled"`
}
// The set of arguments for constructing a Instance resource.
type InstanceArgs struct {
Alerts InstanceAlertsPtrInput
// A list of SSH public keys to deploy for the root user on the newly created Linode. Only accepted if `image` is provided. *This value can not be imported.* *Changing `authorizedKeys` forces the creation of a new Linode Instance.*
AuthorizedKeys pulumi.StringArrayInput
// A list of Linode usernames. If the usernames have associated SSH keys, the keys will be appended to the `root` user's `~/.ssh/authorized_keys` file automatically. *This value can not be imported.* *Changing `authorizedUsers` forces the creation of a new Linode Instance.*
AuthorizedUsers pulumi.StringArrayInput
// A Backup ID from another Linode's available backups. Your User must have readWrite access to that Linode, the Backup must have a status of successful, and the Linode must be deployed to the same region as the Backup. See /linode/instances/{linodeId}/backups for a Linode's available backups. This field and the image field are mutually exclusive. *This value can not be imported.* *Changing `backupId` forces the creation of a new Linode Instance.*
BackupId pulumi.IntPtrInput
// If this field is set to true, the created Linode will automatically be enrolled in the Linode Backup service. This will incur an additional charge. The cost for the Backup service is dependent on the Type of Linode deployed.
BackupsEnabled pulumi.BoolPtrInput
// The Label of the Instance Config that should be used to boot the Linode instance. If there is only one `config`, the `label` of that `config` will be used as the `bootConfigLabel`. *This value can not be imported.*
BootConfigLabel pulumi.StringPtrInput
// Configuration profiles define the VM settings and boot behavior of the Linode Instance.
Configs InstanceConfigArrayInput
Disks InstanceDiskArrayInput
// The display group of the Linode instance.
Group pulumi.StringPtrInput
// An Image ID to deploy the Disk from. Official Linode Images start with linode/, while your Images start with private/. See /images for more information on the Images available for you to use. Examples are `linode/debian9`, `linode/fedora28`, `linode/ubuntu16.04lts`, `linode/arch`, and `private/12345`. See all images [here](https://api.linode.com/v4/linode/kernels). *Changing `image` forces the creation of a new Linode Instance.*
Image pulumi.StringPtrInput
// The Config's label for display purposes. Also used by `bootConfigLabel`.
Label pulumi.StringPtrInput
// If true, the created Linode will have private networking enabled, allowing use of the 192.168.128.0/17 network within the Linode's region. It can be enabled on an existing Linode but it can't be disabled.
PrivateIp pulumi.BoolPtrInput
// This is the location where the Linode is deployed. Examples are `"us-east"`, `"us-west"`, `"ap-south"`, etc. See all regions [here](https://api.linode.com/v4/regions). *Changing `region` forces the creation of a new Linode Instance.*.
Region pulumi.StringInput
// The initial password for the `root` user account. *This value can not be imported.* *Changing `rootPass` forces the creation of a new Linode Instance.* *If omitted, a random password will be generated but will not be stored in state.*
RootPass pulumi.StringPtrInput
// An object containing responses to any User Defined Fields present in the StackScript being deployed to this Linode. Only accepted if 'stackscript_id' is given. The required values depend on the StackScript being deployed. *This value can not be imported.* *Changing `stackscriptData` forces the creation of a new Linode Instance.*
StackscriptData pulumi.MapInput
// The StackScript to deploy to the newly created Linode. If provided, 'image' must also be provided, and must be an Image that is compatible with this StackScript. *This value can not be imported.* *Changing `stackscriptId` forces the creation of a new Linode Instance.*
StackscriptId pulumi.IntPtrInput
// When deploying from an Image, this field is optional with a Linode API default of 512mb, otherwise it is ignored. This is used to set the swap disk size for the newly-created Linode.
SwapSize pulumi.IntPtrInput
// A list of tags applied to this object. Tags are for organizational purposes only.
Tags pulumi.StringArrayInput
// The Linode type defines the pricing, CPU, disk, and RAM specs of the instance. Examples are `"g6-nanode-1"`, `"g6-standard-2"`, `"g6-highmem-16"`, `"g6-dedicated-16"`, etc. See all types [here](https://api.linode.com/v4/linode/types).
Type pulumi.StringPtrInput
// The watchdog, named Lassie, is a Shutdown Watchdog that monitors your Linode and will reboot it if it powers off unexpectedly. It works by issuing a boot job when your Linode powers off without a shutdown job being responsible. To prevent a loop, Lassie will give up if there have been more than 5 boot jobs issued within 15 minutes.
WatchdogEnabled pulumi.BoolPtrInput
}
func (InstanceArgs) ElementType() reflect.Type {
return reflect.TypeOf((*instanceArgs)(nil)).Elem()
}
type InstanceInput interface {
pulumi.Input
ToInstanceOutput() InstanceOutput
ToInstanceOutputWithContext(ctx context.Context) InstanceOutput
}
func (*Instance) ElementType() reflect.Type {
return reflect.TypeOf((*Instance)(nil))
}
func (i *Instance) ToInstanceOutput() InstanceOutput {
return i.ToInstanceOutputWithContext(context.Background())
}
func (i *Instance) ToInstanceOutputWithContext(ctx context.Context) InstanceOutput {
return pulumi.ToOutputWithContext(ctx, i).(InstanceOutput)
}
func (i *Instance) ToInstancePtrOutput() InstancePtrOutput {
return i.ToInstancePtrOutputWithContext(context.Background())
}
func (i *Instance) ToInstancePtrOutputWithContext(ctx context.Context) InstancePtrOutput {
return pulumi.ToOutputWithContext(ctx, i).(InstancePtrOutput)
}
type InstancePtrInput interface {
pulumi.Input
ToInstancePtrOutput() InstancePtrOutput
ToInstancePtrOutputWithContext(ctx context.Context) InstancePtrOutput
}
type instancePtrType InstanceArgs
func (*instancePtrType) ElementType() reflect.Type {
return reflect.TypeOf((**Instance)(nil))
}
func (i *instancePtrType) ToInstancePtrOutput() InstancePtrOutput {
return i.ToInstancePtrOutputWithContext(context.Background())
}
func (i *instancePtrType) ToInstancePtrOutputWithContext(ctx context.Context) InstancePtrOutput {
return pulumi.ToOutputWithContext(ctx, i).(InstancePtrOutput)
}
// InstanceArrayInput is an input type that accepts InstanceArray and InstanceArrayOutput values.
// You can construct a concrete instance of `InstanceArrayInput` via:
//
// InstanceArray{ InstanceArgs{...} }
type InstanceArrayInput interface {
pulumi.Input
ToInstanceArrayOutput() InstanceArrayOutput
ToInstanceArrayOutputWithContext(context.Context) InstanceArrayOutput
}
type InstanceArray []InstanceInput
func (InstanceArray) ElementType() reflect.Type {
return reflect.TypeOf(([]*Instance)(nil))
}
func (i InstanceArray) ToInstanceArrayOutput() InstanceArrayOutput {
return i.ToInstanceArrayOutputWithContext(context.Background())
}
func (i InstanceArray) ToInstanceArrayOutputWithContext(ctx context.Context) InstanceArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(InstanceArrayOutput)
}
// InstanceMapInput is an input type that accepts InstanceMap and InstanceMapOutput values.
// You can construct a concrete instance of `InstanceMapInput` via:
//
// InstanceMap{ "key": InstanceArgs{...} }
type InstanceMapInput interface {
pulumi.Input
ToInstanceMapOutput() InstanceMapOutput
ToInstanceMapOutputWithContext(context.Context) InstanceMapOutput
}
type InstanceMap map[string]InstanceInput
func (InstanceMap) ElementType() reflect.Type {
return reflect.TypeOf((map[string]*Instance)(nil))
}
func (i InstanceMap) ToInstanceMapOutput() InstanceMapOutput {
return i.ToInstanceMapOutputWithContext(context.Background())
}
func (i InstanceMap) ToInstanceMapOutputWithContext(ctx context.Context) InstanceMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(InstanceMapOutput)
}
type InstanceOutput struct {
*pulumi.OutputState
}
func (InstanceOutput) ElementType() reflect.Type {
return reflect.TypeOf((*Instance)(nil))
}
func (o InstanceOutput) ToInstanceOutput() InstanceOutput {
return o
}
func (o InstanceOutput) ToInstanceOutputWithContext(ctx context.Context) InstanceOutput {
return o
}
func (o InstanceOutput) ToInstancePtrOutput() InstancePtrOutput {
return o.ToInstancePtrOutputWithContext(context.Background())
}
func (o InstanceOutput) ToInstancePtrOutputWithContext(ctx context.Context) InstancePtrOutput {
return o.ApplyT(func(v Instance) *Instance {
return &v
}).(InstancePtrOutput)
}
type InstancePtrOutput struct {
*pulumi.OutputState
}
func (InstancePtrOutput) ElementType() reflect.Type {
return reflect.TypeOf((**Instance)(nil))
}
func (o InstancePtrOutput) ToInstancePtrOutput() InstancePtrOutput {
return o
}
func (o InstancePtrOutput) ToInstancePtrOutputWithContext(ctx context.Context) InstancePtrOutput {
return o
}
type InstanceArrayOutput struct{ *pulumi.OutputState }
func (InstanceArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]Instance)(nil))
}
func (o InstanceArrayOutput) ToInstanceArrayOutput() InstanceArrayOutput {
return o
}
func (o InstanceArrayOutput) ToInstanceArrayOutputWithContext(ctx context.Context) InstanceArrayOutput {
return o
}
func (o InstanceArrayOutput) Index(i pulumi.IntInput) InstanceOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) Instance {
return vs[0].([]Instance)[vs[1].(int)]
}).(InstanceOutput)
}
type InstanceMapOutput struct{ *pulumi.OutputState }
func (InstanceMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]Instance)(nil))
}
func (o InstanceMapOutput) ToInstanceMapOutput() InstanceMapOutput {
return o
}
func (o InstanceMapOutput) ToInstanceMapOutputWithContext(ctx context.Context) InstanceMapOutput {
return o
}
func (o InstanceMapOutput) MapIndex(k pulumi.StringInput) InstanceOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) Instance {
return vs[0].(map[string]Instance)[vs[1].(string)]
}).(InstanceOutput)
}
func init() {
pulumi.RegisterOutputType(InstanceOutput{})
pulumi.RegisterOutputType(InstancePtrOutput{})
pulumi.RegisterOutputType(InstanceArrayOutput{})
pulumi.RegisterOutputType(InstanceMapOutput{})
}