/
budget.go
760 lines (698 loc) · 30.3 KB
/
budget.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
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
// 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 budgets
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Provides a budgets budget resource. Budgets use the cost visualisation provided by Cost Explorer to show you the status of your budgets, to provide forecasts of your estimated costs, and to track your AWS usage, including your free tier usage.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-aws/sdk/v5/go/aws/budgets"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := budgets.NewBudget(ctx, "ec2", &budgets.BudgetArgs{
// BudgetType: pulumi.String("COST"),
// CostFilters: budgets.BudgetCostFilterArray{
// &budgets.BudgetCostFilterArgs{
// Name: pulumi.String("Service"),
// Values: pulumi.StringArray{
// pulumi.String("Amazon Elastic Compute Cloud - Compute"),
// },
// },
// },
// LimitAmount: pulumi.String("1200"),
// LimitUnit: pulumi.String("USD"),
// Notifications: budgets.BudgetNotificationArray{
// &budgets.BudgetNotificationArgs{
// ComparisonOperator: pulumi.String("GREATER_THAN"),
// NotificationType: pulumi.String("FORECASTED"),
// SubscriberEmailAddresses: pulumi.StringArray{
// pulumi.String("test@example.com"),
// },
// Threshold: pulumi.Float64(100),
// ThresholdType: pulumi.String("PERCENTAGE"),
// },
// },
// TimePeriodEnd: pulumi.String("2087-06-15_00:00"),
// TimePeriodStart: pulumi.String("2017-07-01_00:00"),
// TimeUnit: pulumi.String("MONTHLY"),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// Create a budget for *$100*.
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-aws/sdk/v5/go/aws/budgets"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := budgets.NewBudget(ctx, "cost", &budgets.BudgetArgs{
// BudgetType: pulumi.String("COST"),
// LimitAmount: pulumi.String("100"),
// LimitUnit: pulumi.String("USD"),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// Create a budget with planned budget limits.
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-aws/sdk/v5/go/aws/budgets"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := budgets.NewBudget(ctx, "cost", &budgets.BudgetArgs{
// PlannedLimits: budgets.BudgetPlannedLimitArray{
// &budgets.BudgetPlannedLimitArgs{
// Amount: pulumi.String("100"),
// StartTime: pulumi.String("2017-07-01_00:00"),
// Unit: pulumi.String("USD"),
// },
// &budgets.BudgetPlannedLimitArgs{
// Amount: pulumi.String("200"),
// StartTime: pulumi.String("2017-08-01_00:00"),
// Unit: pulumi.String("USD"),
// },
// },
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// Create a budget for s3 with a limit of *3 GB* of storage.
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-aws/sdk/v5/go/aws/budgets"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := budgets.NewBudget(ctx, "s3", &budgets.BudgetArgs{
// BudgetType: pulumi.String("USAGE"),
// LimitAmount: pulumi.String("3"),
// LimitUnit: pulumi.String("GB"),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// # Create a Savings Plan Utilization Budget
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-aws/sdk/v5/go/aws/budgets"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := budgets.NewBudget(ctx, "savingsPlanUtilization", &budgets.BudgetArgs{
// BudgetType: pulumi.String("SAVINGS_PLANS_UTILIZATION"),
// CostTypes: &budgets.BudgetCostTypesArgs{
// IncludeCredit: pulumi.Bool(false),
// IncludeDiscount: pulumi.Bool(false),
// IncludeOtherSubscription: pulumi.Bool(false),
// IncludeRecurring: pulumi.Bool(false),
// IncludeRefund: pulumi.Bool(false),
// IncludeSubscription: pulumi.Bool(true),
// IncludeSupport: pulumi.Bool(false),
// IncludeTax: pulumi.Bool(false),
// IncludeUpfront: pulumi.Bool(false),
// UseBlended: pulumi.Bool(false),
// },
// LimitAmount: pulumi.String("100.0"),
// LimitUnit: pulumi.String("PERCENTAGE"),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// # Create a RI Utilization Budget
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-aws/sdk/v5/go/aws/budgets"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := budgets.NewBudget(ctx, "riUtilization", &budgets.BudgetArgs{
// BudgetType: pulumi.String("RI_UTILIZATION"),
// CostFilters: budgets.BudgetCostFilterArray{
// &budgets.BudgetCostFilterArgs{
// Name: pulumi.String("Service"),
// Values: pulumi.StringArray{
// pulumi.String("Amazon Relational Database Service"),
// },
// },
// },
// CostTypes: &budgets.BudgetCostTypesArgs{
// IncludeCredit: pulumi.Bool(false),
// IncludeDiscount: pulumi.Bool(false),
// IncludeOtherSubscription: pulumi.Bool(false),
// IncludeRecurring: pulumi.Bool(false),
// IncludeRefund: pulumi.Bool(false),
// IncludeSubscription: pulumi.Bool(true),
// IncludeSupport: pulumi.Bool(false),
// IncludeTax: pulumi.Bool(false),
// IncludeUpfront: pulumi.Bool(false),
// UseBlended: pulumi.Bool(false),
// },
// LimitAmount: pulumi.String("100.0"),
// LimitUnit: pulumi.String("PERCENTAGE"),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// # Create a Cost Filter using Resource Tags
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-aws/sdk/v5/go/aws/budgets"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := budgets.NewBudget(ctx, "cost", &budgets.BudgetArgs{
// CostFilters: budgets.BudgetCostFilterArray{
// &budgets.BudgetCostFilterArgs{
// Name: pulumi.String("TagKeyValue"),
// Values: pulumi.StringArray{
// pulumi.String("TagKey$TagValue"),
// },
// },
// },
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// # Create a costFilter using resource tags, obtaining the tag value from a variable
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-aws/sdk/v5/go/aws/budgets"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := budgets.NewBudget(ctx, "cost", &budgets.BudgetArgs{
// CostFilters: budgets.BudgetCostFilterArray{
// &budgets.BudgetCostFilterArgs{
// Name: pulumi.String("TagKeyValue"),
// Values: pulumi.StringArray{
// pulumi.String("TagKey${var.TagValue}"),
// },
// },
// },
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## Import
//
// Budgets can be imported using `AccountID:BudgetName`, e.g.,
//
// ```sh
//
// $ pulumi import aws:budgets/budget:Budget myBudget 123456789012:myBudget`
//
// ```
type Budget struct {
pulumi.CustomResourceState
// The ID of the target account for budget. Will use current user's accountId by default if omitted.
AccountId pulumi.StringOutput `pulumi:"accountId"`
// The ARN of the budget.
Arn pulumi.StringOutput `pulumi:"arn"`
// Object containing [AutoAdjustData] which determines the budget amount for an auto-adjusting budget.
AutoAdjustData BudgetAutoAdjustDataPtrOutput `pulumi:"autoAdjustData"`
// Whether this budget tracks monetary cost or usage.
BudgetType pulumi.StringOutput `pulumi:"budgetType"`
// Map of CostFilters key/value pairs to apply to the budget.
//
// Deprecated: Use the attribute "cost_filter" instead.
CostFilterLegacy pulumi.StringMapOutput `pulumi:"costFilterLegacy"`
// A list of CostFilter name/values pair to apply to budget.
CostFilters BudgetCostFilterArrayOutput `pulumi:"costFilters"`
// Object containing CostTypes The types of cost included in a budget, such as tax and subscriptions.
CostTypes BudgetCostTypesOutput `pulumi:"costTypes"`
// The amount of cost or usage being measured for a budget.
LimitAmount pulumi.StringOutput `pulumi:"limitAmount"`
// The unit of measurement used for the budget forecast, actual spend, or budget threshold, such as dollars or GB. See [Spend](http://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/data-type-spend.html) documentation.
LimitUnit pulumi.StringOutput `pulumi:"limitUnit"`
// The name of a budget. Unique within accounts.
Name pulumi.StringOutput `pulumi:"name"`
// The prefix of the name of a budget. Unique within accounts.
NamePrefix pulumi.StringOutput `pulumi:"namePrefix"`
// Object containing Budget Notifications. Can be used multiple times to define more than one budget notification.
Notifications BudgetNotificationArrayOutput `pulumi:"notifications"`
// Object containing Planned Budget Limits. Can be used multiple times to plan more than one budget limit. See [PlannedBudgetLimits](https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_budgets_Budget.html#awscostmanagement-Type-budgets_Budget-PlannedBudgetLimits) documentation.
PlannedLimits BudgetPlannedLimitArrayOutput `pulumi:"plannedLimits"`
// The end of the time period covered by the budget. There are no restrictions on the end date. Format: `2017-01-01_12:00`.
TimePeriodEnd pulumi.StringPtrOutput `pulumi:"timePeriodEnd"`
// The start of the time period covered by the budget. If you don't specify a start date, AWS defaults to the start of your chosen time period. The start date must come before the end date. Format: `2017-01-01_12:00`.
TimePeriodStart pulumi.StringOutput `pulumi:"timePeriodStart"`
// The length of time until a budget resets the actual and forecasted spend. Valid values: `MONTHLY`, `QUARTERLY`, `ANNUALLY`, and `DAILY`.
TimeUnit pulumi.StringOutput `pulumi:"timeUnit"`
}
// NewBudget registers a new resource with the given unique name, arguments, and options.
func NewBudget(ctx *pulumi.Context,
name string, args *BudgetArgs, opts ...pulumi.ResourceOption) (*Budget, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.BudgetType == nil {
return nil, errors.New("invalid value for required argument 'BudgetType'")
}
if args.TimeUnit == nil {
return nil, errors.New("invalid value for required argument 'TimeUnit'")
}
var resource Budget
err := ctx.RegisterResource("aws:budgets/budget:Budget", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetBudget gets an existing Budget 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 GetBudget(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *BudgetState, opts ...pulumi.ResourceOption) (*Budget, error) {
var resource Budget
err := ctx.ReadResource("aws:budgets/budget:Budget", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering Budget resources.
type budgetState struct {
// The ID of the target account for budget. Will use current user's accountId by default if omitted.
AccountId *string `pulumi:"accountId"`
// The ARN of the budget.
Arn *string `pulumi:"arn"`
// Object containing [AutoAdjustData] which determines the budget amount for an auto-adjusting budget.
AutoAdjustData *BudgetAutoAdjustData `pulumi:"autoAdjustData"`
// Whether this budget tracks monetary cost or usage.
BudgetType *string `pulumi:"budgetType"`
// Map of CostFilters key/value pairs to apply to the budget.
//
// Deprecated: Use the attribute "cost_filter" instead.
CostFilterLegacy map[string]string `pulumi:"costFilterLegacy"`
// A list of CostFilter name/values pair to apply to budget.
CostFilters []BudgetCostFilter `pulumi:"costFilters"`
// Object containing CostTypes The types of cost included in a budget, such as tax and subscriptions.
CostTypes *BudgetCostTypes `pulumi:"costTypes"`
// The amount of cost or usage being measured for a budget.
LimitAmount *string `pulumi:"limitAmount"`
// The unit of measurement used for the budget forecast, actual spend, or budget threshold, such as dollars or GB. See [Spend](http://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/data-type-spend.html) documentation.
LimitUnit *string `pulumi:"limitUnit"`
// The name of a budget. Unique within accounts.
Name *string `pulumi:"name"`
// The prefix of the name of a budget. Unique within accounts.
NamePrefix *string `pulumi:"namePrefix"`
// Object containing Budget Notifications. Can be used multiple times to define more than one budget notification.
Notifications []BudgetNotification `pulumi:"notifications"`
// Object containing Planned Budget Limits. Can be used multiple times to plan more than one budget limit. See [PlannedBudgetLimits](https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_budgets_Budget.html#awscostmanagement-Type-budgets_Budget-PlannedBudgetLimits) documentation.
PlannedLimits []BudgetPlannedLimit `pulumi:"plannedLimits"`
// The end of the time period covered by the budget. There are no restrictions on the end date. Format: `2017-01-01_12:00`.
TimePeriodEnd *string `pulumi:"timePeriodEnd"`
// The start of the time period covered by the budget. If you don't specify a start date, AWS defaults to the start of your chosen time period. The start date must come before the end date. Format: `2017-01-01_12:00`.
TimePeriodStart *string `pulumi:"timePeriodStart"`
// The length of time until a budget resets the actual and forecasted spend. Valid values: `MONTHLY`, `QUARTERLY`, `ANNUALLY`, and `DAILY`.
TimeUnit *string `pulumi:"timeUnit"`
}
type BudgetState struct {
// The ID of the target account for budget. Will use current user's accountId by default if omitted.
AccountId pulumi.StringPtrInput
// The ARN of the budget.
Arn pulumi.StringPtrInput
// Object containing [AutoAdjustData] which determines the budget amount for an auto-adjusting budget.
AutoAdjustData BudgetAutoAdjustDataPtrInput
// Whether this budget tracks monetary cost or usage.
BudgetType pulumi.StringPtrInput
// Map of CostFilters key/value pairs to apply to the budget.
//
// Deprecated: Use the attribute "cost_filter" instead.
CostFilterLegacy pulumi.StringMapInput
// A list of CostFilter name/values pair to apply to budget.
CostFilters BudgetCostFilterArrayInput
// Object containing CostTypes The types of cost included in a budget, such as tax and subscriptions.
CostTypes BudgetCostTypesPtrInput
// The amount of cost or usage being measured for a budget.
LimitAmount pulumi.StringPtrInput
// The unit of measurement used for the budget forecast, actual spend, or budget threshold, such as dollars or GB. See [Spend](http://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/data-type-spend.html) documentation.
LimitUnit pulumi.StringPtrInput
// The name of a budget. Unique within accounts.
Name pulumi.StringPtrInput
// The prefix of the name of a budget. Unique within accounts.
NamePrefix pulumi.StringPtrInput
// Object containing Budget Notifications. Can be used multiple times to define more than one budget notification.
Notifications BudgetNotificationArrayInput
// Object containing Planned Budget Limits. Can be used multiple times to plan more than one budget limit. See [PlannedBudgetLimits](https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_budgets_Budget.html#awscostmanagement-Type-budgets_Budget-PlannedBudgetLimits) documentation.
PlannedLimits BudgetPlannedLimitArrayInput
// The end of the time period covered by the budget. There are no restrictions on the end date. Format: `2017-01-01_12:00`.
TimePeriodEnd pulumi.StringPtrInput
// The start of the time period covered by the budget. If you don't specify a start date, AWS defaults to the start of your chosen time period. The start date must come before the end date. Format: `2017-01-01_12:00`.
TimePeriodStart pulumi.StringPtrInput
// The length of time until a budget resets the actual and forecasted spend. Valid values: `MONTHLY`, `QUARTERLY`, `ANNUALLY`, and `DAILY`.
TimeUnit pulumi.StringPtrInput
}
func (BudgetState) ElementType() reflect.Type {
return reflect.TypeOf((*budgetState)(nil)).Elem()
}
type budgetArgs struct {
// The ID of the target account for budget. Will use current user's accountId by default if omitted.
AccountId *string `pulumi:"accountId"`
// Object containing [AutoAdjustData] which determines the budget amount for an auto-adjusting budget.
AutoAdjustData *BudgetAutoAdjustData `pulumi:"autoAdjustData"`
// Whether this budget tracks monetary cost or usage.
BudgetType string `pulumi:"budgetType"`
// Map of CostFilters key/value pairs to apply to the budget.
//
// Deprecated: Use the attribute "cost_filter" instead.
CostFilterLegacy map[string]string `pulumi:"costFilterLegacy"`
// A list of CostFilter name/values pair to apply to budget.
CostFilters []BudgetCostFilter `pulumi:"costFilters"`
// Object containing CostTypes The types of cost included in a budget, such as tax and subscriptions.
CostTypes *BudgetCostTypes `pulumi:"costTypes"`
// The amount of cost or usage being measured for a budget.
LimitAmount *string `pulumi:"limitAmount"`
// The unit of measurement used for the budget forecast, actual spend, or budget threshold, such as dollars or GB. See [Spend](http://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/data-type-spend.html) documentation.
LimitUnit *string `pulumi:"limitUnit"`
// The name of a budget. Unique within accounts.
Name *string `pulumi:"name"`
// The prefix of the name of a budget. Unique within accounts.
NamePrefix *string `pulumi:"namePrefix"`
// Object containing Budget Notifications. Can be used multiple times to define more than one budget notification.
Notifications []BudgetNotification `pulumi:"notifications"`
// Object containing Planned Budget Limits. Can be used multiple times to plan more than one budget limit. See [PlannedBudgetLimits](https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_budgets_Budget.html#awscostmanagement-Type-budgets_Budget-PlannedBudgetLimits) documentation.
PlannedLimits []BudgetPlannedLimit `pulumi:"plannedLimits"`
// The end of the time period covered by the budget. There are no restrictions on the end date. Format: `2017-01-01_12:00`.
TimePeriodEnd *string `pulumi:"timePeriodEnd"`
// The start of the time period covered by the budget. If you don't specify a start date, AWS defaults to the start of your chosen time period. The start date must come before the end date. Format: `2017-01-01_12:00`.
TimePeriodStart *string `pulumi:"timePeriodStart"`
// The length of time until a budget resets the actual and forecasted spend. Valid values: `MONTHLY`, `QUARTERLY`, `ANNUALLY`, and `DAILY`.
TimeUnit string `pulumi:"timeUnit"`
}
// The set of arguments for constructing a Budget resource.
type BudgetArgs struct {
// The ID of the target account for budget. Will use current user's accountId by default if omitted.
AccountId pulumi.StringPtrInput
// Object containing [AutoAdjustData] which determines the budget amount for an auto-adjusting budget.
AutoAdjustData BudgetAutoAdjustDataPtrInput
// Whether this budget tracks monetary cost or usage.
BudgetType pulumi.StringInput
// Map of CostFilters key/value pairs to apply to the budget.
//
// Deprecated: Use the attribute "cost_filter" instead.
CostFilterLegacy pulumi.StringMapInput
// A list of CostFilter name/values pair to apply to budget.
CostFilters BudgetCostFilterArrayInput
// Object containing CostTypes The types of cost included in a budget, such as tax and subscriptions.
CostTypes BudgetCostTypesPtrInput
// The amount of cost or usage being measured for a budget.
LimitAmount pulumi.StringPtrInput
// The unit of measurement used for the budget forecast, actual spend, or budget threshold, such as dollars or GB. See [Spend](http://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/data-type-spend.html) documentation.
LimitUnit pulumi.StringPtrInput
// The name of a budget. Unique within accounts.
Name pulumi.StringPtrInput
// The prefix of the name of a budget. Unique within accounts.
NamePrefix pulumi.StringPtrInput
// Object containing Budget Notifications. Can be used multiple times to define more than one budget notification.
Notifications BudgetNotificationArrayInput
// Object containing Planned Budget Limits. Can be used multiple times to plan more than one budget limit. See [PlannedBudgetLimits](https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_budgets_Budget.html#awscostmanagement-Type-budgets_Budget-PlannedBudgetLimits) documentation.
PlannedLimits BudgetPlannedLimitArrayInput
// The end of the time period covered by the budget. There are no restrictions on the end date. Format: `2017-01-01_12:00`.
TimePeriodEnd pulumi.StringPtrInput
// The start of the time period covered by the budget. If you don't specify a start date, AWS defaults to the start of your chosen time period. The start date must come before the end date. Format: `2017-01-01_12:00`.
TimePeriodStart pulumi.StringPtrInput
// The length of time until a budget resets the actual and forecasted spend. Valid values: `MONTHLY`, `QUARTERLY`, `ANNUALLY`, and `DAILY`.
TimeUnit pulumi.StringInput
}
func (BudgetArgs) ElementType() reflect.Type {
return reflect.TypeOf((*budgetArgs)(nil)).Elem()
}
type BudgetInput interface {
pulumi.Input
ToBudgetOutput() BudgetOutput
ToBudgetOutputWithContext(ctx context.Context) BudgetOutput
}
func (*Budget) ElementType() reflect.Type {
return reflect.TypeOf((**Budget)(nil)).Elem()
}
func (i *Budget) ToBudgetOutput() BudgetOutput {
return i.ToBudgetOutputWithContext(context.Background())
}
func (i *Budget) ToBudgetOutputWithContext(ctx context.Context) BudgetOutput {
return pulumi.ToOutputWithContext(ctx, i).(BudgetOutput)
}
// BudgetArrayInput is an input type that accepts BudgetArray and BudgetArrayOutput values.
// You can construct a concrete instance of `BudgetArrayInput` via:
//
// BudgetArray{ BudgetArgs{...} }
type BudgetArrayInput interface {
pulumi.Input
ToBudgetArrayOutput() BudgetArrayOutput
ToBudgetArrayOutputWithContext(context.Context) BudgetArrayOutput
}
type BudgetArray []BudgetInput
func (BudgetArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*Budget)(nil)).Elem()
}
func (i BudgetArray) ToBudgetArrayOutput() BudgetArrayOutput {
return i.ToBudgetArrayOutputWithContext(context.Background())
}
func (i BudgetArray) ToBudgetArrayOutputWithContext(ctx context.Context) BudgetArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(BudgetArrayOutput)
}
// BudgetMapInput is an input type that accepts BudgetMap and BudgetMapOutput values.
// You can construct a concrete instance of `BudgetMapInput` via:
//
// BudgetMap{ "key": BudgetArgs{...} }
type BudgetMapInput interface {
pulumi.Input
ToBudgetMapOutput() BudgetMapOutput
ToBudgetMapOutputWithContext(context.Context) BudgetMapOutput
}
type BudgetMap map[string]BudgetInput
func (BudgetMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*Budget)(nil)).Elem()
}
func (i BudgetMap) ToBudgetMapOutput() BudgetMapOutput {
return i.ToBudgetMapOutputWithContext(context.Background())
}
func (i BudgetMap) ToBudgetMapOutputWithContext(ctx context.Context) BudgetMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(BudgetMapOutput)
}
type BudgetOutput struct{ *pulumi.OutputState }
func (BudgetOutput) ElementType() reflect.Type {
return reflect.TypeOf((**Budget)(nil)).Elem()
}
func (o BudgetOutput) ToBudgetOutput() BudgetOutput {
return o
}
func (o BudgetOutput) ToBudgetOutputWithContext(ctx context.Context) BudgetOutput {
return o
}
// The ID of the target account for budget. Will use current user's accountId by default if omitted.
func (o BudgetOutput) AccountId() pulumi.StringOutput {
return o.ApplyT(func(v *Budget) pulumi.StringOutput { return v.AccountId }).(pulumi.StringOutput)
}
// The ARN of the budget.
func (o BudgetOutput) Arn() pulumi.StringOutput {
return o.ApplyT(func(v *Budget) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
}
// Object containing [AutoAdjustData] which determines the budget amount for an auto-adjusting budget.
func (o BudgetOutput) AutoAdjustData() BudgetAutoAdjustDataPtrOutput {
return o.ApplyT(func(v *Budget) BudgetAutoAdjustDataPtrOutput { return v.AutoAdjustData }).(BudgetAutoAdjustDataPtrOutput)
}
// Whether this budget tracks monetary cost or usage.
func (o BudgetOutput) BudgetType() pulumi.StringOutput {
return o.ApplyT(func(v *Budget) pulumi.StringOutput { return v.BudgetType }).(pulumi.StringOutput)
}
// Map of CostFilters key/value pairs to apply to the budget.
//
// Deprecated: Use the attribute "cost_filter" instead.
func (o BudgetOutput) CostFilterLegacy() pulumi.StringMapOutput {
return o.ApplyT(func(v *Budget) pulumi.StringMapOutput { return v.CostFilterLegacy }).(pulumi.StringMapOutput)
}
// A list of CostFilter name/values pair to apply to budget.
func (o BudgetOutput) CostFilters() BudgetCostFilterArrayOutput {
return o.ApplyT(func(v *Budget) BudgetCostFilterArrayOutput { return v.CostFilters }).(BudgetCostFilterArrayOutput)
}
// Object containing CostTypes The types of cost included in a budget, such as tax and subscriptions.
func (o BudgetOutput) CostTypes() BudgetCostTypesOutput {
return o.ApplyT(func(v *Budget) BudgetCostTypesOutput { return v.CostTypes }).(BudgetCostTypesOutput)
}
// The amount of cost or usage being measured for a budget.
func (o BudgetOutput) LimitAmount() pulumi.StringOutput {
return o.ApplyT(func(v *Budget) pulumi.StringOutput { return v.LimitAmount }).(pulumi.StringOutput)
}
// The unit of measurement used for the budget forecast, actual spend, or budget threshold, such as dollars or GB. See [Spend](http://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/data-type-spend.html) documentation.
func (o BudgetOutput) LimitUnit() pulumi.StringOutput {
return o.ApplyT(func(v *Budget) pulumi.StringOutput { return v.LimitUnit }).(pulumi.StringOutput)
}
// The name of a budget. Unique within accounts.
func (o BudgetOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *Budget) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// The prefix of the name of a budget. Unique within accounts.
func (o BudgetOutput) NamePrefix() pulumi.StringOutput {
return o.ApplyT(func(v *Budget) pulumi.StringOutput { return v.NamePrefix }).(pulumi.StringOutput)
}
// Object containing Budget Notifications. Can be used multiple times to define more than one budget notification.
func (o BudgetOutput) Notifications() BudgetNotificationArrayOutput {
return o.ApplyT(func(v *Budget) BudgetNotificationArrayOutput { return v.Notifications }).(BudgetNotificationArrayOutput)
}
// Object containing Planned Budget Limits. Can be used multiple times to plan more than one budget limit. See [PlannedBudgetLimits](https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_budgets_Budget.html#awscostmanagement-Type-budgets_Budget-PlannedBudgetLimits) documentation.
func (o BudgetOutput) PlannedLimits() BudgetPlannedLimitArrayOutput {
return o.ApplyT(func(v *Budget) BudgetPlannedLimitArrayOutput { return v.PlannedLimits }).(BudgetPlannedLimitArrayOutput)
}
// The end of the time period covered by the budget. There are no restrictions on the end date. Format: `2017-01-01_12:00`.
func (o BudgetOutput) TimePeriodEnd() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Budget) pulumi.StringPtrOutput { return v.TimePeriodEnd }).(pulumi.StringPtrOutput)
}
// The start of the time period covered by the budget. If you don't specify a start date, AWS defaults to the start of your chosen time period. The start date must come before the end date. Format: `2017-01-01_12:00`.
func (o BudgetOutput) TimePeriodStart() pulumi.StringOutput {
return o.ApplyT(func(v *Budget) pulumi.StringOutput { return v.TimePeriodStart }).(pulumi.StringOutput)
}
// The length of time until a budget resets the actual and forecasted spend. Valid values: `MONTHLY`, `QUARTERLY`, `ANNUALLY`, and `DAILY`.
func (o BudgetOutput) TimeUnit() pulumi.StringOutput {
return o.ApplyT(func(v *Budget) pulumi.StringOutput { return v.TimeUnit }).(pulumi.StringOutput)
}
type BudgetArrayOutput struct{ *pulumi.OutputState }
func (BudgetArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*Budget)(nil)).Elem()
}
func (o BudgetArrayOutput) ToBudgetArrayOutput() BudgetArrayOutput {
return o
}
func (o BudgetArrayOutput) ToBudgetArrayOutputWithContext(ctx context.Context) BudgetArrayOutput {
return o
}
func (o BudgetArrayOutput) Index(i pulumi.IntInput) BudgetOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Budget {
return vs[0].([]*Budget)[vs[1].(int)]
}).(BudgetOutput)
}
type BudgetMapOutput struct{ *pulumi.OutputState }
func (BudgetMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*Budget)(nil)).Elem()
}
func (o BudgetMapOutput) ToBudgetMapOutput() BudgetMapOutput {
return o
}
func (o BudgetMapOutput) ToBudgetMapOutputWithContext(ctx context.Context) BudgetMapOutput {
return o
}
func (o BudgetMapOutput) MapIndex(k pulumi.StringInput) BudgetOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Budget {
return vs[0].(map[string]*Budget)[vs[1].(string)]
}).(BudgetOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*BudgetInput)(nil)).Elem(), &Budget{})
pulumi.RegisterInputType(reflect.TypeOf((*BudgetArrayInput)(nil)).Elem(), BudgetArray{})
pulumi.RegisterInputType(reflect.TypeOf((*BudgetMapInput)(nil)).Elem(), BudgetMap{})
pulumi.RegisterOutputType(BudgetOutput{})
pulumi.RegisterOutputType(BudgetArrayOutput{})
pulumi.RegisterOutputType(BudgetMapOutput{})
}