aws

package
v0.9.15 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 13, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AutoscalingGroupUsageSchema = append([]*schema.UsageItem{
	{Key: "instances", DefaultValue: 0, ValueType: schema.Int64},
}, InstanceUsageSchema...)
View Source
var DataTransferUsageSchema = []*schema.UsageItem{
	{Key: "monthly_intra_region_gb", DefaultValue: 0, ValueType: schema.Float64},
	{Key: "monthly_outbound_internet_gb", DefaultValue: 0, ValueType: schema.Float64},
	{Key: "monthly_outbound_us_east_to_us_east_gb", DefaultValue: 0, ValueType: schema.Float64},
	{Key: "monthly_outbound_other_regions_gb", DefaultValue: 0, ValueType: schema.Float64},
}

DataTransferUsageSchema defines a list which represents the usage schema of DataTransfer.

View Source
var DynamoDBTableUsageSchema = []*schema.UsageItem{
	{Key: "monthly_write_request_units", DefaultValue: 0, ValueType: schema.Int64},
	{Key: "monthly_read_request_units", DefaultValue: 0, ValueType: schema.Int64},
	{Key: "storage_gb", DefaultValue: 0, ValueType: schema.Int64},
	{Key: "pitr_backup_storage_gb", DefaultValue: 0, ValueType: schema.Int64},
	{Key: "on_demand_backup_storage_gb", DefaultValue: 0, ValueType: schema.Int64},
	{Key: "monthly_data_restored_gb", DefaultValue: 0, ValueType: schema.Int64},
	{Key: "monthly_streams_read_request_units", DefaultValue: 0, ValueType: schema.Int64},
}
View Source
var EBSVolumeSchema = []*schema.UsageItem{
	{Key: "monthly_standard_io_requests", DefaultValue: 0, ValueType: schema.Int64},
}
View Source
var EKSNodeGroupUsageSchema = append([]*schema.UsageItem{
	{Key: "instances", DefaultValue: 0, ValueType: schema.Int64},
}, InstanceUsageSchema...)
View Source
var InstanceUsageSchema = []*schema.UsageItem{
	{Key: "operating_system", DefaultValue: "linux", ValueType: schema.String},
	{Key: "reserved_instance_type", DefaultValue: "", ValueType: schema.String},
	{Key: "reserved_instance_term", DefaultValue: "", ValueType: schema.String},
	{Key: "reserved_instance_payment_option", DefaultValue: "", ValueType: schema.String},
	{Key: "monthly_cpu_credit_hrs", DefaultValue: 0, ValueType: schema.Int64},
	{Key: "vcpu_count", DefaultValue: 0, ValueType: schema.Int64},
}
View Source
var LambdaFunctionUsageSchema = []*schema.UsageItem{
	{Key: "request_duration_ms", DefaultValue: 0, ValueType: schema.Int64},
	{Key: "monthly_requests", DefaultValue: 0, ValueType: schema.Int64},
}
View Source
var LaunchConfigurationUsageSchema = InstanceUsageSchema
View Source
var LaunchTemplateUsageSchema = InstanceUsageSchema
View Source
var MWAAEnvironmentUsageSchema = []*schema.UsageItem{
	{Key: "additional_workers", DefaultValue: 0.0, ValueType: schema.Float64},
	{Key: "additional_schedulers", DefaultValue: 0.0, ValueType: schema.Float64},
	{Key: "meta_database_gb", DefaultValue: 0.0, ValueType: schema.Float64},
}

If the resource requires a usage parameter

View Source
var NATGatewayUsageSchema = []*schema.UsageItem{
	{Key: "monthly_data_processed_gb", DefaultValue: 0.0, ValueType: schema.Float64},
}
View Source
var RegionCodeMapping = map[string]string{
	"ap-southeast-1": "APS1",
}

RegionCodeMapping helps to find region's abbreviated code for a more granular filtering when resources may have multiple products for the same region.

View Source
var RegionMapping = map[string]string{
	"us-gov-west-1":   "AWS GovCloud (US-West)",
	"us-gov-east-1":   "AWS GovCloud (US-East)",
	"us-east-1":       "US East (N. Virginia)",
	"us-east-2":       "US East (Ohio)",
	"us-west-1":       "US West (N. California)",
	"us-west-2":       "US West (Oregon)",
	"us-west-2-lax-1": "US West (Los Angeles)",
	"ca-central-1":    "Canada (Central)",
	"cn-north-1":      "China (Beijing)",
	"cn-northwest-1":  "China (Ningxia)",
	"eu-central-1":    "EU (Frankfurt)",
	"eu-west-1":       "EU (Ireland)",
	"eu-west-2":       "EU (London)",
	"eu-south-1":      "EU (Milan)",
	"eu-west-3":       "EU (Paris)",
	"eu-north-1":      "EU (Stockholm)",
	"ap-east-1":       "Asia Pacific (Hong Kong)",
	"ap-northeast-1":  "Asia Pacific (Tokyo)",
	"ap-northeast-2":  "Asia Pacific (Seoul)",
	"ap-northeast-3":  "Asia Pacific (Osaka)",
	"ap-southeast-1":  "Asia Pacific (Singapore)",
	"ap-southeast-2":  "Asia Pacific (Sydney)",
	"ap-south-1":      "Asia Pacific (Mumbai)",
	"me-south-1":      "Middle East (Bahrain)",
	"sa-east-1":       "South America (Sao Paulo)",
	"af-south-1":      "Africa (Cape Town)",
}

RegionMapping is a helpful conversion map that changes aws region name to the name commonly used in pricing filters.

