/
diskEncryptionSet.go
647 lines (591 loc) · 30.2 KB
/
diskEncryptionSet.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
// 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 Disk Encryption Set.
//
// > **NOTE:** At this time the Key Vault used to store the Active Key for this Disk Encryption Set must have both Soft Delete & Purge Protection enabled - which are not yet supported by this provider.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "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/keyvault"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// current, err := core.GetClientConfig(ctx, nil, nil)
// if err != nil {
// return err
// }
// example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
// Name: pulumi.String("example-resources"),
// Location: pulumi.String("West Europe"),
// })
// if err != nil {
// return err
// }
// exampleKeyVault, err := keyvault.NewKeyVault(ctx, "example", &keyvault.KeyVaultArgs{
// Name: pulumi.String("des-example-keyvault"),
// Location: example.Location,
// ResourceGroupName: example.Name,
// TenantId: pulumi.String(current.TenantId),
// SkuName: pulumi.String("premium"),
// EnabledForDiskEncryption: pulumi.Bool(true),
// PurgeProtectionEnabled: pulumi.Bool(true),
// })
// if err != nil {
// return err
// }
// exampleKey, err := keyvault.NewKey(ctx, "example", &keyvault.KeyArgs{
// Name: pulumi.String("des-example-key"),
// KeyVaultId: exampleKeyVault.ID(),
// KeyType: pulumi.String("RSA"),
// KeySize: pulumi.Int(2048),
// KeyOpts: pulumi.StringArray{
// pulumi.String("decrypt"),
// pulumi.String("encrypt"),
// pulumi.String("sign"),
// pulumi.String("unwrapKey"),
// pulumi.String("verify"),
// pulumi.String("wrapKey"),
// },
// })
// if err != nil {
// return err
// }
// exampleDiskEncryptionSet, err := compute.NewDiskEncryptionSet(ctx, "example", &compute.DiskEncryptionSetArgs{
// Name: pulumi.String("des"),
// ResourceGroupName: example.Name,
// Location: example.Location,
// KeyVaultKeyId: exampleKey.ID(),
// Identity: &compute.DiskEncryptionSetIdentityArgs{
// Type: pulumi.String("SystemAssigned"),
// },
// })
// if err != nil {
// return err
// }
// _, err = keyvault.NewAccessPolicy(ctx, "example-disk", &keyvault.AccessPolicyArgs{
// KeyVaultId: exampleKeyVault.ID(),
// TenantId: exampleDiskEncryptionSet.Identity.ApplyT(func(identity compute.DiskEncryptionSetIdentity) (*string, error) {
// return &identity.TenantId, nil
// }).(pulumi.StringPtrOutput),
// ObjectId: exampleDiskEncryptionSet.Identity.ApplyT(func(identity compute.DiskEncryptionSetIdentity) (*string, error) {
// return &identity.PrincipalId, nil
// }).(pulumi.StringPtrOutput),
// KeyPermissions: pulumi.StringArray{
// pulumi.String("Create"),
// pulumi.String("Delete"),
// pulumi.String("Get"),
// pulumi.String("Purge"),
// pulumi.String("Recover"),
// pulumi.String("Update"),
// pulumi.String("List"),
// pulumi.String("Decrypt"),
// pulumi.String("Sign"),
// },
// })
// if err != nil {
// return err
// }
// _, err = keyvault.NewAccessPolicy(ctx, "example-user", &keyvault.AccessPolicyArgs{
// KeyVaultId: exampleKeyVault.ID(),
// TenantId: pulumi.String(current.TenantId),
// ObjectId: pulumi.String(current.ObjectId),
// KeyPermissions: pulumi.StringArray{
// pulumi.String("Create"),
// pulumi.String("Delete"),
// pulumi.String("Get"),
// pulumi.String("Purge"),
// pulumi.String("Recover"),
// pulumi.String("Update"),
// pulumi.String("List"),
// pulumi.String("Decrypt"),
// pulumi.String("Sign"),
// pulumi.String("GetRotationPolicy"),
// },
// })
// if err != nil {
// return err
// }
// _, err = authorization.NewAssignment(ctx, "example-disk", &authorization.AssignmentArgs{
// Scope: exampleKeyVault.ID(),
// RoleDefinitionName: pulumi.String("Key Vault Crypto Service Encryption User"),
// PrincipalId: exampleDiskEncryptionSet.Identity.ApplyT(func(identity compute.DiskEncryptionSetIdentity) (*string, error) {
// return &identity.PrincipalId, nil
// }).(pulumi.StringPtrOutput),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ### With Automatic Key Rotation Enabled
//
// ```go
// package main
//
// import (
//
// "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/keyvault"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// current, err := core.GetClientConfig(ctx, nil, nil)
// if err != nil {
// return err
// }
// example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
// Name: pulumi.String("example-resources"),
// Location: pulumi.String("West Europe"),
// })
// if err != nil {
// return err
// }
// exampleKeyVault, err := keyvault.NewKeyVault(ctx, "example", &keyvault.KeyVaultArgs{
// Name: pulumi.String("des-example-keyvault"),
// Location: example.Location,
// ResourceGroupName: example.Name,
// TenantId: pulumi.String(current.TenantId),
// SkuName: pulumi.String("premium"),
// EnabledForDiskEncryption: pulumi.Bool(true),
// PurgeProtectionEnabled: pulumi.Bool(true),
// })
// if err != nil {
// return err
// }
// exampleKey, err := keyvault.NewKey(ctx, "example", &keyvault.KeyArgs{
// Name: pulumi.String("des-example-key"),
// KeyVaultId: exampleKeyVault.ID(),
// KeyType: pulumi.String("RSA"),
// KeySize: pulumi.Int(2048),
// KeyOpts: pulumi.StringArray{
// pulumi.String("decrypt"),
// pulumi.String("encrypt"),
// pulumi.String("sign"),
// pulumi.String("unwrapKey"),
// pulumi.String("verify"),
// pulumi.String("wrapKey"),
// },
// })
// if err != nil {
// return err
// }
// exampleDiskEncryptionSet, err := compute.NewDiskEncryptionSet(ctx, "example", &compute.DiskEncryptionSetArgs{
// Name: pulumi.String("des"),
// ResourceGroupName: example.Name,
// Location: example.Location,
// KeyVaultKeyId: exampleKey.VersionlessId,
// AutoKeyRotationEnabled: pulumi.Bool(true),
// Identity: &compute.DiskEncryptionSetIdentityArgs{
// Type: pulumi.String("SystemAssigned"),
// },
// })
// if err != nil {
// return err
// }
// _, err = keyvault.NewAccessPolicy(ctx, "example-disk", &keyvault.AccessPolicyArgs{
// KeyVaultId: exampleKeyVault.ID(),
// TenantId: exampleDiskEncryptionSet.Identity.ApplyT(func(identity compute.DiskEncryptionSetIdentity) (*string, error) {
// return &identity.TenantId, nil
// }).(pulumi.StringPtrOutput),
// ObjectId: exampleDiskEncryptionSet.Identity.ApplyT(func(identity compute.DiskEncryptionSetIdentity) (*string, error) {
// return &identity.PrincipalId, nil
// }).(pulumi.StringPtrOutput),
// KeyPermissions: pulumi.StringArray{
// pulumi.String("Create"),
// pulumi.String("Delete"),
// pulumi.String("Get"),
// pulumi.String("Purge"),
// pulumi.String("Recover"),
// pulumi.String("Update"),
// pulumi.String("List"),
// pulumi.String("Decrypt"),
// pulumi.String("Sign"),
// },
// })
// if err != nil {
// return err
// }
// _, err = keyvault.NewAccessPolicy(ctx, "example-user", &keyvault.AccessPolicyArgs{
// KeyVaultId: exampleKeyVault.ID(),
// TenantId: pulumi.String(current.TenantId),
// ObjectId: pulumi.String(current.ObjectId),
// KeyPermissions: pulumi.StringArray{
// pulumi.String("Create"),
// pulumi.String("Delete"),
// pulumi.String("Get"),
// pulumi.String("Purge"),
// pulumi.String("Recover"),
// pulumi.String("Update"),
// pulumi.String("List"),
// pulumi.String("Decrypt"),
// pulumi.String("Sign"),
// pulumi.String("GetRotationPolicy"),
// },
// })
// if err != nil {
// return err
// }
// _, err = authorization.NewAssignment(ctx, "example-disk", &authorization.AssignmentArgs{
// Scope: exampleKeyVault.ID(),
// RoleDefinitionName: pulumi.String("Key Vault Crypto Service Encryption User"),
// PrincipalId: exampleDiskEncryptionSet.Identity.ApplyT(func(identity compute.DiskEncryptionSetIdentity) (*string, error) {
// return &identity.PrincipalId, nil
// }).(pulumi.StringPtrOutput),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## Import
//
// Disk Encryption Sets can be imported using the `resource id`, e.g.
//
// ```sh
// $ pulumi import azure:compute/diskEncryptionSet:DiskEncryptionSet example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Compute/diskEncryptionSets/encryptionSet1
// ```
type DiskEncryptionSet struct {
pulumi.CustomResourceState
AutoKeyRotationEnabled pulumi.BoolPtrOutput `pulumi:"autoKeyRotationEnabled"`
// The type of key used to encrypt the data of the disk. Possible values are `EncryptionAtRestWithCustomerKey`, `EncryptionAtRestWithPlatformAndCustomerKeys` and `ConfidentialVmEncryptedWithCustomerKey`. Defaults to `EncryptionAtRestWithCustomerKey`. Changing this forces a new resource to be created.
EncryptionType pulumi.StringPtrOutput `pulumi:"encryptionType"`
// Multi-tenant application client id to access key vault in a different tenant.
FederatedClientId pulumi.StringPtrOutput `pulumi:"federatedClientId"`
// An `identity` block as defined below.
Identity DiskEncryptionSetIdentityOutput `pulumi:"identity"`
// Specifies the URL to a Key Vault Key (either from a Key Vault Key, or the Key URL for the Key Vault Secret).
//
// > **NOTE** Access to the KeyVault must be granted for this Disk Encryption Set, if you want to further use this Disk Encryption Set in a Managed Disk or Virtual Machine, or Virtual Machine Scale Set. For instructions, please refer to the doc of [Server side encryption of Azure managed disks](https://docs.microsoft.com/azure/virtual-machines/linux/disk-encryption).
//
// > **NOTE** A KeyVault using enableRbacAuthorization requires to use `authorization.Assignment` to assigne the role `Key Vault Crypto Service Encryption User` to this Disk Encryption Set.
// In this case, `keyvault.AccessPolicy` is not needed.
KeyVaultKeyId pulumi.StringOutput `pulumi:"keyVaultKeyId"`
// The URL for the Key Vault Key or Key Vault Secret that is currently being used by the service.
KeyVaultKeyUrl pulumi.StringOutput `pulumi:"keyVaultKeyUrl"`
// Specifies the Azure Region where the Disk Encryption Set exists. Changing this forces a new resource to be created.
Location pulumi.StringOutput `pulumi:"location"`
// The name of the Disk Encryption Set. Changing this forces a new resource to be created.
Name pulumi.StringOutput `pulumi:"name"`
// Specifies the name of the Resource Group where the Disk Encryption Set should exist. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringOutput `pulumi:"resourceGroupName"`
// A mapping of tags to assign to the Disk Encryption Set.
Tags pulumi.StringMapOutput `pulumi:"tags"`
}
// NewDiskEncryptionSet registers a new resource with the given unique name, arguments, and options.
func NewDiskEncryptionSet(ctx *pulumi.Context,
name string, args *DiskEncryptionSetArgs, opts ...pulumi.ResourceOption) (*DiskEncryptionSet, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.Identity == nil {
return nil, errors.New("invalid value for required argument 'Identity'")
}
if args.KeyVaultKeyId == nil {
return nil, errors.New("invalid value for required argument 'KeyVaultKeyId'")
}
if args.ResourceGroupName == nil {
return nil, errors.New("invalid value for required argument 'ResourceGroupName'")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource DiskEncryptionSet
err := ctx.RegisterResource("azure:compute/diskEncryptionSet:DiskEncryptionSet", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetDiskEncryptionSet gets an existing DiskEncryptionSet 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 GetDiskEncryptionSet(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *DiskEncryptionSetState, opts ...pulumi.ResourceOption) (*DiskEncryptionSet, error) {
var resource DiskEncryptionSet
err := ctx.ReadResource("azure:compute/diskEncryptionSet:DiskEncryptionSet", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering DiskEncryptionSet resources.
type diskEncryptionSetState struct {
AutoKeyRotationEnabled *bool `pulumi:"autoKeyRotationEnabled"`
// The type of key used to encrypt the data of the disk. Possible values are `EncryptionAtRestWithCustomerKey`, `EncryptionAtRestWithPlatformAndCustomerKeys` and `ConfidentialVmEncryptedWithCustomerKey`. Defaults to `EncryptionAtRestWithCustomerKey`. Changing this forces a new resource to be created.
EncryptionType *string `pulumi:"encryptionType"`
// Multi-tenant application client id to access key vault in a different tenant.
FederatedClientId *string `pulumi:"federatedClientId"`
// An `identity` block as defined below.
Identity *DiskEncryptionSetIdentity `pulumi:"identity"`
// Specifies the URL to a Key Vault Key (either from a Key Vault Key, or the Key URL for the Key Vault Secret).
//
// > **NOTE** Access to the KeyVault must be granted for this Disk Encryption Set, if you want to further use this Disk Encryption Set in a Managed Disk or Virtual Machine, or Virtual Machine Scale Set. For instructions, please refer to the doc of [Server side encryption of Azure managed disks](https://docs.microsoft.com/azure/virtual-machines/linux/disk-encryption).
//
// > **NOTE** A KeyVault using enableRbacAuthorization requires to use `authorization.Assignment` to assigne the role `Key Vault Crypto Service Encryption User` to this Disk Encryption Set.
// In this case, `keyvault.AccessPolicy` is not needed.
KeyVaultKeyId *string `pulumi:"keyVaultKeyId"`
// The URL for the Key Vault Key or Key Vault Secret that is currently being used by the service.
KeyVaultKeyUrl *string `pulumi:"keyVaultKeyUrl"`
// Specifies the Azure Region where the Disk Encryption Set exists. Changing this forces a new resource to be created.
Location *string `pulumi:"location"`
// The name of the Disk Encryption Set. Changing this forces a new resource to be created.
Name *string `pulumi:"name"`
// Specifies the name of the Resource Group where the Disk Encryption Set should exist. Changing this forces a new resource to be created.
ResourceGroupName *string `pulumi:"resourceGroupName"`
// A mapping of tags to assign to the Disk Encryption Set.
Tags map[string]string `pulumi:"tags"`
}
type DiskEncryptionSetState struct {
AutoKeyRotationEnabled pulumi.BoolPtrInput
// The type of key used to encrypt the data of the disk. Possible values are `EncryptionAtRestWithCustomerKey`, `EncryptionAtRestWithPlatformAndCustomerKeys` and `ConfidentialVmEncryptedWithCustomerKey`. Defaults to `EncryptionAtRestWithCustomerKey`. Changing this forces a new resource to be created.
EncryptionType pulumi.StringPtrInput
// Multi-tenant application client id to access key vault in a different tenant.
FederatedClientId pulumi.StringPtrInput
// An `identity` block as defined below.
Identity DiskEncryptionSetIdentityPtrInput
// Specifies the URL to a Key Vault Key (either from a Key Vault Key, or the Key URL for the Key Vault Secret).
//
// > **NOTE** Access to the KeyVault must be granted for this Disk Encryption Set, if you want to further use this Disk Encryption Set in a Managed Disk or Virtual Machine, or Virtual Machine Scale Set. For instructions, please refer to the doc of [Server side encryption of Azure managed disks](https://docs.microsoft.com/azure/virtual-machines/linux/disk-encryption).
//
// > **NOTE** A KeyVault using enableRbacAuthorization requires to use `authorization.Assignment` to assigne the role `Key Vault Crypto Service Encryption User` to this Disk Encryption Set.
// In this case, `keyvault.AccessPolicy` is not needed.
KeyVaultKeyId pulumi.StringPtrInput
// The URL for the Key Vault Key or Key Vault Secret that is currently being used by the service.
KeyVaultKeyUrl pulumi.StringPtrInput
// Specifies the Azure Region where the Disk Encryption Set exists. Changing this forces a new resource to be created.
Location pulumi.StringPtrInput
// The name of the Disk Encryption Set. Changing this forces a new resource to be created.
Name pulumi.StringPtrInput
// Specifies the name of the Resource Group where the Disk Encryption Set should exist. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringPtrInput
// A mapping of tags to assign to the Disk Encryption Set.
Tags pulumi.StringMapInput
}
func (DiskEncryptionSetState) ElementType() reflect.Type {
return reflect.TypeOf((*diskEncryptionSetState)(nil)).Elem()
}
type diskEncryptionSetArgs struct {
AutoKeyRotationEnabled *bool `pulumi:"autoKeyRotationEnabled"`
// The type of key used to encrypt the data of the disk. Possible values are `EncryptionAtRestWithCustomerKey`, `EncryptionAtRestWithPlatformAndCustomerKeys` and `ConfidentialVmEncryptedWithCustomerKey`. Defaults to `EncryptionAtRestWithCustomerKey`. Changing this forces a new resource to be created.
EncryptionType *string `pulumi:"encryptionType"`
// Multi-tenant application client id to access key vault in a different tenant.
FederatedClientId *string `pulumi:"federatedClientId"`
// An `identity` block as defined below.
Identity DiskEncryptionSetIdentity `pulumi:"identity"`
// Specifies the URL to a Key Vault Key (either from a Key Vault Key, or the Key URL for the Key Vault Secret).
//
// > **NOTE** Access to the KeyVault must be granted for this Disk Encryption Set, if you want to further use this Disk Encryption Set in a Managed Disk or Virtual Machine, or Virtual Machine Scale Set. For instructions, please refer to the doc of [Server side encryption of Azure managed disks](https://docs.microsoft.com/azure/virtual-machines/linux/disk-encryption).
//
// > **NOTE** A KeyVault using enableRbacAuthorization requires to use `authorization.Assignment` to assigne the role `Key Vault Crypto Service Encryption User` to this Disk Encryption Set.
// In this case, `keyvault.AccessPolicy` is not needed.
KeyVaultKeyId string `pulumi:"keyVaultKeyId"`
// Specifies the Azure Region where the Disk Encryption Set exists. Changing this forces a new resource to be created.
Location *string `pulumi:"location"`
// The name of the Disk Encryption Set. Changing this forces a new resource to be created.
Name *string `pulumi:"name"`
// Specifies the name of the Resource Group where the Disk Encryption Set should exist. Changing this forces a new resource to be created.
ResourceGroupName string `pulumi:"resourceGroupName"`
// A mapping of tags to assign to the Disk Encryption Set.
Tags map[string]string `pulumi:"tags"`
}
// The set of arguments for constructing a DiskEncryptionSet resource.
type DiskEncryptionSetArgs struct {
AutoKeyRotationEnabled pulumi.BoolPtrInput
// The type of key used to encrypt the data of the disk. Possible values are `EncryptionAtRestWithCustomerKey`, `EncryptionAtRestWithPlatformAndCustomerKeys` and `ConfidentialVmEncryptedWithCustomerKey`. Defaults to `EncryptionAtRestWithCustomerKey`. Changing this forces a new resource to be created.
EncryptionType pulumi.StringPtrInput
// Multi-tenant application client id to access key vault in a different tenant.
FederatedClientId pulumi.StringPtrInput
// An `identity` block as defined below.
Identity DiskEncryptionSetIdentityInput
// Specifies the URL to a Key Vault Key (either from a Key Vault Key, or the Key URL for the Key Vault Secret).
//
// > **NOTE** Access to the KeyVault must be granted for this Disk Encryption Set, if you want to further use this Disk Encryption Set in a Managed Disk or Virtual Machine, or Virtual Machine Scale Set. For instructions, please refer to the doc of [Server side encryption of Azure managed disks](https://docs.microsoft.com/azure/virtual-machines/linux/disk-encryption).
//
// > **NOTE** A KeyVault using enableRbacAuthorization requires to use `authorization.Assignment` to assigne the role `Key Vault Crypto Service Encryption User` to this Disk Encryption Set.
// In this case, `keyvault.AccessPolicy` is not needed.
KeyVaultKeyId pulumi.StringInput
// Specifies the Azure Region where the Disk Encryption Set exists. Changing this forces a new resource to be created.
Location pulumi.StringPtrInput
// The name of the Disk Encryption Set. Changing this forces a new resource to be created.
Name pulumi.StringPtrInput
// Specifies the name of the Resource Group where the Disk Encryption Set should exist. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringInput
// A mapping of tags to assign to the Disk Encryption Set.
Tags pulumi.StringMapInput
}
func (DiskEncryptionSetArgs) ElementType() reflect.Type {
return reflect.TypeOf((*diskEncryptionSetArgs)(nil)).Elem()
}
type DiskEncryptionSetInput interface {
pulumi.Input
ToDiskEncryptionSetOutput() DiskEncryptionSetOutput
ToDiskEncryptionSetOutputWithContext(ctx context.Context) DiskEncryptionSetOutput
}
func (*DiskEncryptionSet) ElementType() reflect.Type {
return reflect.TypeOf((**DiskEncryptionSet)(nil)).Elem()
}
func (i *DiskEncryptionSet) ToDiskEncryptionSetOutput() DiskEncryptionSetOutput {
return i.ToDiskEncryptionSetOutputWithContext(context.Background())
}
func (i *DiskEncryptionSet) ToDiskEncryptionSetOutputWithContext(ctx context.Context) DiskEncryptionSetOutput {
return pulumi.ToOutputWithContext(ctx, i).(DiskEncryptionSetOutput)
}
// DiskEncryptionSetArrayInput is an input type that accepts DiskEncryptionSetArray and DiskEncryptionSetArrayOutput values.
// You can construct a concrete instance of `DiskEncryptionSetArrayInput` via:
//
// DiskEncryptionSetArray{ DiskEncryptionSetArgs{...} }
type DiskEncryptionSetArrayInput interface {
pulumi.Input
ToDiskEncryptionSetArrayOutput() DiskEncryptionSetArrayOutput
ToDiskEncryptionSetArrayOutputWithContext(context.Context) DiskEncryptionSetArrayOutput
}
type DiskEncryptionSetArray []DiskEncryptionSetInput
func (DiskEncryptionSetArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*DiskEncryptionSet)(nil)).Elem()
}
func (i DiskEncryptionSetArray) ToDiskEncryptionSetArrayOutput() DiskEncryptionSetArrayOutput {
return i.ToDiskEncryptionSetArrayOutputWithContext(context.Background())
}
func (i DiskEncryptionSetArray) ToDiskEncryptionSetArrayOutputWithContext(ctx context.Context) DiskEncryptionSetArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(DiskEncryptionSetArrayOutput)
}
// DiskEncryptionSetMapInput is an input type that accepts DiskEncryptionSetMap and DiskEncryptionSetMapOutput values.
// You can construct a concrete instance of `DiskEncryptionSetMapInput` via:
//
// DiskEncryptionSetMap{ "key": DiskEncryptionSetArgs{...} }
type DiskEncryptionSetMapInput interface {
pulumi.Input
ToDiskEncryptionSetMapOutput() DiskEncryptionSetMapOutput
ToDiskEncryptionSetMapOutputWithContext(context.Context) DiskEncryptionSetMapOutput
}
type DiskEncryptionSetMap map[string]DiskEncryptionSetInput
func (DiskEncryptionSetMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*DiskEncryptionSet)(nil)).Elem()
}
func (i DiskEncryptionSetMap) ToDiskEncryptionSetMapOutput() DiskEncryptionSetMapOutput {
return i.ToDiskEncryptionSetMapOutputWithContext(context.Background())
}
func (i DiskEncryptionSetMap) ToDiskEncryptionSetMapOutputWithContext(ctx context.Context) DiskEncryptionSetMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(DiskEncryptionSetMapOutput)
}
type DiskEncryptionSetOutput struct{ *pulumi.OutputState }
func (DiskEncryptionSetOutput) ElementType() reflect.Type {
return reflect.TypeOf((**DiskEncryptionSet)(nil)).Elem()
}
func (o DiskEncryptionSetOutput) ToDiskEncryptionSetOutput() DiskEncryptionSetOutput {
return o
}
func (o DiskEncryptionSetOutput) ToDiskEncryptionSetOutputWithContext(ctx context.Context) DiskEncryptionSetOutput {
return o
}
func (o DiskEncryptionSetOutput) AutoKeyRotationEnabled() pulumi.BoolPtrOutput {
return o.ApplyT(func(v *DiskEncryptionSet) pulumi.BoolPtrOutput { return v.AutoKeyRotationEnabled }).(pulumi.BoolPtrOutput)
}
// The type of key used to encrypt the data of the disk. Possible values are `EncryptionAtRestWithCustomerKey`, `EncryptionAtRestWithPlatformAndCustomerKeys` and `ConfidentialVmEncryptedWithCustomerKey`. Defaults to `EncryptionAtRestWithCustomerKey`. Changing this forces a new resource to be created.
func (o DiskEncryptionSetOutput) EncryptionType() pulumi.StringPtrOutput {
return o.ApplyT(func(v *DiskEncryptionSet) pulumi.StringPtrOutput { return v.EncryptionType }).(pulumi.StringPtrOutput)
}
// Multi-tenant application client id to access key vault in a different tenant.
func (o DiskEncryptionSetOutput) FederatedClientId() pulumi.StringPtrOutput {
return o.ApplyT(func(v *DiskEncryptionSet) pulumi.StringPtrOutput { return v.FederatedClientId }).(pulumi.StringPtrOutput)
}
// An `identity` block as defined below.
func (o DiskEncryptionSetOutput) Identity() DiskEncryptionSetIdentityOutput {
return o.ApplyT(func(v *DiskEncryptionSet) DiskEncryptionSetIdentityOutput { return v.Identity }).(DiskEncryptionSetIdentityOutput)
}
// Specifies the URL to a Key Vault Key (either from a Key Vault Key, or the Key URL for the Key Vault Secret).
//
// > **NOTE** Access to the KeyVault must be granted for this Disk Encryption Set, if you want to further use this Disk Encryption Set in a Managed Disk or Virtual Machine, or Virtual Machine Scale Set. For instructions, please refer to the doc of [Server side encryption of Azure managed disks](https://docs.microsoft.com/azure/virtual-machines/linux/disk-encryption).
//
// > **NOTE** A KeyVault using enableRbacAuthorization requires to use `authorization.Assignment` to assigne the role `Key Vault Crypto Service Encryption User` to this Disk Encryption Set.
// In this case, `keyvault.AccessPolicy` is not needed.
func (o DiskEncryptionSetOutput) KeyVaultKeyId() pulumi.StringOutput {
return o.ApplyT(func(v *DiskEncryptionSet) pulumi.StringOutput { return v.KeyVaultKeyId }).(pulumi.StringOutput)
}
// The URL for the Key Vault Key or Key Vault Secret that is currently being used by the service.
func (o DiskEncryptionSetOutput) KeyVaultKeyUrl() pulumi.StringOutput {
return o.ApplyT(func(v *DiskEncryptionSet) pulumi.StringOutput { return v.KeyVaultKeyUrl }).(pulumi.StringOutput)
}
// Specifies the Azure Region where the Disk Encryption Set exists. Changing this forces a new resource to be created.
func (o DiskEncryptionSetOutput) Location() pulumi.StringOutput {
return o.ApplyT(func(v *DiskEncryptionSet) pulumi.StringOutput { return v.Location }).(pulumi.StringOutput)
}
// The name of the Disk Encryption Set. Changing this forces a new resource to be created.
func (o DiskEncryptionSetOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *DiskEncryptionSet) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// Specifies the name of the Resource Group where the Disk Encryption Set should exist. Changing this forces a new resource to be created.
func (o DiskEncryptionSetOutput) ResourceGroupName() pulumi.StringOutput {
return o.ApplyT(func(v *DiskEncryptionSet) pulumi.StringOutput { return v.ResourceGroupName }).(pulumi.StringOutput)
}
// A mapping of tags to assign to the Disk Encryption Set.
func (o DiskEncryptionSetOutput) Tags() pulumi.StringMapOutput {
return o.ApplyT(func(v *DiskEncryptionSet) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
}
type DiskEncryptionSetArrayOutput struct{ *pulumi.OutputState }
func (DiskEncryptionSetArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*DiskEncryptionSet)(nil)).Elem()
}
func (o DiskEncryptionSetArrayOutput) ToDiskEncryptionSetArrayOutput() DiskEncryptionSetArrayOutput {
return o
}
func (o DiskEncryptionSetArrayOutput) ToDiskEncryptionSetArrayOutputWithContext(ctx context.Context) DiskEncryptionSetArrayOutput {
return o
}
func (o DiskEncryptionSetArrayOutput) Index(i pulumi.IntInput) DiskEncryptionSetOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *DiskEncryptionSet {
return vs[0].([]*DiskEncryptionSet)[vs[1].(int)]
}).(DiskEncryptionSetOutput)
}
type DiskEncryptionSetMapOutput struct{ *pulumi.OutputState }
func (DiskEncryptionSetMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*DiskEncryptionSet)(nil)).Elem()
}
func (o DiskEncryptionSetMapOutput) ToDiskEncryptionSetMapOutput() DiskEncryptionSetMapOutput {
return o
}
func (o DiskEncryptionSetMapOutput) ToDiskEncryptionSetMapOutputWithContext(ctx context.Context) DiskEncryptionSetMapOutput {
return o
}
func (o DiskEncryptionSetMapOutput) MapIndex(k pulumi.StringInput) DiskEncryptionSetOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *DiskEncryptionSet {
return vs[0].(map[string]*DiskEncryptionSet)[vs[1].(string)]
}).(DiskEncryptionSetOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*DiskEncryptionSetInput)(nil)).Elem(), &DiskEncryptionSet{})
pulumi.RegisterInputType(reflect.TypeOf((*DiskEncryptionSetArrayInput)(nil)).Elem(), DiskEncryptionSetArray{})
pulumi.RegisterInputType(reflect.TypeOf((*DiskEncryptionSetMapInput)(nil)).Elem(), DiskEncryptionSetMap{})
pulumi.RegisterOutputType(DiskEncryptionSetOutput{})
pulumi.RegisterOutputType(DiskEncryptionSetArrayOutput{})
pulumi.RegisterOutputType(DiskEncryptionSetMapOutput{})
}