-
Notifications
You must be signed in to change notification settings - Fork 523
/
route53_zone.go
50 lines (43 loc) 路 1.17 KB
/
route53_zone.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
package aws
import (
"github.com/infracost/infracost/internal/resources"
"github.com/infracost/infracost/internal/schema"
"github.com/shopspring/decimal"
)
type Route53Zone struct {
Address string
}
func (r *Route53Zone) CoreType() string {
return "Route53Zone"
}
func (r *Route53Zone) UsageSchema() []*schema.UsageItem {
return []*schema.UsageItem{}
}
func (r *Route53Zone) PopulateUsage(u *schema.UsageData) {
resources.PopulateArgsWithUsage(r, u)
}
func (r *Route53Zone) BuildResource() *schema.Resource {
return &schema.Resource{
Name: r.Address,
CostComponents: []*schema.CostComponent{
{
Name: "Hosted zone",
Unit: "months",
UnitMultiplier: decimal.NewFromInt(1),
MonthlyQuantity: decimalPtr(decimal.NewFromInt(1)),
ProductFilter: &schema.ProductFilter{
VendorName: strPtr("aws"),
Service: strPtr("AmazonRoute53"),
ProductFamily: strPtr("DNS Zone"),
AttributeFilters: []*schema.AttributeFilter{
{Key: "usagetype", Value: strPtr("HostedZone")},
},
},
PriceFilter: &schema.PriceFilter{
StartUsageAmount: strPtr("0"),
},
},
},
UsageSchema: r.UsageSchema(),
}
}