View Source
var RegionUsageSchema = []*schema.UsageItem{
	{Key: "us_gov_west_1", DefaultValue: 0, ValueType: schema.Float64},
	{Key: "us_gov_east_1", DefaultValue: 0, ValueType: schema.Float64},
	{Key: "us_east_1", DefaultValue: 0, ValueType: schema.Float64},
	{Key: "us_east_2", DefaultValue: 0, ValueType: schema.Float64},
	{Key: "us_west_1", DefaultValue: 0, ValueType: schema.Float64},
	{Key: "us_west_2", DefaultValue: 0, ValueType: schema.Float64},
	{Key: "us_west_2_lax_1", DefaultValue: 0, ValueType: schema.Float64},
	{Key: "ca_central_1", DefaultValue: 0, ValueType: schema.Float64},
	{Key: "cn_north_1", DefaultValue: 0, ValueType: schema.Float64},
	{Key: "cn_northwest_1", DefaultValue: 0, ValueType: schema.Float64},
	{Key: "eu_central_1", DefaultValue: 0, ValueType: schema.Float64},
	{Key: "eu_west_1", DefaultValue: 0, ValueType: schema.Float64},
	{Key: "eu_west_2", DefaultValue: 0, ValueType: schema.Float64},
	{Key: "eu_south_1", DefaultValue: 0, ValueType: schema.Float64},
	{Key: "eu_west_3", DefaultValue: 0, ValueType: schema.Float64},
	{Key: "eu_north_1", DefaultValue: 0, ValueType: schema.Float64},
	{Key: "ap_east_1", DefaultValue: 0, ValueType: schema.Float64},
	{Key: "ap_northeast_1", DefaultValue: 0, ValueType: schema.Float64},
	{Key: "ap_northeast_2", DefaultValue: 0, ValueType: schema.Float64},
	{Key: "ap_northeast_3", DefaultValue: 0, ValueType: schema.Float64},
	{Key: "ap_southeast_1", DefaultValue: 0, ValueType: schema.Float64},
	{Key: "ap_southeast_2", DefaultValue: 0, ValueType: schema.Float64},
	{Key: "ap_south_1", DefaultValue: 0, ValueType: schema.Float64},
	{Key: "me_south_1", DefaultValue: 0, ValueType: schema.Float64},
	{Key: "sa_east_1", DefaultValue: 0, ValueType: schema.Float64},
	{Key: "af_south_1", DefaultValue: 0, ValueType: schema.Float64},
}

RegionUsageSchema is the schema representation of the RegionsUsage type. This can be used as a schema.SubResourceUsage to define a structure that's commonly used with data transfer usage. e.g:

monthly_data_transfer_out_gb:
	us_gov_west_1: 122
	ca_central_1: 99

See DirectoryServiceDirectory for an example usage.

