/
policyVM.go
496 lines (438 loc) · 24 KB
/
policyVM.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
// 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 backup
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Manages an Azure Backup VM Backup Policy.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/backup"
// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/recoveryservices"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
// Name: pulumi.String("tfex-recovery_vault"),
// Location: pulumi.String("West Europe"),
// })
// if err != nil {
// return err
// }
// exampleVault, err := recoveryservices.NewVault(ctx, "example", &recoveryservices.VaultArgs{
// Name: pulumi.String("tfex-recovery-vault"),
// Location: example.Location,
// ResourceGroupName: example.Name,
// Sku: pulumi.String("Standard"),
// })
// if err != nil {
// return err
// }
// _, err = backup.NewPolicyVM(ctx, "example", &backup.PolicyVMArgs{
// Name: pulumi.String("tfex-recovery-vault-policy"),
// ResourceGroupName: example.Name,
// RecoveryVaultName: exampleVault.Name,
// Timezone: pulumi.String("UTC"),
// Backup: &backup.PolicyVMBackupArgs{
// Frequency: pulumi.String("Daily"),
// Time: pulumi.String("23:00"),
// },
// RetentionDaily: &backup.PolicyVMRetentionDailyArgs{
// Count: pulumi.Int(10),
// },
// RetentionWeekly: &backup.PolicyVMRetentionWeeklyArgs{
// Count: pulumi.Int(42),
// Weekdays: pulumi.StringArray{
// pulumi.String("Sunday"),
// pulumi.String("Wednesday"),
// pulumi.String("Friday"),
// pulumi.String("Saturday"),
// },
// },
// RetentionMonthly: &backup.PolicyVMRetentionMonthlyArgs{
// Count: pulumi.Int(7),
// Weekdays: pulumi.StringArray{
// pulumi.String("Sunday"),
// pulumi.String("Wednesday"),
// },
// Weeks: pulumi.StringArray{
// pulumi.String("First"),
// pulumi.String("Last"),
// },
// },
// RetentionYearly: &backup.PolicyVMRetentionYearlyArgs{
// Count: pulumi.Int(77),
// Weekdays: pulumi.StringArray{
// pulumi.String("Sunday"),
// },
// Weeks: pulumi.StringArray{
// pulumi.String("Last"),
// },
// Months: pulumi.StringArray{
// pulumi.String("January"),
// },
// },
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## Import
//
// VM Backup Policies can be imported using the `resource id`, e.g.
//
// ```sh
// $ pulumi import azure:backup/policyVM:PolicyVM policy1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.RecoveryServices/vaults/example-recovery-vault/backupPolicies/policy1
// ```
type PolicyVM struct {
pulumi.CustomResourceState
// Configures the Policy backup frequency, times & days as documented in the `backup` block below.
Backup PolicyVMBackupOutput `pulumi:"backup"`
// Specifies the instant restore resource group name as documented in the `instantRestoreResourceGroup` block below.
InstantRestoreResourceGroup PolicyVMInstantRestoreResourceGroupPtrOutput `pulumi:"instantRestoreResourceGroup"`
// Specifies the instant restore retention range in days. Possible values are between `1` and `5` when `policyType` is `V1`, and `1` to `30` when `policyType` is `V2`.
//
// > **NOTE:** `instantRestoreRetentionDays` **must** be set to `5` if the backup frequency is set to `Weekly`.
InstantRestoreRetentionDays pulumi.IntOutput `pulumi:"instantRestoreRetentionDays"`
// Specifies the name of the Backup Policy. Changing this forces a new resource to be created.
Name pulumi.StringOutput `pulumi:"name"`
// Type of the Backup Policy. Possible values are `V1` and `V2` where `V2` stands for the Enhanced Policy. Defaults to `V1`. Changing this forces a new resource to be created.
PolicyType pulumi.StringPtrOutput `pulumi:"policyType"`
// Specifies the name of the Recovery Services Vault to use. Changing this forces a new resource to be created.
RecoveryVaultName pulumi.StringOutput `pulumi:"recoveryVaultName"`
// The name of the resource group in which to create the policy. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringOutput `pulumi:"resourceGroupName"`
// Configures the policy daily retention as documented in the `retentionDaily` block below. Required when backup frequency is `Daily`.
RetentionDaily PolicyVMRetentionDailyPtrOutput `pulumi:"retentionDaily"`
// Configures the policy monthly retention as documented in the `retentionMonthly` block below.
RetentionMonthly PolicyVMRetentionMonthlyPtrOutput `pulumi:"retentionMonthly"`
// Configures the policy weekly retention as documented in the `retentionWeekly` block below. Required when backup frequency is `Weekly`.
RetentionWeekly PolicyVMRetentionWeeklyPtrOutput `pulumi:"retentionWeekly"`
// Configures the policy yearly retention as documented in the `retentionYearly` block below.
RetentionYearly PolicyVMRetentionYearlyPtrOutput `pulumi:"retentionYearly"`
// Specifies the timezone. [the possible values are defined here](https://jackstromberg.com/2017/01/list-of-time-zones-consumed-by-azure/). Defaults to `UTC`
Timezone pulumi.StringPtrOutput `pulumi:"timezone"`
}
// NewPolicyVM registers a new resource with the given unique name, arguments, and options.
func NewPolicyVM(ctx *pulumi.Context,
name string, args *PolicyVMArgs, opts ...pulumi.ResourceOption) (*PolicyVM, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.Backup == nil {
return nil, errors.New("invalid value for required argument 'Backup'")
}
if args.RecoveryVaultName == nil {
return nil, errors.New("invalid value for required argument 'RecoveryVaultName'")
}
if args.ResourceGroupName == nil {
return nil, errors.New("invalid value for required argument 'ResourceGroupName'")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource PolicyVM
err := ctx.RegisterResource("azure:backup/policyVM:PolicyVM", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetPolicyVM gets an existing PolicyVM 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 GetPolicyVM(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *PolicyVMState, opts ...pulumi.ResourceOption) (*PolicyVM, error) {
var resource PolicyVM
err := ctx.ReadResource("azure:backup/policyVM:PolicyVM", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering PolicyVM resources.
type policyVMState struct {
// Configures the Policy backup frequency, times & days as documented in the `backup` block below.
Backup *PolicyVMBackup `pulumi:"backup"`
// Specifies the instant restore resource group name as documented in the `instantRestoreResourceGroup` block below.
InstantRestoreResourceGroup *PolicyVMInstantRestoreResourceGroup `pulumi:"instantRestoreResourceGroup"`
// Specifies the instant restore retention range in days. Possible values are between `1` and `5` when `policyType` is `V1`, and `1` to `30` when `policyType` is `V2`.
//
// > **NOTE:** `instantRestoreRetentionDays` **must** be set to `5` if the backup frequency is set to `Weekly`.
InstantRestoreRetentionDays *int `pulumi:"instantRestoreRetentionDays"`
// Specifies the name of the Backup Policy. Changing this forces a new resource to be created.
Name *string `pulumi:"name"`
// Type of the Backup Policy. Possible values are `V1` and `V2` where `V2` stands for the Enhanced Policy. Defaults to `V1`. Changing this forces a new resource to be created.
PolicyType *string `pulumi:"policyType"`
// Specifies the name of the Recovery Services Vault to use. Changing this forces a new resource to be created.
RecoveryVaultName *string `pulumi:"recoveryVaultName"`
// The name of the resource group in which to create the policy. Changing this forces a new resource to be created.
ResourceGroupName *string `pulumi:"resourceGroupName"`
// Configures the policy daily retention as documented in the `retentionDaily` block below. Required when backup frequency is `Daily`.
RetentionDaily *PolicyVMRetentionDaily `pulumi:"retentionDaily"`
// Configures the policy monthly retention as documented in the `retentionMonthly` block below.
RetentionMonthly *PolicyVMRetentionMonthly `pulumi:"retentionMonthly"`
// Configures the policy weekly retention as documented in the `retentionWeekly` block below. Required when backup frequency is `Weekly`.
RetentionWeekly *PolicyVMRetentionWeekly `pulumi:"retentionWeekly"`
// Configures the policy yearly retention as documented in the `retentionYearly` block below.
RetentionYearly *PolicyVMRetentionYearly `pulumi:"retentionYearly"`
// Specifies the timezone. [the possible values are defined here](https://jackstromberg.com/2017/01/list-of-time-zones-consumed-by-azure/). Defaults to `UTC`
Timezone *string `pulumi:"timezone"`
}
type PolicyVMState struct {
// Configures the Policy backup frequency, times & days as documented in the `backup` block below.
Backup PolicyVMBackupPtrInput
// Specifies the instant restore resource group name as documented in the `instantRestoreResourceGroup` block below.
InstantRestoreResourceGroup PolicyVMInstantRestoreResourceGroupPtrInput
// Specifies the instant restore retention range in days. Possible values are between `1` and `5` when `policyType` is `V1`, and `1` to `30` when `policyType` is `V2`.
//
// > **NOTE:** `instantRestoreRetentionDays` **must** be set to `5` if the backup frequency is set to `Weekly`.
InstantRestoreRetentionDays pulumi.IntPtrInput
// Specifies the name of the Backup Policy. Changing this forces a new resource to be created.
Name pulumi.StringPtrInput
// Type of the Backup Policy. Possible values are `V1` and `V2` where `V2` stands for the Enhanced Policy. Defaults to `V1`. Changing this forces a new resource to be created.
PolicyType pulumi.StringPtrInput
// Specifies the name of the Recovery Services Vault to use. Changing this forces a new resource to be created.
RecoveryVaultName pulumi.StringPtrInput
// The name of the resource group in which to create the policy. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringPtrInput
// Configures the policy daily retention as documented in the `retentionDaily` block below. Required when backup frequency is `Daily`.
RetentionDaily PolicyVMRetentionDailyPtrInput
// Configures the policy monthly retention as documented in the `retentionMonthly` block below.
RetentionMonthly PolicyVMRetentionMonthlyPtrInput
// Configures the policy weekly retention as documented in the `retentionWeekly` block below. Required when backup frequency is `Weekly`.
RetentionWeekly PolicyVMRetentionWeeklyPtrInput
// Configures the policy yearly retention as documented in the `retentionYearly` block below.
RetentionYearly PolicyVMRetentionYearlyPtrInput
// Specifies the timezone. [the possible values are defined here](https://jackstromberg.com/2017/01/list-of-time-zones-consumed-by-azure/). Defaults to `UTC`
Timezone pulumi.StringPtrInput
}
func (PolicyVMState) ElementType() reflect.Type {
return reflect.TypeOf((*policyVMState)(nil)).Elem()
}
type policyVMArgs struct {
// Configures the Policy backup frequency, times & days as documented in the `backup` block below.
Backup PolicyVMBackup `pulumi:"backup"`
// Specifies the instant restore resource group name as documented in the `instantRestoreResourceGroup` block below.
InstantRestoreResourceGroup *PolicyVMInstantRestoreResourceGroup `pulumi:"instantRestoreResourceGroup"`
// Specifies the instant restore retention range in days. Possible values are between `1` and `5` when `policyType` is `V1`, and `1` to `30` when `policyType` is `V2`.
//
// > **NOTE:** `instantRestoreRetentionDays` **must** be set to `5` if the backup frequency is set to `Weekly`.
InstantRestoreRetentionDays *int `pulumi:"instantRestoreRetentionDays"`
// Specifies the name of the Backup Policy. Changing this forces a new resource to be created.
Name *string `pulumi:"name"`
// Type of the Backup Policy. Possible values are `V1` and `V2` where `V2` stands for the Enhanced Policy. Defaults to `V1`. Changing this forces a new resource to be created.
PolicyType *string `pulumi:"policyType"`
// Specifies the name of the Recovery Services Vault to use. Changing this forces a new resource to be created.
RecoveryVaultName string `pulumi:"recoveryVaultName"`
// The name of the resource group in which to create the policy. Changing this forces a new resource to be created.
ResourceGroupName string `pulumi:"resourceGroupName"`
// Configures the policy daily retention as documented in the `retentionDaily` block below. Required when backup frequency is `Daily`.
RetentionDaily *PolicyVMRetentionDaily `pulumi:"retentionDaily"`
// Configures the policy monthly retention as documented in the `retentionMonthly` block below.
RetentionMonthly *PolicyVMRetentionMonthly `pulumi:"retentionMonthly"`
// Configures the policy weekly retention as documented in the `retentionWeekly` block below. Required when backup frequency is `Weekly`.
RetentionWeekly *PolicyVMRetentionWeekly `pulumi:"retentionWeekly"`
// Configures the policy yearly retention as documented in the `retentionYearly` block below.
RetentionYearly *PolicyVMRetentionYearly `pulumi:"retentionYearly"`
// Specifies the timezone. [the possible values are defined here](https://jackstromberg.com/2017/01/list-of-time-zones-consumed-by-azure/). Defaults to `UTC`
Timezone *string `pulumi:"timezone"`
}
// The set of arguments for constructing a PolicyVM resource.
type PolicyVMArgs struct {
// Configures the Policy backup frequency, times & days as documented in the `backup` block below.
Backup PolicyVMBackupInput
// Specifies the instant restore resource group name as documented in the `instantRestoreResourceGroup` block below.
InstantRestoreResourceGroup PolicyVMInstantRestoreResourceGroupPtrInput
// Specifies the instant restore retention range in days. Possible values are between `1` and `5` when `policyType` is `V1`, and `1` to `30` when `policyType` is `V2`.
//
// > **NOTE:** `instantRestoreRetentionDays` **must** be set to `5` if the backup frequency is set to `Weekly`.
InstantRestoreRetentionDays pulumi.IntPtrInput
// Specifies the name of the Backup Policy. Changing this forces a new resource to be created.
Name pulumi.StringPtrInput
// Type of the Backup Policy. Possible values are `V1` and `V2` where `V2` stands for the Enhanced Policy. Defaults to `V1`. Changing this forces a new resource to be created.
PolicyType pulumi.StringPtrInput
// Specifies the name of the Recovery Services Vault to use. Changing this forces a new resource to be created.
RecoveryVaultName pulumi.StringInput
// The name of the resource group in which to create the policy. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringInput
// Configures the policy daily retention as documented in the `retentionDaily` block below. Required when backup frequency is `Daily`.
RetentionDaily PolicyVMRetentionDailyPtrInput
// Configures the policy monthly retention as documented in the `retentionMonthly` block below.
RetentionMonthly PolicyVMRetentionMonthlyPtrInput
// Configures the policy weekly retention as documented in the `retentionWeekly` block below. Required when backup frequency is `Weekly`.
RetentionWeekly PolicyVMRetentionWeeklyPtrInput
// Configures the policy yearly retention as documented in the `retentionYearly` block below.
RetentionYearly PolicyVMRetentionYearlyPtrInput
// Specifies the timezone. [the possible values are defined here](https://jackstromberg.com/2017/01/list-of-time-zones-consumed-by-azure/). Defaults to `UTC`
Timezone pulumi.StringPtrInput
}
func (PolicyVMArgs) ElementType() reflect.Type {
return reflect.TypeOf((*policyVMArgs)(nil)).Elem()
}
type PolicyVMInput interface {
pulumi.Input
ToPolicyVMOutput() PolicyVMOutput
ToPolicyVMOutputWithContext(ctx context.Context) PolicyVMOutput
}
func (*PolicyVM) ElementType() reflect.Type {
return reflect.TypeOf((**PolicyVM)(nil)).Elem()
}
func (i *PolicyVM) ToPolicyVMOutput() PolicyVMOutput {
return i.ToPolicyVMOutputWithContext(context.Background())
}
func (i *PolicyVM) ToPolicyVMOutputWithContext(ctx context.Context) PolicyVMOutput {
return pulumi.ToOutputWithContext(ctx, i).(PolicyVMOutput)
}
// PolicyVMArrayInput is an input type that accepts PolicyVMArray and PolicyVMArrayOutput values.
// You can construct a concrete instance of `PolicyVMArrayInput` via:
//
// PolicyVMArray{ PolicyVMArgs{...} }
type PolicyVMArrayInput interface {
pulumi.Input
ToPolicyVMArrayOutput() PolicyVMArrayOutput
ToPolicyVMArrayOutputWithContext(context.Context) PolicyVMArrayOutput
}
type PolicyVMArray []PolicyVMInput
func (PolicyVMArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*PolicyVM)(nil)).Elem()
}
func (i PolicyVMArray) ToPolicyVMArrayOutput() PolicyVMArrayOutput {
return i.ToPolicyVMArrayOutputWithContext(context.Background())
}
func (i PolicyVMArray) ToPolicyVMArrayOutputWithContext(ctx context.Context) PolicyVMArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(PolicyVMArrayOutput)
}
// PolicyVMMapInput is an input type that accepts PolicyVMMap and PolicyVMMapOutput values.
// You can construct a concrete instance of `PolicyVMMapInput` via:
//
// PolicyVMMap{ "key": PolicyVMArgs{...} }
type PolicyVMMapInput interface {
pulumi.Input
ToPolicyVMMapOutput() PolicyVMMapOutput
ToPolicyVMMapOutputWithContext(context.Context) PolicyVMMapOutput
}
type PolicyVMMap map[string]PolicyVMInput
func (PolicyVMMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*PolicyVM)(nil)).Elem()
}
func (i PolicyVMMap) ToPolicyVMMapOutput() PolicyVMMapOutput {
return i.ToPolicyVMMapOutputWithContext(context.Background())
}
func (i PolicyVMMap) ToPolicyVMMapOutputWithContext(ctx context.Context) PolicyVMMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(PolicyVMMapOutput)
}
type PolicyVMOutput struct{ *pulumi.OutputState }
func (PolicyVMOutput) ElementType() reflect.Type {
return reflect.TypeOf((**PolicyVM)(nil)).Elem()
}
func (o PolicyVMOutput) ToPolicyVMOutput() PolicyVMOutput {
return o
}
func (o PolicyVMOutput) ToPolicyVMOutputWithContext(ctx context.Context) PolicyVMOutput {
return o
}
// Configures the Policy backup frequency, times & days as documented in the `backup` block below.
func (o PolicyVMOutput) Backup() PolicyVMBackupOutput {
return o.ApplyT(func(v *PolicyVM) PolicyVMBackupOutput { return v.Backup }).(PolicyVMBackupOutput)
}
// Specifies the instant restore resource group name as documented in the `instantRestoreResourceGroup` block below.
func (o PolicyVMOutput) InstantRestoreResourceGroup() PolicyVMInstantRestoreResourceGroupPtrOutput {
return o.ApplyT(func(v *PolicyVM) PolicyVMInstantRestoreResourceGroupPtrOutput { return v.InstantRestoreResourceGroup }).(PolicyVMInstantRestoreResourceGroupPtrOutput)
}
// Specifies the instant restore retention range in days. Possible values are between `1` and `5` when `policyType` is `V1`, and `1` to `30` when `policyType` is `V2`.
//
// > **NOTE:** `instantRestoreRetentionDays` **must** be set to `5` if the backup frequency is set to `Weekly`.
func (o PolicyVMOutput) InstantRestoreRetentionDays() pulumi.IntOutput {
return o.ApplyT(func(v *PolicyVM) pulumi.IntOutput { return v.InstantRestoreRetentionDays }).(pulumi.IntOutput)
}
// Specifies the name of the Backup Policy. Changing this forces a new resource to be created.
func (o PolicyVMOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *PolicyVM) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// Type of the Backup Policy. Possible values are `V1` and `V2` where `V2` stands for the Enhanced Policy. Defaults to `V1`. Changing this forces a new resource to be created.
func (o PolicyVMOutput) PolicyType() pulumi.StringPtrOutput {
return o.ApplyT(func(v *PolicyVM) pulumi.StringPtrOutput { return v.PolicyType }).(pulumi.StringPtrOutput)
}
// Specifies the name of the Recovery Services Vault to use. Changing this forces a new resource to be created.
func (o PolicyVMOutput) RecoveryVaultName() pulumi.StringOutput {
return o.ApplyT(func(v *PolicyVM) pulumi.StringOutput { return v.RecoveryVaultName }).(pulumi.StringOutput)
}
// The name of the resource group in which to create the policy. Changing this forces a new resource to be created.
func (o PolicyVMOutput) ResourceGroupName() pulumi.StringOutput {
return o.ApplyT(func(v *PolicyVM) pulumi.StringOutput { return v.ResourceGroupName }).(pulumi.StringOutput)
}
// Configures the policy daily retention as documented in the `retentionDaily` block below. Required when backup frequency is `Daily`.
func (o PolicyVMOutput) RetentionDaily() PolicyVMRetentionDailyPtrOutput {
return o.ApplyT(func(v *PolicyVM) PolicyVMRetentionDailyPtrOutput { return v.RetentionDaily }).(PolicyVMRetentionDailyPtrOutput)
}
// Configures the policy monthly retention as documented in the `retentionMonthly` block below.
func (o PolicyVMOutput) RetentionMonthly() PolicyVMRetentionMonthlyPtrOutput {
return o.ApplyT(func(v *PolicyVM) PolicyVMRetentionMonthlyPtrOutput { return v.RetentionMonthly }).(PolicyVMRetentionMonthlyPtrOutput)
}
// Configures the policy weekly retention as documented in the `retentionWeekly` block below. Required when backup frequency is `Weekly`.
func (o PolicyVMOutput) RetentionWeekly() PolicyVMRetentionWeeklyPtrOutput {
return o.ApplyT(func(v *PolicyVM) PolicyVMRetentionWeeklyPtrOutput { return v.RetentionWeekly }).(PolicyVMRetentionWeeklyPtrOutput)
}
// Configures the policy yearly retention as documented in the `retentionYearly` block below.
func (o PolicyVMOutput) RetentionYearly() PolicyVMRetentionYearlyPtrOutput {
return o.ApplyT(func(v *PolicyVM) PolicyVMRetentionYearlyPtrOutput { return v.RetentionYearly }).(PolicyVMRetentionYearlyPtrOutput)
}
// Specifies the timezone. [the possible values are defined here](https://jackstromberg.com/2017/01/list-of-time-zones-consumed-by-azure/). Defaults to `UTC`
func (o PolicyVMOutput) Timezone() pulumi.StringPtrOutput {
return o.ApplyT(func(v *PolicyVM) pulumi.StringPtrOutput { return v.Timezone }).(pulumi.StringPtrOutput)
}
type PolicyVMArrayOutput struct{ *pulumi.OutputState }
func (PolicyVMArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*PolicyVM)(nil)).Elem()
}
func (o PolicyVMArrayOutput) ToPolicyVMArrayOutput() PolicyVMArrayOutput {
return o
}
func (o PolicyVMArrayOutput) ToPolicyVMArrayOutputWithContext(ctx context.Context) PolicyVMArrayOutput {
return o
}
func (o PolicyVMArrayOutput) Index(i pulumi.IntInput) PolicyVMOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *PolicyVM {
return vs[0].([]*PolicyVM)[vs[1].(int)]
}).(PolicyVMOutput)
}
type PolicyVMMapOutput struct{ *pulumi.OutputState }
func (PolicyVMMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*PolicyVM)(nil)).Elem()
}
func (o PolicyVMMapOutput) ToPolicyVMMapOutput() PolicyVMMapOutput {
return o
}
func (o PolicyVMMapOutput) ToPolicyVMMapOutputWithContext(ctx context.Context) PolicyVMMapOutput {
return o
}
func (o PolicyVMMapOutput) MapIndex(k pulumi.StringInput) PolicyVMOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *PolicyVM {
return vs[0].(map[string]*PolicyVM)[vs[1].(string)]
}).(PolicyVMOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*PolicyVMInput)(nil)).Elem(), &PolicyVM{})
pulumi.RegisterInputType(reflect.TypeOf((*PolicyVMArrayInput)(nil)).Elem(), PolicyVMArray{})
pulumi.RegisterInputType(reflect.TypeOf((*PolicyVMMapInput)(nil)).Elem(), PolicyVMMap{})
pulumi.RegisterOutputType(PolicyVMOutput{})
pulumi.RegisterOutputType(PolicyVMArrayOutput{})
pulumi.RegisterOutputType(PolicyVMMapOutput{})
}