/
runCommand.go
720 lines (660 loc) · 33 KB
/
runCommand.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
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
// Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package compute
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Manages a Virtual Machine Run Command.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "fmt"
//
// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/authorization"
// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/compute"
// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network"
// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// exampleResourceGroup, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
// Name: pulumi.String("example-resources"),
// Location: pulumi.String("West Europe"),
// })
// if err != nil {
// return err
// }
// exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "example", &network.VirtualNetworkArgs{
// Name: pulumi.String("example-vnet"),
// AddressSpaces: pulumi.StringArray{
// pulumi.String("10.0.0.0/16"),
// },
// Location: exampleResourceGroup.Location,
// ResourceGroupName: exampleResourceGroup.Name,
// })
// if err != nil {
// return err
// }
// exampleSubnet, err := network.NewSubnet(ctx, "example", &network.SubnetArgs{
// Name: pulumi.String("internal"),
// ResourceGroupName: exampleResourceGroup.Name,
// VirtualNetworkName: exampleVirtualNetwork.Name,
// AddressPrefixes: pulumi.StringArray{
// pulumi.String("10.0.2.0/24"),
// },
// })
// if err != nil {
// return err
// }
// exampleNetworkInterface, err := network.NewNetworkInterface(ctx, "example", &network.NetworkInterfaceArgs{
// Name: pulumi.String("example-nic"),
// Location: exampleResourceGroup.Location,
// ResourceGroupName: exampleResourceGroup.Name,
// IpConfigurations: network.NetworkInterfaceIpConfigurationArray{
// &network.NetworkInterfaceIpConfigurationArgs{
// Name: pulumi.String("internal"),
// SubnetId: exampleSubnet.ID(),
// PrivateIpAddressAllocation: pulumi.String("Dynamic"),
// },
// },
// })
// if err != nil {
// return err
// }
// exampleUserAssignedIdentity, err := authorization.NewUserAssignedIdentity(ctx, "example", &authorization.UserAssignedIdentityArgs{
// Name: pulumi.String("example-uai"),
// ResourceGroupName: exampleResourceGroup.Name,
// Location: exampleResourceGroup.Location,
// })
// if err != nil {
// return err
// }
// exampleLinuxVirtualMachine, err := compute.NewLinuxVirtualMachine(ctx, "example", &compute.LinuxVirtualMachineArgs{
// Name: pulumi.String("example-VM"),
// ResourceGroupName: exampleResourceGroup.Name,
// Location: exampleResourceGroup.Location,
// Size: pulumi.String("Standard_B2s"),
// AdminUsername: pulumi.String("adminuser"),
// AdminPassword: pulumi.String("P@$$w0rd1234!"),
// DisablePasswordAuthentication: pulumi.Bool(false),
// NetworkInterfaceIds: pulumi.StringArray{
// exampleNetworkInterface.ID(),
// },
// OsDisk: &compute.LinuxVirtualMachineOsDiskArgs{
// Caching: pulumi.String("ReadWrite"),
// StorageAccountType: pulumi.String("Premium_LRS"),
// },
// SourceImageReference: &compute.LinuxVirtualMachineSourceImageReferenceArgs{
// Publisher: pulumi.String("Canonical"),
// Offer: pulumi.String("0001-com-ubuntu-server-jammy"),
// Sku: pulumi.String("22_04-lts"),
// Version: pulumi.String("latest"),
// },
// Identity: &compute.LinuxVirtualMachineIdentityArgs{
// Type: pulumi.String("SystemAssigned, UserAssigned"),
// IdentityIds: pulumi.StringArray{
// exampleUserAssignedIdentity.ID(),
// },
// },
// })
// if err != nil {
// return err
// }
// exampleAccount, err := storage.NewAccount(ctx, "example", &storage.AccountArgs{
// Name: pulumi.String("exampleaccount"),
// ResourceGroupName: exampleResourceGroup.Name,
// Location: exampleResourceGroup.Location,
// AccountTier: pulumi.String("Standard"),
// AccountReplicationType: pulumi.String("LRS"),
// })
// if err != nil {
// return err
// }
// _, err = authorization.NewAssignment(ctx, "example", &authorization.AssignmentArgs{
// Scope: exampleAccount.ID(),
// RoleDefinitionName: pulumi.String("Storage Blob Data Contributor"),
// PrincipalId: exampleUserAssignedIdentity.PrincipalId,
// })
// if err != nil {
// return err
// }
// exampleContainer, err := storage.NewContainer(ctx, "example", &storage.ContainerArgs{
// Name: pulumi.String("example-sc"),
// StorageAccountName: exampleAccount.Name,
// ContainerAccessType: pulumi.String("blob"),
// })
// if err != nil {
// return err
// }
// example1, err := storage.NewBlob(ctx, "example1", &storage.BlobArgs{
// Name: pulumi.String("script1"),
// StorageAccountName: exampleAccount.Name,
// StorageContainerName: exampleContainer.Name,
// Type: pulumi.String("Block"),
// SourceContent: pulumi.String("echo 'hello world'"),
// })
// if err != nil {
// return err
// }
// example2, err := storage.NewBlob(ctx, "example2", &storage.BlobArgs{
// Name: pulumi.String("output"),
// StorageAccountName: exampleAccount.Name,
// StorageContainerName: exampleContainer.Name,
// Type: pulumi.String("Append"),
// })
// if err != nil {
// return err
// }
// example3, err := storage.NewBlob(ctx, "example3", &storage.BlobArgs{
// Name: pulumi.String("error"),
// StorageAccountName: exampleAccount.Name,
// StorageContainerName: exampleContainer.Name,
// Type: pulumi.String("Append"),
// })
// if err != nil {
// return err
// }
// example := storage.GetAccountSASOutput(ctx, storage.GetAccountSASOutputArgs{
// ConnectionString: exampleAccount.PrimaryConnectionString,
// HttpsOnly: pulumi.Bool(true),
// SignedVersion: pulumi.String("2019-10-10"),
// Start: pulumi.String("2023-04-01T00:00:00Z"),
// Expiry: pulumi.String("2024-04-01T00:00:00Z"),
// ResourceTypes: &storage.GetAccountSASResourceTypesArgs{
// Service: pulumi.Bool(false),
// Container: pulumi.Bool(false),
// Object: pulumi.Bool(true),
// },
// Services: &storage.GetAccountSASServicesArgs{
// Blob: pulumi.Bool(true),
// Queue: pulumi.Bool(false),
// Table: pulumi.Bool(false),
// File: pulumi.Bool(false),
// },
// Permissions: &storage.GetAccountSASPermissionsArgs{
// Read: pulumi.Bool(true),
// Write: pulumi.Bool(true),
// Delete: pulumi.Bool(false),
// List: pulumi.Bool(false),
// Add: pulumi.Bool(true),
// Create: pulumi.Bool(true),
// Update: pulumi.Bool(false),
// Process: pulumi.Bool(false),
// Tag: pulumi.Bool(false),
// Filter: pulumi.Bool(false),
// },
// }, nil)
// // basic example
// _, err = compute.NewRunCommand(ctx, "example", &compute.RunCommandArgs{
// Name: pulumi.String("example-vmrc"),
// Location: exampleResourceGroup.Location,
// VirtualMachineId: exampleLinuxVirtualMachine.ID(),
// Source: &compute.RunCommandSourceArgs{
// Script: pulumi.String("echo 'hello world'"),
// },
// })
// if err != nil {
// return err
// }
// // authorize to storage blob using user assigned identity
// _, err = compute.NewRunCommand(ctx, "example2", &compute.RunCommandArgs{
// Location: exampleResourceGroup.Location,
// Name: pulumi.String("example2-vmrc"),
// VirtualMachineId: exampleLinuxVirtualMachine.ID(),
// OutputBlobUri: example2.ID(),
// ErrorBlobUri: example3.ID(),
// RunAsPassword: pulumi.String("P@$$w0rd1234!"),
// RunAsUser: pulumi.String("adminuser"),
// Source: &compute.RunCommandSourceArgs{
// ScriptUri: example1.ID(),
// ScriptUriManagedIdentity: &compute.RunCommandSourceScriptUriManagedIdentityArgs{
// ClientId: exampleUserAssignedIdentity.ClientId,
// },
// },
// ErrorBlobManagedIdentity: &compute.RunCommandErrorBlobManagedIdentityArgs{
// ClientId: exampleUserAssignedIdentity.ClientId,
// },
// OutputBlobManagedIdentity: &compute.RunCommandOutputBlobManagedIdentityArgs{
// ClientId: exampleUserAssignedIdentity.ClientId,
// },
// Parameters: compute.RunCommandParameterArray{
// &compute.RunCommandParameterArgs{
// Name: pulumi.String("examplev1"),
// Value: pulumi.String("val1"),
// },
// },
// ProtectedParameters: compute.RunCommandProtectedParameterArray{
// &compute.RunCommandProtectedParameterArgs{
// Name: pulumi.String("examplev2"),
// Value: pulumi.String("val2"),
// },
// },
// Tags: pulumi.StringMap{
// "environment": pulumi.String("terraform-examples"),
// "some_key": pulumi.String("some-value"),
// },
// })
// if err != nil {
// return err
// }
// // authorize to storage blob using SAS token
// _, err = compute.NewRunCommand(ctx, "example3", &compute.RunCommandArgs{
// Location: exampleResourceGroup.Location,
// Name: pulumi.String("example3-vmrc"),
// VirtualMachineId: exampleLinuxVirtualMachine.ID(),
// RunAsPassword: pulumi.String("P@$$w0rd1234!"),
// RunAsUser: pulumi.String("adminuser"),
// ErrorBlobUri: pulumi.All(example3.ID(), example).ApplyT(func(_args []interface{}) (string, error) {
// id := _args[0].(string)
// example := _args[1].(storage.GetAccountSASResult)
// return fmt.Sprintf("%v%v", id, example.Sas), nil
// }).(pulumi.StringOutput),
// OutputBlobUri: pulumi.All(example2.ID(), example).ApplyT(func(_args []interface{}) (string, error) {
// id := _args[0].(string)
// example := _args[1].(storage.GetAccountSASResult)
// return fmt.Sprintf("%v%v", id, example.Sas), nil
// }).(pulumi.StringOutput),
// Source: &compute.RunCommandSourceArgs{
// ScriptUri: pulumi.All(example1.ID(), example).ApplyT(func(_args []interface{}) (string, error) {
// id := _args[0].(string)
// example := _args[1].(storage.GetAccountSASResult)
// return fmt.Sprintf("%v%v", id, example.Sas), nil
// }).(pulumi.StringOutput),
// },
// Parameters: compute.RunCommandParameterArray{
// &compute.RunCommandParameterArgs{
// Name: pulumi.String("example-vm1"),
// Value: pulumi.String("val1"),
// },
// },
// Tags: pulumi.StringMap{
// "environment": pulumi.String("terraform-example-s"),
// "some_key": pulumi.String("some-value"),
// },
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## Import
//
// An existing Virtual Machine Run Command can be imported into Terraform using the `resource id`, e.g.
//
// ```sh
// $ pulumi import azure:compute/runCommand:RunCommand example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Compute/virtualMachines/vm1/runCommands/rc1
// ```
type RunCommand struct {
pulumi.CustomResourceState
// An `errorBlobManagedIdentity` block as defined below. User-assigned managed Identity that has access to errorBlobUri storage blob.
ErrorBlobManagedIdentity RunCommandErrorBlobManagedIdentityPtrOutput `pulumi:"errorBlobManagedIdentity"`
// Specifies the Azure storage blob where script error stream will be uploaded.
ErrorBlobUri pulumi.StringPtrOutput `pulumi:"errorBlobUri"`
InstanceViews RunCommandInstanceViewArrayOutput `pulumi:"instanceViews"`
// The Azure Region where the Virtual Machine Run Command should exist. Changing this forces a new Virtual Machine Run Command to be created.
Location pulumi.StringOutput `pulumi:"location"`
// Specifies the name of this Virtual Machine Run Command. Changing this forces a new Virtual Machine Run Command to be created.
Name pulumi.StringOutput `pulumi:"name"`
// An `outputBlobManagedIdentity` block as defined below. User-assigned managed Identity that has access to outputBlobUri storage blob.
OutputBlobManagedIdentity RunCommandOutputBlobManagedIdentityPtrOutput `pulumi:"outputBlobManagedIdentity"`
// Specifies the Azure storage blob where script output stream will be uploaded. It can be basic blob URI with SAS token.
OutputBlobUri pulumi.StringPtrOutput `pulumi:"outputBlobUri"`
// A list of `parameter` blocks as defined below. The parameters used by the script.
Parameters RunCommandParameterArrayOutput `pulumi:"parameters"`
// A list of `protectedParameter` blocks as defined below. The protected parameters used by the script.
ProtectedParameters RunCommandProtectedParameterArrayOutput `pulumi:"protectedParameters"`
// Specifies the user account password on the VM when executing the Virtual Machine Run Command.
RunAsPassword pulumi.StringPtrOutput `pulumi:"runAsPassword"`
// Specifies the user account on the VM when executing the Virtual Machine Run Command.
RunAsUser pulumi.StringPtrOutput `pulumi:"runAsUser"`
// A `source` block as defined below. The source of the run command script.
Source RunCommandSourceOutput `pulumi:"source"`
// A mapping of tags which should be assigned to the Virtual Machine Run Command.
Tags pulumi.StringMapOutput `pulumi:"tags"`
// Specifies the Virtual Machine ID within which this Virtual Machine Run Command should exist. Changing this forces a new Virtual Machine Run Command to be created.
VirtualMachineId pulumi.StringOutput `pulumi:"virtualMachineId"`
}
// NewRunCommand registers a new resource with the given unique name, arguments, and options.
func NewRunCommand(ctx *pulumi.Context,
name string, args *RunCommandArgs, opts ...pulumi.ResourceOption) (*RunCommand, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.Source == nil {
return nil, errors.New("invalid value for required argument 'Source'")
}
if args.VirtualMachineId == nil {
return nil, errors.New("invalid value for required argument 'VirtualMachineId'")
}
if args.ErrorBlobManagedIdentity != nil {
args.ErrorBlobManagedIdentity = pulumi.ToSecret(args.ErrorBlobManagedIdentity).(RunCommandErrorBlobManagedIdentityPtrInput)
}
if args.OutputBlobManagedIdentity != nil {
args.OutputBlobManagedIdentity = pulumi.ToSecret(args.OutputBlobManagedIdentity).(RunCommandOutputBlobManagedIdentityPtrInput)
}
if args.ProtectedParameters != nil {
args.ProtectedParameters = pulumi.ToSecret(args.ProtectedParameters).(RunCommandProtectedParameterArrayInput)
}
if args.RunAsPassword != nil {
args.RunAsPassword = pulumi.ToSecret(args.RunAsPassword).(pulumi.StringPtrInput)
}
secrets := pulumi.AdditionalSecretOutputs([]string{
"errorBlobManagedIdentity",
"outputBlobManagedIdentity",
"protectedParameters",
"runAsPassword",
})
opts = append(opts, secrets)
opts = internal.PkgResourceDefaultOpts(opts)
var resource RunCommand
err := ctx.RegisterResource("azure:compute/runCommand:RunCommand", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetRunCommand gets an existing RunCommand 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 GetRunCommand(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *RunCommandState, opts ...pulumi.ResourceOption) (*RunCommand, error) {
var resource RunCommand
err := ctx.ReadResource("azure:compute/runCommand:RunCommand", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering RunCommand resources.
type runCommandState struct {
// An `errorBlobManagedIdentity` block as defined below. User-assigned managed Identity that has access to errorBlobUri storage blob.
ErrorBlobManagedIdentity *RunCommandErrorBlobManagedIdentity `pulumi:"errorBlobManagedIdentity"`
// Specifies the Azure storage blob where script error stream will be uploaded.
ErrorBlobUri *string `pulumi:"errorBlobUri"`
InstanceViews []RunCommandInstanceView `pulumi:"instanceViews"`
// The Azure Region where the Virtual Machine Run Command should exist. Changing this forces a new Virtual Machine Run Command to be created.
Location *string `pulumi:"location"`
// Specifies the name of this Virtual Machine Run Command. Changing this forces a new Virtual Machine Run Command to be created.
Name *string `pulumi:"name"`
// An `outputBlobManagedIdentity` block as defined below. User-assigned managed Identity that has access to outputBlobUri storage blob.
OutputBlobManagedIdentity *RunCommandOutputBlobManagedIdentity `pulumi:"outputBlobManagedIdentity"`
// Specifies the Azure storage blob where script output stream will be uploaded. It can be basic blob URI with SAS token.
OutputBlobUri *string `pulumi:"outputBlobUri"`
// A list of `parameter` blocks as defined below. The parameters used by the script.
Parameters []RunCommandParameter `pulumi:"parameters"`
// A list of `protectedParameter` blocks as defined below. The protected parameters used by the script.
ProtectedParameters []RunCommandProtectedParameter `pulumi:"protectedParameters"`
// Specifies the user account password on the VM when executing the Virtual Machine Run Command.
RunAsPassword *string `pulumi:"runAsPassword"`
// Specifies the user account on the VM when executing the Virtual Machine Run Command.
RunAsUser *string `pulumi:"runAsUser"`
// A `source` block as defined below. The source of the run command script.
Source *RunCommandSource `pulumi:"source"`
// A mapping of tags which should be assigned to the Virtual Machine Run Command.
Tags map[string]string `pulumi:"tags"`
// Specifies the Virtual Machine ID within which this Virtual Machine Run Command should exist. Changing this forces a new Virtual Machine Run Command to be created.
VirtualMachineId *string `pulumi:"virtualMachineId"`
}
type RunCommandState struct {
// An `errorBlobManagedIdentity` block as defined below. User-assigned managed Identity that has access to errorBlobUri storage blob.
ErrorBlobManagedIdentity RunCommandErrorBlobManagedIdentityPtrInput
// Specifies the Azure storage blob where script error stream will be uploaded.
ErrorBlobUri pulumi.StringPtrInput
InstanceViews RunCommandInstanceViewArrayInput
// The Azure Region where the Virtual Machine Run Command should exist. Changing this forces a new Virtual Machine Run Command to be created.
Location pulumi.StringPtrInput
// Specifies the name of this Virtual Machine Run Command. Changing this forces a new Virtual Machine Run Command to be created.
Name pulumi.StringPtrInput
// An `outputBlobManagedIdentity` block as defined below. User-assigned managed Identity that has access to outputBlobUri storage blob.
OutputBlobManagedIdentity RunCommandOutputBlobManagedIdentityPtrInput
// Specifies the Azure storage blob where script output stream will be uploaded. It can be basic blob URI with SAS token.
OutputBlobUri pulumi.StringPtrInput
// A list of `parameter` blocks as defined below. The parameters used by the script.
Parameters RunCommandParameterArrayInput
// A list of `protectedParameter` blocks as defined below. The protected parameters used by the script.
ProtectedParameters RunCommandProtectedParameterArrayInput
// Specifies the user account password on the VM when executing the Virtual Machine Run Command.
RunAsPassword pulumi.StringPtrInput
// Specifies the user account on the VM when executing the Virtual Machine Run Command.
RunAsUser pulumi.StringPtrInput
// A `source` block as defined below. The source of the run command script.
Source RunCommandSourcePtrInput
// A mapping of tags which should be assigned to the Virtual Machine Run Command.
Tags pulumi.StringMapInput
// Specifies the Virtual Machine ID within which this Virtual Machine Run Command should exist. Changing this forces a new Virtual Machine Run Command to be created.
VirtualMachineId pulumi.StringPtrInput
}
func (RunCommandState) ElementType() reflect.Type {
return reflect.TypeOf((*runCommandState)(nil)).Elem()
}
type runCommandArgs struct {
// An `errorBlobManagedIdentity` block as defined below. User-assigned managed Identity that has access to errorBlobUri storage blob.
ErrorBlobManagedIdentity *RunCommandErrorBlobManagedIdentity `pulumi:"errorBlobManagedIdentity"`
// Specifies the Azure storage blob where script error stream will be uploaded.
ErrorBlobUri *string `pulumi:"errorBlobUri"`
// The Azure Region where the Virtual Machine Run Command should exist. Changing this forces a new Virtual Machine Run Command to be created.
Location *string `pulumi:"location"`
// Specifies the name of this Virtual Machine Run Command. Changing this forces a new Virtual Machine Run Command to be created.
Name *string `pulumi:"name"`
// An `outputBlobManagedIdentity` block as defined below. User-assigned managed Identity that has access to outputBlobUri storage blob.
OutputBlobManagedIdentity *RunCommandOutputBlobManagedIdentity `pulumi:"outputBlobManagedIdentity"`
// Specifies the Azure storage blob where script output stream will be uploaded. It can be basic blob URI with SAS token.
OutputBlobUri *string `pulumi:"outputBlobUri"`
// A list of `parameter` blocks as defined below. The parameters used by the script.
Parameters []RunCommandParameter `pulumi:"parameters"`
// A list of `protectedParameter` blocks as defined below. The protected parameters used by the script.
ProtectedParameters []RunCommandProtectedParameter `pulumi:"protectedParameters"`
// Specifies the user account password on the VM when executing the Virtual Machine Run Command.
RunAsPassword *string `pulumi:"runAsPassword"`
// Specifies the user account on the VM when executing the Virtual Machine Run Command.
RunAsUser *string `pulumi:"runAsUser"`
// A `source` block as defined below. The source of the run command script.
Source RunCommandSource `pulumi:"source"`
// A mapping of tags which should be assigned to the Virtual Machine Run Command.
Tags map[string]string `pulumi:"tags"`
// Specifies the Virtual Machine ID within which this Virtual Machine Run Command should exist. Changing this forces a new Virtual Machine Run Command to be created.
VirtualMachineId string `pulumi:"virtualMachineId"`
}
// The set of arguments for constructing a RunCommand resource.
type RunCommandArgs struct {
// An `errorBlobManagedIdentity` block as defined below. User-assigned managed Identity that has access to errorBlobUri storage blob.
ErrorBlobManagedIdentity RunCommandErrorBlobManagedIdentityPtrInput
// Specifies the Azure storage blob where script error stream will be uploaded.
ErrorBlobUri pulumi.StringPtrInput
// The Azure Region where the Virtual Machine Run Command should exist. Changing this forces a new Virtual Machine Run Command to be created.
Location pulumi.StringPtrInput
// Specifies the name of this Virtual Machine Run Command. Changing this forces a new Virtual Machine Run Command to be created.
Name pulumi.StringPtrInput
// An `outputBlobManagedIdentity` block as defined below. User-assigned managed Identity that has access to outputBlobUri storage blob.
OutputBlobManagedIdentity RunCommandOutputBlobManagedIdentityPtrInput
// Specifies the Azure storage blob where script output stream will be uploaded. It can be basic blob URI with SAS token.
OutputBlobUri pulumi.StringPtrInput
// A list of `parameter` blocks as defined below. The parameters used by the script.
Parameters RunCommandParameterArrayInput
// A list of `protectedParameter` blocks as defined below. The protected parameters used by the script.
ProtectedParameters RunCommandProtectedParameterArrayInput
// Specifies the user account password on the VM when executing the Virtual Machine Run Command.
RunAsPassword pulumi.StringPtrInput
// Specifies the user account on the VM when executing the Virtual Machine Run Command.
RunAsUser pulumi.StringPtrInput
// A `source` block as defined below. The source of the run command script.
Source RunCommandSourceInput
// A mapping of tags which should be assigned to the Virtual Machine Run Command.
Tags pulumi.StringMapInput
// Specifies the Virtual Machine ID within which this Virtual Machine Run Command should exist. Changing this forces a new Virtual Machine Run Command to be created.
VirtualMachineId pulumi.StringInput
}
func (RunCommandArgs) ElementType() reflect.Type {
return reflect.TypeOf((*runCommandArgs)(nil)).Elem()
}
type RunCommandInput interface {
pulumi.Input
ToRunCommandOutput() RunCommandOutput
ToRunCommandOutputWithContext(ctx context.Context) RunCommandOutput
}
func (*RunCommand) ElementType() reflect.Type {
return reflect.TypeOf((**RunCommand)(nil)).Elem()
}
func (i *RunCommand) ToRunCommandOutput() RunCommandOutput {
return i.ToRunCommandOutputWithContext(context.Background())
}
func (i *RunCommand) ToRunCommandOutputWithContext(ctx context.Context) RunCommandOutput {
return pulumi.ToOutputWithContext(ctx, i).(RunCommandOutput)
}
// RunCommandArrayInput is an input type that accepts RunCommandArray and RunCommandArrayOutput values.
// You can construct a concrete instance of `RunCommandArrayInput` via:
//
// RunCommandArray{ RunCommandArgs{...} }
type RunCommandArrayInput interface {
pulumi.Input
ToRunCommandArrayOutput() RunCommandArrayOutput
ToRunCommandArrayOutputWithContext(context.Context) RunCommandArrayOutput
}
type RunCommandArray []RunCommandInput
func (RunCommandArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*RunCommand)(nil)).Elem()
}
func (i RunCommandArray) ToRunCommandArrayOutput() RunCommandArrayOutput {
return i.ToRunCommandArrayOutputWithContext(context.Background())
}
func (i RunCommandArray) ToRunCommandArrayOutputWithContext(ctx context.Context) RunCommandArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(RunCommandArrayOutput)
}
// RunCommandMapInput is an input type that accepts RunCommandMap and RunCommandMapOutput values.
// You can construct a concrete instance of `RunCommandMapInput` via:
//
// RunCommandMap{ "key": RunCommandArgs{...} }
type RunCommandMapInput interface {
pulumi.Input
ToRunCommandMapOutput() RunCommandMapOutput
ToRunCommandMapOutputWithContext(context.Context) RunCommandMapOutput
}
type RunCommandMap map[string]RunCommandInput
func (RunCommandMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*RunCommand)(nil)).Elem()
}
func (i RunCommandMap) ToRunCommandMapOutput() RunCommandMapOutput {
return i.ToRunCommandMapOutputWithContext(context.Background())
}
func (i RunCommandMap) ToRunCommandMapOutputWithContext(ctx context.Context) RunCommandMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(RunCommandMapOutput)
}
type RunCommandOutput struct{ *pulumi.OutputState }
func (RunCommandOutput) ElementType() reflect.Type {
return reflect.TypeOf((**RunCommand)(nil)).Elem()
}
func (o RunCommandOutput) ToRunCommandOutput() RunCommandOutput {
return o
}
func (o RunCommandOutput) ToRunCommandOutputWithContext(ctx context.Context) RunCommandOutput {
return o
}
// An `errorBlobManagedIdentity` block as defined below. User-assigned managed Identity that has access to errorBlobUri storage blob.
func (o RunCommandOutput) ErrorBlobManagedIdentity() RunCommandErrorBlobManagedIdentityPtrOutput {
return o.ApplyT(func(v *RunCommand) RunCommandErrorBlobManagedIdentityPtrOutput { return v.ErrorBlobManagedIdentity }).(RunCommandErrorBlobManagedIdentityPtrOutput)
}
// Specifies the Azure storage blob where script error stream will be uploaded.
func (o RunCommandOutput) ErrorBlobUri() pulumi.StringPtrOutput {
return o.ApplyT(func(v *RunCommand) pulumi.StringPtrOutput { return v.ErrorBlobUri }).(pulumi.StringPtrOutput)
}
func (o RunCommandOutput) InstanceViews() RunCommandInstanceViewArrayOutput {
return o.ApplyT(func(v *RunCommand) RunCommandInstanceViewArrayOutput { return v.InstanceViews }).(RunCommandInstanceViewArrayOutput)
}
// The Azure Region where the Virtual Machine Run Command should exist. Changing this forces a new Virtual Machine Run Command to be created.
func (o RunCommandOutput) Location() pulumi.StringOutput {
return o.ApplyT(func(v *RunCommand) pulumi.StringOutput { return v.Location }).(pulumi.StringOutput)
}
// Specifies the name of this Virtual Machine Run Command. Changing this forces a new Virtual Machine Run Command to be created.
func (o RunCommandOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *RunCommand) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// An `outputBlobManagedIdentity` block as defined below. User-assigned managed Identity that has access to outputBlobUri storage blob.
func (o RunCommandOutput) OutputBlobManagedIdentity() RunCommandOutputBlobManagedIdentityPtrOutput {
return o.ApplyT(func(v *RunCommand) RunCommandOutputBlobManagedIdentityPtrOutput { return v.OutputBlobManagedIdentity }).(RunCommandOutputBlobManagedIdentityPtrOutput)
}
// Specifies the Azure storage blob where script output stream will be uploaded. It can be basic blob URI with SAS token.
func (o RunCommandOutput) OutputBlobUri() pulumi.StringPtrOutput {
return o.ApplyT(func(v *RunCommand) pulumi.StringPtrOutput { return v.OutputBlobUri }).(pulumi.StringPtrOutput)
}
// A list of `parameter` blocks as defined below. The parameters used by the script.
func (o RunCommandOutput) Parameters() RunCommandParameterArrayOutput {
return o.ApplyT(func(v *RunCommand) RunCommandParameterArrayOutput { return v.Parameters }).(RunCommandParameterArrayOutput)
}
// A list of `protectedParameter` blocks as defined below. The protected parameters used by the script.
func (o RunCommandOutput) ProtectedParameters() RunCommandProtectedParameterArrayOutput {
return o.ApplyT(func(v *RunCommand) RunCommandProtectedParameterArrayOutput { return v.ProtectedParameters }).(RunCommandProtectedParameterArrayOutput)
}
// Specifies the user account password on the VM when executing the Virtual Machine Run Command.
func (o RunCommandOutput) RunAsPassword() pulumi.StringPtrOutput {
return o.ApplyT(func(v *RunCommand) pulumi.StringPtrOutput { return v.RunAsPassword }).(pulumi.StringPtrOutput)
}
// Specifies the user account on the VM when executing the Virtual Machine Run Command.
func (o RunCommandOutput) RunAsUser() pulumi.StringPtrOutput {
return o.ApplyT(func(v *RunCommand) pulumi.StringPtrOutput { return v.RunAsUser }).(pulumi.StringPtrOutput)
}
// A `source` block as defined below. The source of the run command script.
func (o RunCommandOutput) Source() RunCommandSourceOutput {
return o.ApplyT(func(v *RunCommand) RunCommandSourceOutput { return v.Source }).(RunCommandSourceOutput)
}
// A mapping of tags which should be assigned to the Virtual Machine Run Command.
func (o RunCommandOutput) Tags() pulumi.StringMapOutput {
return o.ApplyT(func(v *RunCommand) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
}
// Specifies the Virtual Machine ID within which this Virtual Machine Run Command should exist. Changing this forces a new Virtual Machine Run Command to be created.
func (o RunCommandOutput) VirtualMachineId() pulumi.StringOutput {
return o.ApplyT(func(v *RunCommand) pulumi.StringOutput { return v.VirtualMachineId }).(pulumi.StringOutput)
}
type RunCommandArrayOutput struct{ *pulumi.OutputState }
func (RunCommandArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*RunCommand)(nil)).Elem()
}
func (o RunCommandArrayOutput) ToRunCommandArrayOutput() RunCommandArrayOutput {
return o
}
func (o RunCommandArrayOutput) ToRunCommandArrayOutputWithContext(ctx context.Context) RunCommandArrayOutput {
return o
}
func (o RunCommandArrayOutput) Index(i pulumi.IntInput) RunCommandOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *RunCommand {
return vs[0].([]*RunCommand)[vs[1].(int)]
}).(RunCommandOutput)
}
type RunCommandMapOutput struct{ *pulumi.OutputState }
func (RunCommandMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*RunCommand)(nil)).Elem()
}
func (o RunCommandMapOutput) ToRunCommandMapOutput() RunCommandMapOutput {
return o
}
func (o RunCommandMapOutput) ToRunCommandMapOutputWithContext(ctx context.Context) RunCommandMapOutput {
return o
}
func (o RunCommandMapOutput) MapIndex(k pulumi.StringInput) RunCommandOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *RunCommand {
return vs[0].(map[string]*RunCommand)[vs[1].(string)]
}).(RunCommandOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*RunCommandInput)(nil)).Elem(), &RunCommand{})
pulumi.RegisterInputType(reflect.TypeOf((*RunCommandArrayInput)(nil)).Elem(), RunCommandArray{})
pulumi.RegisterInputType(reflect.TypeOf((*RunCommandMapInput)(nil)).Elem(), RunCommandMap{})
pulumi.RegisterOutputType(RunCommandOutput{})
pulumi.RegisterOutputType(RunCommandArrayOutput{})
pulumi.RegisterOutputType(RunCommandMapOutput{})
}