View Source
var S3BucketUsageSchema = []*schema.UsageItem{
	{Key: "object_tags", DefaultValue: 0, ValueType: schema.Int64},
	{Key: "standard", DefaultValue: &usage.ResourceUsage{Name: "standard", Items: S3StandardStorageClassUsageSchema}, ValueType: schema.SubResourceUsage},
	{Key: "intelligent_tiering", DefaultValue: &usage.ResourceUsage{Name: "intelligent_tiering", Items: S3IntelligentTieringStorageClassUsageSchema}, ValueType: schema.SubResourceUsage},
	{Key: "standard_infrequent_access", DefaultValue: &usage.ResourceUsage{Name: "standard_infrequent_access", Items: S3StandardInfrequentAccessStorageClassUsageSchema}, ValueType: schema.SubResourceUsage},
	{Key: "one_zone_infrequent_access", DefaultValue: &usage.ResourceUsage{Name: "one_zone_infrequent_access", Items: S3OneZoneInfrequentAccessStorageClassUsageSchema}, ValueType: schema.SubResourceUsage},
	{Key: "glacier_flexible_retrieval", DefaultValue: &usage.ResourceUsage{Name: "glacier_flexible_retrieval", Items: S3GlacierFlexibleRetrievalStorageClassUsageSchema}, ValueType: schema.SubResourceUsage},
	{Key: "glacier_deep_archive", DefaultValue: &usage.ResourceUsage{Name: "glacier_deep_archive", Items: S3GlacierDeepArchiveStorageClassUsageSchema}, ValueType: schema.SubResourceUsage},
}
View Source
var S3GlacierDeepArchiveStorageClassUsageSchema = []*schema.UsageItem{
	{Key: "storage_gb", DefaultValue: 0.0, ValueType: schema.Float64},
	{Key: "monthly_tier_1_requests", DefaultValue: 0, ValueType: schema.Int64},
	{Key: "monthly_tier_2_requests", DefaultValue: 0, ValueType: schema.Int64},
	{Key: "monthly_lifecycle_transition_requests", DefaultValue: 0, ValueType: schema.Int64},
	{Key: "monthly_standard_data_retrieval_requests", DefaultValue: 0, ValueType: schema.Int64},
	{Key: "monthly_standard_data_retrieval_gb", DefaultValue: 0.0, ValueType: schema.Float64},
	{Key: "monthly_bulk_data_retrieval_requests", DefaultValue: 0, ValueType: schema.Int64},
	{Key: "monthly_bulk_data_retrieval_gb", DefaultValue: 0.0, ValueType: schema.Float64},
	{Key: "early_delete_gb", DefaultValue: 0.0, ValueType: schema.Float64},
}
View Source
var S3GlacierFlexibleRetrievalStorageClassUsageSchema = []*schema.UsageItem{
	{Key: "storage_gb", DefaultValue: 0, ValueType: schema.Int64},
	{Key: "monthly_tier_1_requests", DefaultValue: 0, ValueType: schema.Int64},
	{Key: "monthly_tier_2_requests", DefaultValue: 0, ValueType: schema.Int64},
	{Key: "monthly_lifecycle_transition_requests", DefaultValue: 0, ValueType: schema.Int64},
	{Key: "monthly_standard_data_retrieval_requests", DefaultValue: 0, ValueType: schema.Int64},
	{Key: "monthly_standard_data_retrieval_gb", DefaultValue: 0.0, ValueType: schema.Float64},
	{Key: "monthly_standard_select_data_scanned_gb", DefaultValue: 0.0, ValueType: schema.Float64},
	{Key: "monthly_standard_select_data_returned_gb", DefaultValue: 0.0, ValueType: schema.Float64},
	{Key: "monthly_expedited_data_retrieval_requests", DefaultValue: 0, ValueType: schema.Int64},
	{Key: "monthly_expedited_data_retrieval_gb", DefaultValue: 0.0, ValueType: schema.Float64},
	{Key: "monthly_expedited_select_data_scanned_gb", DefaultValue: 0.0, ValueType: schema.Float64},
	{Key: "monthly_expedited_select_data_returned_gb", DefaultValue: 0.0, ValueType: schema.Float64},
	{Key: "monthly_bulk_select_data_scanned_gb", DefaultValue: 0.0, ValueType: schema.Float64},
	{Key: "monthly_bulk_select_data_returned_gb", DefaultValue: 0.0, ValueType: schema.Float64},
	{Key: "early_delete_gb", DefaultValue: 0.0, ValueType: schema.Float64},
}
View Source
var S3IntelligentTieringStorageClassUsageSchema = []*schema.UsageItem{
	{Key: "frequent_access_storage_gb", DefaultValue: 0.0, ValueType: schema.Float64},
	{Key: "infrequent_access_storage_gb", DefaultValue: 0.0, ValueType: schema.Float64},
	{Key: "archive_access_storage_gb", DefaultValue: 0.0, ValueType: schema.Float64},
	{Key: "deep_archive_access_storage_gb", DefaultValue: 0.0, ValueType: schema.Float64},
	{Key: "monitored_objects", DefaultValue: 0, ValueType: schema.Int64},
	{Key: "monthly_tier_1_requests", DefaultValue: 0, ValueType: schema.Int64},
	{Key: "monthly_tier_2_requests", DefaultValue: 0, ValueType: schema.Int64},
	{Key: "monthly_lifecycle_transition_requests", DefaultValue: 0, ValueType: schema.Int64},
	{Key: "monthly_select_data_scanned_gb", DefaultValue: 0.0, ValueType: schema.Float64},
	{Key: "monthly_select_data_returned_gb", DefaultValue: 0.0, ValueType: schema.Float64},
	{Key: "early_delete_gb", DefaultValue: 0.0, ValueType: schema.Float64},
}
View Source
var S3OneZoneInfrequentAccessStorageClassUsageSchema = []*schema.UsageItem{
	{Key: "storage_gb", DefaultValue: 0.0, ValueType: schema.Float64},
	{Key: "monthly_tier_1_requests", DefaultValue: 0, ValueType: schema.Int64},
	{Key: "monthly_tier_2_requests", DefaultValue: 0, ValueType: schema.Int64},
	{Key: "monthly_lifecycle_transition_requests", DefaultValue: 0, ValueType: schema.Int64},
	{Key: "monthly_data_retrieval_gb", DefaultValue: 0.0, ValueType: schema.Float64},
	{Key: "monthly_select_data_scanned_gb", DefaultValue: 0.0, ValueType: schema.Float64},
	{Key: "monthly_select_data_returned_gb", DefaultValue: 0.0, ValueType: schema.Float64},
}
View Source
var S3StandardInfrequentAccessStorageClassUsageSchema = []*schema.UsageItem{
	{Key: "storage_gb", DefaultValue: 0.0, ValueType: schema.Float64},
	{Key: "monthly_tier_1_requests", DefaultValue: 0, ValueType: schema.Int64},
	{Key: "monthly_tier_2_requests", DefaultValue: 0, ValueType: schema.Int64},
	{Key: "monthly_lifecycle_transition_requests", DefaultValue: 0, ValueType: schema.Int64},
	{Key: "monthly_data_retrieval_gb", DefaultValue: 0.0, ValueType: schema.Float64},
	{Key: "monthly_select_data_scanned_gb", DefaultValue: 0.0, ValueType: schema.Float64},
	{Key: "monthly_select_data_returned_gb", DefaultValue: 0.0, ValueType: schema.Float64},
}
View Source
var S3StandardStorageClassUsageSchema = []*schema.UsageItem{
	{Key: "storage_gb", DefaultValue: 0.0, ValueType: schema.Float64},
	{Key: "monthly_tier_1_requests", DefaultValue: 0, ValueType: schema.Int64},
	{Key: "monthly_tier_2_requests", DefaultValue: 0, ValueType: schema.Int64},
	{Key: "monthly_select_data_scanned_gb", DefaultValue: 0, ValueType: schema.Float64},
	{Key: "monthly_select_data_returned_gb", DefaultValue: 0, ValueType: schema.Float64},
}
View Source
var TransferServerUsageSchema = []*schema.UsageItem{
	{Key: "monthly_data_downloaded_gb", DefaultValue: 0, ValueType: schema.Float64},
	{Key: "monthly_data_uploaded_gb", DefaultValue: 0, ValueType: schema.Float64},
}

TransferServerUsageSchema defines a list of usage items for TransferServer.

Functions

This section is empty.

Types

type AutoscalingGroup added in v0.9.9

type AutoscalingGroup struct {
	// "required" args that can't really be missing.
	Address string
	Region  string
	Name    string

	// "optional" args, that may be empty depending on the resource config
	LaunchConfiguration *LaunchConfiguration
	LaunchTemplate      *LaunchTemplate
}

func (*AutoscalingGroup) BuildResource added in v0.9.9

func (a *AutoscalingGroup) BuildResource() *schema.Resource

func (*AutoscalingGroup) PopulateUsage added in v0.9.9

