Versions in this module Expand all Collapse all v1 v1.0.1 Apr 27, 2026 Changes in this version + var DayToMonthUnitMultiplier = DaysInMonth.DivRound(HourToMonthUnitMultiplier, 24) + var DaysInMonth = HourToMonthUnitMultiplier.DivRound(decimal.NewFromInt(24), 24) + var HourToMonthUnitMultiplier = decimal.NewFromInt(730) + var MonthToHourUnitMultiplier = decimal.NewFromInt(1).Div(HourToMonthUnitMultiplier) + func AddRawValue(r gjson.Result, key string, v interface{}) gjson.Result + func BuildEstimates(projects []*Workspace, projectPtrToUsageMap map[*Workspace]ConsumptionMap) + func ComputeCosts(project *Workspace) + func ExtractMissingVarsCausingMissingAttributeKeys(r *ResourceSpec, attribute string) []string + func IsEmptyPathTypeError(err error) bool + func ParseAttributes(i interface{}) map[string]gjson.Result + func ScaleQuantities(resource *Estimate, multiplier decimal.Decimal) + func SortEstimates(project *Workspace) + type AttributeMatch struct + Key string + Value *string + ValueRegex *string + type AttributeWithUnknownKeys struct + Attribute string + MissingVariables []string + type BlankCoreResource struct + Name string + Type string + func (b BlankCoreResource) BuildResource() *Estimate + func (b BlankCoreResource) CoreType() string + func (b BlankCoreResource) PopulateUsage(u *ConsumptionProfile) + func (b BlankCoreResource) UsageSchema() []*ConsumptionField + type CatalogBuilder func(*ResourceSpec) CatalogItem + type CatalogEntry struct + CloudResourceIDFunc CloudResourceIDFunc + CoreRFunc CatalogBuilder + CustomRefIDFunc ReferenceIDFunc + DefaultRefIDFunc ReferenceIDFunc + GetRegion RegionLookupFunc + Name string + NoPrice bool + Notes []string + RFunc LegacyBuilder + ReferenceAttributes []string + type CatalogItem interface + BuildResource func() *Estimate + CoreType func() string + PopulateUsage func(u *ConsumptionProfile) + UsageSchema func() []*ConsumptionField + type CatalogItemWithConsumptionParams interface + UsageEstimationParams func() []ConsumptionParam + type CloudResourceIDFunc func(d *ResourceSpec) []string + type ConsumptionField struct + DefaultValue interface{} + Description string + Key string + Value interface{} + ValueType UsageVariableType + type ConsumptionMap struct + func NewUsageMap(data map[string]*ConsumptionProfile) ConsumptionMap + func NewUsageMapFromInterface(m map[string]interface{}) ConsumptionMap + func (usage ConsumptionMap) Data() map[string]*ConsumptionProfile + func (usage ConsumptionMap) Get(address string) *ConsumptionProfile + type ConsumptionParam struct + Key string + Value string + type ConsumptionProfile struct + Address string + Attributes map[string]gjson.Result + func NewUsageData(address string, attributes map[string]gjson.Result) *ConsumptionProfile + func (u *ConsumptionProfile) CalcEstimationSummary() map[string]bool + func (u *ConsumptionProfile) Copy() *ConsumptionProfile + func (u *ConsumptionProfile) Get(key string) gjson.Result + func (u *ConsumptionProfile) GetFloat(key string) *float64 + func (u *ConsumptionProfile) GetInt(key string) *int64 + func (u *ConsumptionProfile) GetString(key string) *string + func (u *ConsumptionProfile) GetStringArray(key string) *[]string + func (u *ConsumptionProfile) IsEmpty(key string) bool + func (u *ConsumptionProfile) Merge(other *ConsumptionProfile) *ConsumptionProfile + type Diagnostic struct + Code int + Data interface{} + FriendlyMessage string + IsError bool + Message string + func NewDiagJSONParsingFailure(err error) *Diagnostic + func NewDiagMissingVars(vars ...string) *Diagnostic + func NewDiagModuleEvaluationFailure(err error) *Diagnostic + func NewDiagRunQuotaExceeded(err error) *Diagnostic + func NewDiagTerragruntEvaluationFailure(err error) *Diagnostic + func NewDiagTerragruntModuleEvaluationFailure(err error) *Diagnostic + func NewEmptyPathTypeError(err error) *Diagnostic + func NewFailedDownloadDiagnostic(source string, err error) *Diagnostic + func NewPrivateRegistryDiag(source string, moduleLocation *string, err error) *Diagnostic + func (p *Diagnostic) Error() string + type Estimate struct + ActualCosts []*ObservedCost + CostComponents []*LineItem + DefaultTags *map[string]string + EstimateUsage UsageEstimator + EstimationSummary map[string]bool + HourlyCost *decimal.Decimal + IsSkipped bool + Metadata map[string]gjson.Result + MissingVarsCausingUnknownDefaultTagKeys []string + MissingVarsCausingUnknownTagKeys []string + MonthlyCost *decimal.Decimal + MonthlyUsageCost *decimal.Decimal + Name string + NoPrice bool + ProviderLink string + ProviderSupportsDefaultTags bool + ResourceType string + SkipMessage string + SubResources []*Estimate + TagPropagation *TagPropagation + Tags *map[string]string + UsageSchema []*ConsumptionField + func AllProjectResources(projects []*Workspace) []*Estimate + func BuildResource(partial *UnpricedEntry, fetchedUsage *ConsumptionProfile) *Estimate + func ComputeDiff(past []*Estimate, current []*Estimate) []*Estimate + func (r *Estimate) BaseResourceName() string + func (r *Estimate) BaseResourceType() string + func (r *Estimate) CalculateCosts() + func (r *Estimate) FlattenedSubResources() []*Estimate + func (r *Estimate) RemoveCostComponent(costComponent *LineItem) + type LegacyBuilder func(*ResourceSpec, *ConsumptionProfile) *Estimate + type LineItem struct + HourlyCost *decimal.Decimal + HourlyQuantity *decimal.Decimal + IgnoreIfMissingPrice bool + MonthlyCost *decimal.Decimal + MonthlyDiscountPerc float64 + MonthlyQuantity *decimal.Decimal + Name string + PriceFilter *RateSelector + PriceNotFound bool + ProductFilter *ProductSelector + Unit string + UnitMultiplier decimal.Decimal + UnitRounding *int32 + UsageBased bool + func (c *LineItem) CalculateCosts() + func (c *LineItem) CustomPrice() *decimal.Decimal + func (c *LineItem) Price() decimal.Decimal + func (c *LineItem) PriceHash() string + func (c *LineItem) SetCustomPrice(price *decimal.Decimal) + func (c *LineItem) SetPrice(price decimal.Decimal) + func (c *LineItem) SetPriceHash(priceHash string) + func (c *LineItem) SetPriceNotFound() + func (c *LineItem) UnitMultiplierHourlyQuantity() *decimal.Decimal + func (c *LineItem) UnitMultiplierMonthlyQuantity() *decimal.Decimal + func (c *LineItem) UnitMultiplierPrice() decimal.Decimal + type ObservedCost struct + CostComponents []*LineItem + EndTimestamp time.Time + ResourceID string + StartTimestamp time.Time + type Policies []Policy + func (r Policies) Len() int + func (r Policies) Less(i, j int) bool + func (r Policies) Swap(i, j int) + type Policy struct + Address string + Cost *decimal.Decimal + Description string + ID string + NoCost bool + ResourceAttributes json.RawMessage + ResourceType string + Suggested string + Title string + type ProductSelector struct + AttributeFilters []*AttributeMatch + ProductFamily *string + Region *string + Service *string + Sku *string + VendorName *string + type Projects []*Workspace + func (p Projects) Len() int + func (p Projects) Less(i, j int) bool + func (p Projects) Swap(i, j int) + type RateSelector struct + Description *string + DescriptionRegex *string + EndUsageAmount *string + PurchaseOption *string + StartUsageAmount *string + TermLength *string + TermOfferingClass *string + TermPurchaseOption *string + Unit *string + type ReferenceIDFunc func(d *ResourceSpec) []string + type RegionLookupFunc func(defaultRegion string, d *ResourceSpec) string + type Remediater interface + Describe func() string + Remediate func() error + type ResourceSpec struct + Address string + CFResource cloudformation.Resource + DefaultTags *map[string]string + Metadata map[string]gjson.Result + MissingVarsCausingUnknownDefaultTagKeys []string + MissingVarsCausingUnknownTagKeys []string + ProjectMetadata map[string]string + ProviderLink string + ProviderName string + ProviderSupportsDefaultTags bool + RawValues gjson.Result + ReferencesMap map[string][]*ResourceSpec + Region string + TagPropagation *TagPropagation + Tags *map[string]string + Type string + UsageData *ConsumptionProfile + func NewCFResourceData(resourceType string, providerName string, address string, ...) *ResourceSpec + func NewResourceData(resourceType string, providerName string, address string, ...) *ResourceSpec + func (d *ResourceSpec) AddReference(k string, reference *ResourceSpec, reverseRefAttrs []string) + func (d *ResourceSpec) Get(key string) gjson.Result + func (d *ResourceSpec) GetBoolOrDefault(key string, def bool) bool + func (d *ResourceSpec) GetFloat64OrDefault(key string, def float64) float64 + func (d *ResourceSpec) GetInt64OrDefault(key string, def int64) int64 + func (d *ResourceSpec) GetStringOrDefault(key, def string) string + func (d *ResourceSpec) IsEmpty(key string) bool + func (d *ResourceSpec) References(keys ...string) []*ResourceSpec + func (d *ResourceSpec) ReplaceReference(k string, oldReference *ResourceSpec, newReference *ResourceSpec) + func (d *ResourceSpec) Set(key string, value interface{}) + type TagPropagation struct + Attribute string + From *string + HasRequiredAttributes bool + Tags *map[string]string + To string + type UnpricedEntry struct + Address string + CloudResourceIDs []string + CoreResource CatalogItem + DefaultTags *map[string]string + Metadata map[string]gjson.Result + MissingVarsCausingUnknownDefaultTagKeys []string + MissingVarsCausingUnknownTagKeys []string + ProviderLink string + ProviderSupportsDefaultTags bool + Resource *Estimate + TagPropagation *TagPropagation + Tags *map[string]string + Type string + UsageData *ConsumptionProfile + func NewPartialResource(d *ResourceSpec, r *Estimate, cr CatalogItem, cloudResourceIds []string) *UnpricedEntry + type UsageEstimator func(context.Context, map[string]interface{}) error + type UsageVariableType int + const Float64 + const Int64 + const KeyValueMap + const String + const StringArray + const SubResourceUsage + type Vendor interface + AddMetadata func(*WorkspaceMeta) + Context func() *settings.ProjectSession + DisplayType func() string + LoadResources func(ConsumptionMap) ([]*Workspace, error) + ProjectName func() string + RelativePath func() string + Type func() string + VarFiles func() []string + type VendorMeta struct + AttributesWithUnknownKeys []AttributeWithUnknownKeys + DefaultTags map[string]string + EndLine int64 + Filename string + Name string + StartLine int64 + type Workspace struct + Diff []*Estimate + DisplayName string + HasDiff bool + Metadata *WorkspaceMeta + Name string + PartialPastResources []*UnpricedEntry + PartialResources []*UnpricedEntry + PastResources []*Estimate + Resources []*Estimate + func NewProject(name string, metadata *WorkspaceMeta) *Workspace + func (p *Workspace) AddProviderMetadata(metadatas []VendorMeta) + func (p *Workspace) AllPartialResources() []*UnpricedEntry + func (p *Workspace) AllResources() []*Estimate + func (p *Workspace) BuildResources(usageMap ConsumptionMap) + func (p *Workspace) CalculateDiff() + func (p *Workspace) NameWithWorkspace() string + type WorkspaceMeta struct + ConfigSha string + CurrentErrors []*Diagnostic + Errors []*Diagnostic + PastErrors []*Diagnostic + PastPolicySha string + Path string + Policies Policies + PolicySha string + Providers []VendorMeta + RemoteModuleCalls []string + TerraformModulePath string + TerraformWorkspace string + Type string + VCSCodeChanged *bool + VCSSubPath string + Warnings []*Diagnostic + func DetectProjectMetadata(path string) *WorkspaceMeta + func (m *WorkspaceMeta) AddError(err error) + func (m *WorkspaceMeta) GenerateProjectName(remote vcs.Remote, dashboardEnabled bool) string + func (m *WorkspaceMeta) HasErrors() bool + func (m *WorkspaceMeta) IsEmptyProjectError() bool + func (m *WorkspaceMeta) IsRunQuotaExceeded() (string, bool) + func (m *WorkspaceMeta) WorkspaceLabel() string