-
Notifications
You must be signed in to change notification settings - Fork 522
/
cloudwatch_dashboard.go
47 lines (40 loc) 路 1.14 KB
/
cloudwatch_dashboard.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
package aws
import (
"github.com/infracost/infracost/internal/resources"
"github.com/infracost/infracost/internal/schema"
"github.com/shopspring/decimal"
)
type CloudwatchDashboard struct {
Address string
}
func (r *CloudwatchDashboard) CoreType() string {
return "CloudwatchDashboard"
}
func (r *CloudwatchDashboard) UsageSchema() []*schema.UsageItem {
return []*schema.UsageItem{}
}
func (r *CloudwatchDashboard) PopulateUsage(u *schema.UsageData) {
resources.PopulateArgsWithUsage(r, u)
}
func (r *CloudwatchDashboard) BuildResource() *schema.Resource {
return &schema.Resource{
Name: r.Address,
CostComponents: []*schema.CostComponent{
{
Name: "Dashboard",
Unit: "months",
UnitMultiplier: decimal.NewFromInt(1),
MonthlyQuantity: decimalPtr(decimal.NewFromInt(1)),
ProductFilter: &schema.ProductFilter{
VendorName: strPtr("aws"),
Service: strPtr("AmazonCloudWatch"),
ProductFamily: strPtr("Dashboard"),
AttributeFilters: []*schema.AttributeFilter{
{Key: "usagetype", Value: strPtr("DashboardsUsageHour")},
},
},
},
},
UsageSchema: r.UsageSchema(),
}
}