func (a *AutoscalingGroup) PopulateUsage(u *schema.UsageData)

type DataTransfer added in v0.9.14

type DataTransfer struct {
	Address string
	Region  string

	// "usage" args
	MonthlyInfraRegionGB            *float64 `infracost_usage:"monthly_intra_region_gb"`
	MonthlyOutboundInternetGB       *float64 `infracost_usage:"monthly_outbound_internet_gb"`
	MonthlyOutboundUsEastToUsEastGB *float64 `infracost_usage:"monthly_outbound_us_east_to_us_east_gb"`
	MonthlyOutboundOtherRegionsGB   *float64 `infracost_usage:"monthly_outbound_other_regions_gb"`
}

DataTransfer represents data transferred "in" to and "out" of Amazon EC2.

Pricing information here: https://aws.amazon.com/ec2/pricing/on-demand/

func (*DataTransfer) BuildResource added in v0.9.14

func (r *DataTransfer) BuildResource() *schema.Resource

BuildResource builds a schema.Resource from a valid DataTransfer. This method is called after the resource is initialised by an IaC provider. See providers folder for more information.

func (*DataTransfer) PopulateUsage added in v0.9.14

func (r *DataTransfer) PopulateUsage(u *schema.UsageData)

PopulateUsage parses the u schema.UsageData into the DataTransfer. It uses the `infracost_usage` struct tags to populate data into the DataTransfer.

type DirectoryServiceDirectory added in v0.9.12

type DirectoryServiceDirectory struct {
	// Address is the unique name of the resource in terraform/cloudfront.
	Address string
	// Region is the aws region the DirectoryServiceDirectory is provisioned within
	Region string
	// RegionName is the full region name used in product filters for the DirectoryService
	RegionName string

	// Type is the directory type. It can be one of (SimpleAD|ADConnector|MicrosoftAD)
	Type string
	// Edition is the edition of the MicrosoftAD type directory service. This field
	// is only applicable with MicrosoftAD and can either be (Standard|Enterprise).
	Edition string
	// The size of the directory, only applicable if the type is SimpleAD or ADConnector.
	// Values can be either (Small|Large)
	Size string

	// AdditionalDomainControllers represents a usage cost definition for the number controllers
	// above the default value (2) that are provisioned in this directory service.
	AdditionalDomainControllers *float64 `infracost_usage:"additional_domain_controllers"`

	// SharedAccounts represents the number of accounts/vpcs the directory is shared with.
	// This cost is only applicable if the type of directory is MicrosoftAD.
	// Directory Service sharing support is not supported by terraform aws at this time.
	// Therefore, this field is built from the usage cost file. An open issue referencing
	// shared directory support here: https://github.com/hashicorp/terraform-provider-aws/issues/6003
	SharedAccounts *float64 `infracost_usage:"shared_accounts"`
}

DirectoryServiceDirectory represents a single AWS Directory Service "Directory". AWS Directory Service has three main types: Microsoft AD, AD Connector & Simple AD. All the types are meant to support some form of Active Directory integration. Microsoft Active Directory is used by Windows applications to manage access and enable single sign-on. For example, you can manage access to Microsoft SharePoint using different Microsoft Active Directory security groups.

The Microsoft AD type is a fully managed Microsoft Active Directory service. The Simple AD type is a fully managed Samba service which is compatible with Microsoft Active Directory. The AD Connector type is a gateway with which you can redirect directory requests to your on-premises Microsoft Active Directory.

Read more about Directory service here: https://aws.amazon.com/directoryservice/ Microsoft Active Directory here: https://docs.aws.amazon.com/directoryservice/latest/admin-guide/directory_microsoft_ad.html Other Supported Active Directory types here:

https://docs.aws.amazon.com/directoryservice/latest/admin-guide/directory_simple_ad.html
https://docs.aws.amazon.com/directoryservice/latest/admin-guide/directory_simple_ad.html

DirectoryServicePricing pricing is based on

> Hourly price based on the type and edition (only Microsoft AD) of the directory service directory > Additional hourly price added directory per account/vpc the directory is shared with (only Microsoft AD) > Costs for data transfer out (on a per-region basis)

More information on pricing can be found here:

https://aws.amazon.com/directoryservice/pricing/
https://aws.amazon.com/directoryservice/other-directories-pricing/

func (*DirectoryServiceDirectory) BuildResource added in v0.9.12

func (d *DirectoryServiceDirectory) BuildResource() *schema.Resource

BuildResource builds a schema.Resource from a valid DirectoryServiceDirectory.

func (*DirectoryServiceDirectory) PopulateUsage added in v0.9.12

func (d *DirectoryServiceDirectory) PopulateUsage(u *schema.UsageData)

PopulateUsage parses the u schema.Usage into the DirectoryServiceDirectory. It uses the `infracost_usage` struct tags to populate data into the DirectoryServiceDirectory.

type DynamoDBTable added in v0.9.8

type DynamoDBTable struct {
	// "required" args that can't really be missing.
	Address        string
	Region         string
	Name           string
	BillingMode    string
	ReplicaRegions []string

	// "optional" args, that may be empty depending on the resource config
	WriteCapacity *int64
	ReadCapacity  *int64

	// "usage" args
	MonthlyWriteRequestUnits       *int64 `infracost_usage:"monthly_write_request_units"`
	MonthlyReadRequestUnits        *int64 `infracost_usage:"monthly_read_request_units"`
	StorageGB                      *int64 `infracost_usage:"storage_gb"`
	PitrBackupStorageGB            *int64 `infracost_usage:"pitr_backup_storage_gb"`
	OnDemandBackupStorageGB        *int64 `infracost_usage:"on_demand_backup_storage_gb"`
	MonthlyDataRestoredGB          *int64 `infracost_usage:"monthly_data_restored_gb"`
	MonthlyStreamsReadRequestUnits *int64 `infracost_usage:"monthly_streams_read_request_units"`
}

