prices

package
v0.10.36 Latest Latest
Warning

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

Go to latest
Published: May 7, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FetchUsageData added in v0.10.12

func FetchUsageData(ctx *config.RunContext, project *schema.Project) (schema.UsageMap, error)

FetchUsageData fetches usage estimates derived from cloud provider reported usage from the Infracost Cloud Usage API for each supported resource in the project

func PopulateActualCosts added in v0.10.12

func PopulateActualCosts(ctx *config.RunContext, project *schema.Project) error

PopulateActualCosts fetches cloud provider reported costs from the Infracost Cloud Usage API and adds corresponding cost components to the project's resources

func UploadCloudResourceIDs added in v0.10.13

func UploadCloudResourceIDs(ctx *config.RunContext, project *schema.Project) error

UploadCloudResourceIDs sends the project scoped cloud resource ids to the Usage API, so they can be used to provide usage estimates.

Types

type PriceFetcher added in v0.10.36

type PriceFetcher struct {
	// contains filtered or unexported fields
}

PriceFetcher provides a thread-safe way to aggregate 'price not found' data. This is used to provide a summary of missing prices at the end of a run. It should be used as a singleton which is shared across the application.

func NewPriceFetcher added in v0.10.36

func NewPriceFetcher(ctx *config.RunContext) *PriceFetcher

func (*PriceFetcher) LogWarnings added in v0.10.36

func (p *PriceFetcher) LogWarnings()

LogWarnings writes the PriceFetcher prices to the application log. If the log level is above the debug level we also include resource names the log output.

func (*PriceFetcher) MissingPricesComponents added in v0.10.36

func (p *PriceFetcher) MissingPricesComponents() []string

MissingPricesComponents returns a map of missing prices by component name, component names are in the format: resource_type.cost_component_name.

func (*PriceFetcher) MissingPricesLen added in v0.10.36

func (p *PriceFetcher) MissingPricesLen() int

MissingPricesLen returns the number of missing prices.

func (*PriceFetcher) PopulatePrices added in v0.10.36

func (p *PriceFetcher) PopulatePrices(project *schema.Project) error

Jump to

Keyboard shortcuts

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