func (*DynamoDBTable) BuildResource added in v0.9.8

func (a *DynamoDBTable) BuildResource() *schema.Resource

func (*DynamoDBTable) PopulateUsage added in v0.9.8

func (a *DynamoDBTable) PopulateUsage(u *schema.UsageData)

type EBSVolume added in v0.9.9

type EBSVolume struct {
	// "required" args that can't really be missing.
	Address    string
	Region     string
	Type       string
	IOPS       int64
	Throughput int64

	// "optional" args that can be empty strings.
	Size *int64

	// "usage" args
	MonthlyStandardIORequests *int64 `infracost_usage:"monthly_standard_io_requests"`
}

func (*EBSVolume) BuildResource added in v0.9.9

func (a *EBSVolume) BuildResource() *schema.Resource

func (*EBSVolume) PopulateUsage added in v0.9.9

func (a *EBSVolume) PopulateUsage(u *schema.UsageData)

type EKSNodeGroup added in v0.9.9

type EKSNodeGroup struct {
	// "required" args that can't really be missing.
	Address     string
	Region      string
	Name        string
	ClusterName string

	InstanceType   string
	PurchaseOption string
	DiskSize       int64

	// "optional" args, that may be empty depending on the resource config
	RootBlockDevice *EBSVolume
	LaunchTemplate  *LaunchTemplate

	// "usage" args
	InstanceCount                 *int64  `infracost_usage:"instances"`
	OperatingSystem               *string `infracost_usage:"operating_system"`
	ReservedInstanceType          *string `infracost_usage:"reserved_instance_type"`
	ReservedInstanceTerm          *string `infracost_usage:"reserved_instance_term"`
	ReservedInstancePaymentOption *string `infracost_usage:"reserved_instance_payment_option"`
	MonthlyCPUCreditHours         *int64  `infracost_usage:"monthly_cpu_credit_hrs"`
	VCPUCount                     *int64  `infracost_usage:"vcpu_count"`
}

func (*EKSNodeGroup) BuildResource added in v0.9.9

func (a *EKSNodeGroup) BuildResource() *schema.Resource

func (*EKSNodeGroup) PopulateUsage added in v0.9.9

func (a *EKSNodeGroup) PopulateUsage(u *schema.UsageData)

type Instance added in v0.9.9

type Instance struct {
	// "required" args that can't really be missing.
	Address          string
	Region           string
	Tenancy          string
	PurchaseOption   string
	AMI              string
	InstanceType     string
	EBSOptimized     bool
	EnableMonitoring bool
	CPUCredits       string

	// "optional" args, that may be empty depending on the resource config
	ElasticInferenceAcceleratorType *string
	RootBlockDevice                 *EBSVolume
	EBSBlockDevices                 []*EBSVolume

	// "usage" args
	OperatingSystem               *string `infracost_usage:"operating_system"`
	ReservedInstanceType          *string `infracost_usage:"reserved_instance_type"`
	ReservedInstanceTerm          *string `infracost_usage:"reserved_instance_term"`
	ReservedInstancePaymentOption *string `infracost_usage:"reserved_instance_payment_option"`
	MonthlyCPUCreditHours         *int64  `infracost_usage:"monthly_cpu_credit_hrs"`
	VCPUCount                     *int64  `infracost_usage:"vcpu_count"`
}

func (*Instance) BuildResource added in v0.9.9

func (a *Instance) BuildResource() *schema.Resource

func (*Instance) PopulateUsage added in v0.9.9

func (a *Instance) PopulateUsage(u *schema.UsageData)

type LambdaFunction added in v0.9.8

type LambdaFunction struct {
	Address    string
	Region     string
	Name       string
	MemorySize int64

	RequestDurationMS *int64 `infracost_usage:"request_duration_ms"`
	MonthlyRequests   *int64 `infracost_usage:"monthly_requests"`
}

func (*LambdaFunction) BuildResource added in v0.9.8

func (a *LambdaFunction) BuildResource() *schema.Resource

func (*LambdaFunction) PopulateUsage added in v0.9.8

func (a *LambdaFunction) PopulateUsage(u *schema.UsageData)

type LaunchConfiguration added in v0.9.9

type LaunchConfiguration struct {
	// "required" args that can't really be missing.
	Address          string
	Region           string
	Tenancy          string
	PurchaseOption   string
	AMI              string
	InstanceType     string
	EBSOptimized     bool
	EnableMonitoring bool
	CPUCredits       string

	// "optional" args, that may be empty depending on the resource config
	ElasticInferenceAcceleratorType *string
	RootBlockDevice                 *EBSVolume
	EBSBlockDevices                 []*EBSVolume

	// "usage" args
	// These are populated from the Autoscaling Group resource
	InstanceCount                 *int64  `infracost_usage:"instances"`
	OperatingSystem               *string `infracost_usage:"operating_system"`
	ReservedInstanceType          *string `infracost_usage:"reserved_instance_type"`
	ReservedInstanceTerm          *string `infracost_usage:"reserved_instance_term"`
	ReservedInstancePaymentOption *string `infracost_usage:"reserved_instance_payment_option"`
	MonthlyCPUCreditHours         *int64  `infracost_usage:"monthly_cpu_credit_hrs"`
	VCPUCount                     *int64  `infracost_usage:"vcpu_count"`
}

func (*LaunchConfiguration) BuildResource added in v0.9.9

func (a *LaunchConfiguration) BuildResource() *schema.Resource

func (*LaunchConfiguration) PopulateUsage added in v0.9.9

func (a *LaunchConfiguration) PopulateUsage(u *schema.UsageData)

type LaunchTemplate added in v0.9.9

type LaunchTemplate struct {
	// "required" args that can't really be missing.
	Address                          string
	Region                           string
	AMI                              string
	OnDemandBaseCount                int64
	OnDemandPercentageAboveBaseCount int64
	Tenancy                          string
	InstanceType                     string
	EBSOptimized                     bool
	EnableMonitoring                 bool
	CPUCredits                       string

	// "optional" args, that may be empty depending on the resource config
	ElasticInferenceAcceleratorType *string
	RootBlockDevice                 *EBSVolume
	EBSBlockDevices                 []*EBSVolume

	// "usage" args
	// These are populated from the Autoscaling Group/EKS Node Group resource
	InstanceCount                 *int64  `infracost_usage:"instances"`
	OperatingSystem               *string `infracost_usage:"operating_system"`
	ReservedInstanceType          *string `infracost_usage:"reserved_instance_type"`
	ReservedInstanceTerm          *string `infracost_usage:"reserved_instance_term"`
	ReservedInstancePaymentOption *string `infracost_usage:"reserved_instance_payment_option"`
	MonthlyCPUCreditHours         *int64  `infracost_usage:"monthly_cpu_credit_hrs"`
	VCPUCount                     *int64  `infracost_usage:"vcpu_count"`
}

func (*LaunchTemplate) BuildResource added in v0.9.9

func (a *LaunchTemplate) BuildResource() *schema.Resource

func (*LaunchTemplate) PopulateUsage added in v0.9.9

func (a *LaunchTemplate) PopulateUsage(u *schema.UsageData)

type MWAAEnvironment added in v0.9.10

type MWAAEnvironment struct {
	// These fields are required since they are pulled directly from the IAC configuration (e.g. the terraform plan)
	Address string
	Region  string
	Size    string // Should be Small, Medium, or Large

	// If there is a parameter than needs to be read from infracost-usage.yml you define it like this:
	AdditionalWorkers    *float64 `infracost_usage:"additional_workers"`
	AdditionalSchedulers *float64 `infracost_usage:"additional_schedulers"`
	MetaDatabaseGB       *float64 `infracost_usage:"meta_database_gb"`
}

func (*MWAAEnvironment) BuildResource added in v0.9.10

func (a *MWAAEnvironment) BuildResource() *schema.Resource

func (*MWAAEnvironment) PopulateUsage added in v0.9.10

func (a *MWAAEnvironment) PopulateUsage(u *schema.UsageData)

If the resource requires a usage parameter

type NATGateway added in v0.9.8

type NATGateway struct {
	Address string
	Region  string

	MonthlyDataProcessedGB *float64 `infracost_usage:"monthly_data_processed_gb"`
}

func (*NATGateway) BuildResource added in v0.9.8

func (a *NATGateway) BuildResource() *schema.Resource

func (*NATGateway) PopulateUsage added in v0.9.8

func (a *NATGateway) PopulateUsage(u *schema.UsageData)

type RegionUsage added in v0.9.12

type RegionUsage struct {
	Key   string
	Value float64
}

RegionUsage defines a hard definition in the regions map.

type RegionsUsage added in v0.9.12

type RegionsUsage struct {
	USGovWest1   *float64 `infracost_usage:"us_gov_west_1"`
	USGovEast1   *float64 `infracost_usage:"us_gov_east_1"`
	USEast1      *float64 `infracost_usage:"us_east_1"`
	USEast2      *float64 `infracost_usage:"us_east_2"`
	USWest1      *float64 `infracost_usage:"us_west_1"`
	USWest2      *float64 `infracost_usage:"us_west_2"`
	USWest2Lax1  *float64 `infracost_usage:"us_west_2_lax_1"`
	CACentral1   *float64 `infracost_usage:"ca_central_1"`
	CNNorth1     *float64 `infracost_usage:"cn_north_1"`
	CNNorthwest1 *float64 `infracost_usage:"cn_northwest_1"`
	EUCentral1   *float64 `infracost_usage:"eu_central_1"`
	EUWest1      *float64 `infracost_usage:"eu_west_1"`
	EUWest2      *float64 `infracost_usage:"eu_west_2"`
	EUSouth1     *float64 `infracost_usage:"eu_south_1"`
	EUWest3      *float64 `infracost_usage:"eu_west_3"`
	EUNorth1     *float64 `infracost_usage:"eu_north_1"`
	APEast1      *float64 `infracost_usage:"ap_east_1"`
	APNortheast1 *float64 `infracost_usage:"ap_northeast_1"`
	APNortheast2 *float64 `infracost_usage:"ap_northeast_2"`
	APNortheast3 *float64 `infracost_usage:"ap_northeast_3"`
	APSoutheast1 *float64 `infracost_usage:"ap_southeast_1"`
	APSoutheast2 *float64 `infracost_usage:"ap_southeast_2"`
	APSouth1     *float64 `infracost_usage:"ap_south_1"`
	MESouth1     *float64 `infracost_usage:"me_south_1"`
	SAEast1      *float64 `infracost_usage:"sa_east_1"`
	AFSouth1     *float64 `infracost_usage:"af_south_1"`
}

RegionsUsage is a reusable type that represents a usage cost map. This can be used in resources that define a usage parameter that's changed on a per-region basis. e.g.

monthly_data_processed_gb:

us_gov_west_1: 188
us_east_1: 78

can be handled by adding a usage cost property to your resource like so:

type MyResource struct {
   ...
   MonthlyDataProcessedGB *RegionsUsage `infracost_usage:"monthly_processed_gb"`
}

func (RegionsUsage) Values added in v0.9.12

func (r RegionsUsage) Values() []RegionUsage

Values returns RegionUsage as a slice which can be iterated over to create cost components. The keys of the regions returned have their underscores replaced with hypens so they can be used in product filters and cost lookups.

type S3Bucket added in v0.9.11

type S3Bucket struct {
	// "required" args that can't really be missing.
	Address           string
	Region            string
	Name              string
	ObjectTagsEnabled bool

	// "optional" args, that may be empty depending on the resource config
	LifecycleStorageClasses []string

	// "usage" args
	ObjectTags *int64 `infracost_usage:"object_tags"`
	// contains filtered or unexported fields
}

func (*S3Bucket) AllStorageClasses added in v0.9.11

func (a *S3Bucket) AllStorageClasses() []S3StorageClass

func (*S3Bucket) BuildResource added in v0.9.11

func (a *S3Bucket) BuildResource() *schema.Resource

func (*S3Bucket) PopulateUsage added in v0.9.11

func (a *S3Bucket) PopulateUsage(u *schema.UsageData)

type S3GlacierDeepArchiveStorageClass added in v0.9.11

type S3GlacierDeepArchiveStorageClass struct {
	// "required" args that can't really be missing.
	Region string

	// "usage" args
	StorageGB                            *float64 `infracost_usage:"storage_gb"`
	MonthlyTier1Requests                 *int64   `infracost_usage:"monthly_tier_1_requests"`
	MonthlyTier2Requests                 *int64   `infracost_usage:"monthly_tier_2_requests"`
	MonthlyLifecycleTransitionRequests   *int64   `infracost_usage:"monthly_lifecycle_transition_requests"`
	MonthlyStandardDataRetrievalRequests *int64   `infracost_usage:"monthly_standard_data_retrieval_requests"`
	MonthlyStandardDataRetrievalGB       *float64 `infracost_usage:"monthly_standard_data_retrieval_gb"`
	MonthlyBulkDataRetrievalRequests     *int64   `infracost_usage:"monthly_bulk_data_retrieval_requests"`
	MonthlyBulkDataRetrievalGB           *float64 `infracost_usage:"monthly_bulk_data_retrieval_gb"`
	EarlyDeleteGB                        *float64 `infracost_usage:"early_delete_gb"`
}

func (*S3GlacierDeepArchiveStorageClass) BuildResource added in v0.9.11

func (a *S3GlacierDeepArchiveStorageClass) BuildResource() *schema.Resource

func (*S3GlacierDeepArchiveStorageClass) PopulateUsage added in v0.9.11

func (a *S3GlacierDeepArchiveStorageClass) PopulateUsage(u *schema.UsageData)

func (*S3GlacierDeepArchiveStorageClass) UsageKey added in v0.9.11

type S3GlacierFlexibleRetrievalStorageClass added in v0.9.15

type S3GlacierFlexibleRetrievalStorageClass struct {
	// "required" args that can't really be missing.
	Region string

	// "usage" args
	StorageGB                             *float64 `infracost_usage:"storage_gb"`
	MonthlyTier1Requests                  *int64   `infracost_usage:"monthly_tier_1_requests"`
	MonthlyTier2Requests                  *int64   `infracost_usage:"monthly_tier_2_requests"`
	MonthlyLifecycleTransitionRequests    *int64   `infracost_usage:"monthly_lifecycle_transition_requests"`
	MonthlyStandardDataRetrievalRequests  *int64   `infracost_usage:"monthly_standard_data_retrieval_requests"`
	MonthlyStandardDataRetrievalGB        *float64 `infracost_usage:"monthly_standard_data_retrieval_gb"`
	MonthlyStandardSelectDataScannedGB    *float64 `infracost_usage:"monthly_standard_select_data_scanned_gb"`
	MonthlyStandardSelectDataReturnedGB   *float64 `infracost_usage:"monthly_standard_select_data_returned_gb"`
	MonthlyExpeditedDataRetrievalRequests *int64   `infracost_usage:"monthly_expedited_data_retrieval_requests"`
	MonthlyExpeditedDataRetrievalGB       *float64 `infracost_usage:"monthly_expedited_data_retrieval_gb"`
	MonthlyExpeditedSelectDataScannedGB   *float64 `infracost_usage:"monthly_expedited_select_data_scanned_gb"`
	MonthlyExpeditedSelectDataReturnedGB  *float64 `infracost_usage:"monthly_expedited_select_data_returned_gb"`
	MonthlyBulkSelectDataScannedGB        *float64 `infracost_usage:"monthly_bulk_select_data_scanned_gb"`
	MonthlyBulkSelectDataReturnedGB       *float64 `infracost_usage:"monthly_bulk_select_data_returned_gb"`
	EarlyDeleteGB                         *float64 `infracost_usage:"early_delete_gb"`
}

func (*S3GlacierFlexibleRetrievalStorageClass) BuildResource added in v0.9.15

func (*S3GlacierFlexibleRetrievalStorageClass) PopulateUsage added in v0.9.15

func (*S3GlacierFlexibleRetrievalStorageClass) UsageKey added in v0.9.15

type S3IntelligentTieringStorageClass added in v0.9.11

type S3IntelligentTieringStorageClass struct {
	// "required" args that can't really be missing.
	Region string

	// "usage" args
	FrequentAccessStorageGB            *float64 `infracost_usage:"frequent_access_storage_gb"`
	InfrequentAccessStorageGB          *float64 `infracost_usage:"infrequent_access_storage_gb"`
	ArchiveAccessStorageGB             *float64 `infracost_usage:"archive_access_storage_gb"`
	DeepArchiveAccessStorageGB         *float64 `infracost_usage:"deep_archive_access_storage_gb"`
	MonitoredObjects                   *int64   `infracost_usage:"monitored_objects"`
	MonthlyTier1Requests               *int64   `infracost_usage:"monthly_tier_1_requests"`
	MonthlyTier2Requests               *int64   `infracost_usage:"monthly_tier_2_requests"`
	MonthlyLifecycleTransitionRequests *int64   `infracost_usage:"monthly_lifecycle_transition_requests"`
	MonthlySelectDataScannedGB         *float64 `infracost_usage:"monthly_select_data_scanned_gb"`
	MonthlySelectDataReturnedGB        *float64 `infracost_usage:"monthly_select_data_returned_gb"`
	EarlyDeleteGB                      *float64 `infracost_usage:"early_delete_gb"`
}

func (*S3IntelligentTieringStorageClass) BuildResource added in v0.9.11

func (a *S3IntelligentTieringStorageClass) BuildResource() *schema.Resource

func (*S3IntelligentTieringStorageClass) PopulateUsage added in v0.9.11

func (a *S3IntelligentTieringStorageClass) PopulateUsage(u *schema.UsageData)

func (*S3IntelligentTieringStorageClass) UsageKey added in v0.9.11

type S3OneZoneInfrequentAccessStorageClass added in v0.9.11

type S3OneZoneInfrequentAccessStorageClass struct {
	// "required" args that can't really be missing.
	Region string

	// "usage" args
	StorageGB                          *float64 `infracost_usage:"storage_gb"`
	MonthlyTier1Requests               *int64   `infracost_usage:"monthly_tier_1_requests"`
	MonthlyTier2Requests               *int64   `infracost_usage:"monthly_tier_2_requests"`
	MonthlyLifecycleTransitionRequests *int64   `infracost_usage:"monthly_lifecycle_transition_requests"`
	MonthlyDataRetrievalGB             *float64 `infracost_usage:"monthly_data_retrieval_gb"`
	MonthlySelectDataScannedGB         *float64 `infracost_usage:"monthly_select_data_scanned_gb"`
	MonthlySelectDataReturnedGB        *float64 `infracost_usage:"monthly_select_data_returned_gb"`
}

func (*S3OneZoneInfrequentAccessStorageClass) BuildResource added in v0.9.11

func (*S3OneZoneInfrequentAccessStorageClass) PopulateUsage added in v0.9.11

func (*S3OneZoneInfrequentAccessStorageClass) UsageKey added in v0.9.11

type S3StandardInfrequentAccessStorageClass added in v0.9.11

type S3StandardInfrequentAccessStorageClass struct {
	// "required" args that can't really be missing.
	Region string

	// "usage" args
	StorageGB                          *float64 `infracost_usage:"storage_gb"`
	MonthlyTier1Requests               *int64   `infracost_usage:"monthly_tier_1_requests"`
	MonthlyTier2Requests               *int64   `infracost_usage:"monthly_tier_2_requests"`
	MonthlyLifecycleTransitionRequests *int64   `infracost_usage:"monthly_lifecycle_transition_requests"`
	MonthlyDataRetrievalGB             *float64 `infracost_usage:"monthly_data_retrieval_gb"`
	MonthlySelectDataScannedGB         *float64 `infracost_usage:"monthly_select_data_scanned_gb"`
	MonthlySelectDataReturnedGB        *float64 `infracost_usage:"monthly_select_data_returned_gb"`
}

func (*S3StandardInfrequentAccessStorageClass) BuildResource added in v0.9.11

func (*S3StandardInfrequentAccessStorageClass) PopulateUsage added in v0.9.11

func (*S3StandardInfrequentAccessStorageClass) UsageKey added in v0.9.11

type S3StandardStorageClass added in v0.9.11

type S3StandardStorageClass struct {
	// "required" args that can't really be missing.
	Region string

	// "usage" args
	StorageGB                   *float64 `infracost_usage:"storage_gb"`
	MonthlyTier1Requests        *int64   `infracost_usage:"monthly_tier_1_requests"`
	MonthlyTier2Requests        *int64   `infracost_usage:"monthly_tier_2_requests"`
	MonthlySelectDataScannedGB  *float64 `infracost_usage:"monthly_select_data_scanned_gb"`
	MonthlySelectDataReturnedGB *float64 `infracost_usage:"monthly_select_data_returned_gb"`
}

func (*S3StandardStorageClass) BuildResource added in v0.9.11

func (a *S3StandardStorageClass) BuildResource() *schema.Resource

func (*S3StandardStorageClass) PopulateUsage added in v0.9.11

func (a *S3StandardStorageClass) PopulateUsage(u *schema.UsageData)

func (*S3StandardStorageClass) UsageKey added in v0.9.11

func (a *S3StandardStorageClass) UsageKey() string

type S3StorageClass added in v0.9.11

type S3StorageClass interface {
	UsageKey() string
	PopulateUsage(u *schema.UsageData)
	BuildResource() *schema.Resource
}

type TransferServer added in v0.9.13

type TransferServer struct {
	Address   string
	Region    string
	Protocols []string

	// "usage" args
	MonthlyDataDownloadedGB *float64 `infracost_usage:"monthly_data_downloaded_gb"`
	MonthlyDataUploadedGB   *float64 `infracost_usage:"monthly_data_uploaded_gb"`
}

TransferServer defines a AWS Transfer Server resource from Transfer Family service. It supports multiple transfer protocols like FTP/FTPS/SFTP and each is billed hourly when enabled. It also bills the amount of data being downloaded/uploaded over those protocols.

See more resource information here: https://aws.amazon.com/aws-transfer-family/.

See the pricing information here: https://aws.amazon.com/aws-transfer-family/pricing/.

func (*TransferServer) BuildResource added in v0.9.13

func (r *TransferServer) BuildResource() *schema.Resource

BuildResource builds a schema.Resource from a valid TransferServer struct. This method is called after the resource is initialised by an IaC provider.

func (*TransferServer) PopulateUsage added in v0.9.13

func (r *TransferServer) PopulateUsage(u *schema.UsageData)

PopulateUsage parses the u schema.UsageData into the TransferServer. It uses the `infracost_usage` struct tags to populate data into the TransferServer.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL