Documentation
¶
Overview ¶
Package ce provides an in-memory implementation of the AWS Cost Explorer (Ce) service.
Index ¶
- Constants
- Variables
- type Anomaly
- type AnomalyMonitor
- type AnomalyRootCause
- type AnomalyScore
- type AnomalySubscription
- type BackfillJob
- type CommitmentAnalysis
- type CostAllocationTag
- type CostAllocationTagError
- type CostAllocationTagStatusEntry
- type CostCategory
- type CostCategoryRule
- type CostEntry
- type CostGroup
- type ForecastResult
- type GroupBySpec
- type Handler
- func (h *Handler) ChaosOperations() []string
- func (h *Handler) ChaosRegions() []string
- func (h *Handler) ChaosServiceName() string
- func (h *Handler) ExtractOperation(c *echo.Context) string
- func (h *Handler) ExtractResource(_ *echo.Context) string
- func (h *Handler) GetSupportedOperations() []string
- func (h *Handler) Handler() echo.HandlerFunc
- func (h *Handler) MatchPriority() int
- func (h *Handler) Name() string
- func (h *Handler) Reset()
- func (h *Handler) Restore(ctx context.Context, data []byte) error
- func (h *Handler) RouteMatcher() service.Matcher
- func (h *Handler) Snapshot(ctx context.Context) []byte
- type InMemoryBackend
- func (b *InMemoryBackend) AddAnomaly(a Anomaly)
- func (b *InMemoryBackend) CreateAnomalyMonitor(monitorName, monitorType, monitorDimension string, ...) (*AnomalyMonitor, error)
- func (b *InMemoryBackend) CreateAnomalySubscription(subscriptionName, frequency string, monitorARNList []string, ...) (*AnomalySubscription, error)
- func (b *InMemoryBackend) CreateBackfillJob(backfillFrom string) *BackfillJob
- func (b *InMemoryBackend) CreateCommitmentAnalysis(configuration any) *CommitmentAnalysis
- func (b *InMemoryBackend) CreateCostCategoryDefinition(name, ruleVersion, defaultValue string, rules []CostCategoryRule, ...) (*CostCategory, error)
- func (b *InMemoryBackend) CreateSavingsPlansGeneration() *SavingsPlansGeneration
- func (b *InMemoryBackend) DeleteAnomalyMonitor(monARN string) error
- func (b *InMemoryBackend) DeleteAnomalySubscription(subARN string) error
- func (b *InMemoryBackend) DeleteCostCategoryDefinition(catARN string) (*CostCategory, error)
- func (b *InMemoryBackend) DescribeCostCategoryDefinition(catARN string) (*CostCategory, error)
- func (b *InMemoryBackend) DimensionValueCost(dimension, value, metric string) float64
- func (b *InMemoryBackend) GetAnomalies(monitorARN, feedback, startDate, endDate string, maxResults int, ...) ([]*Anomaly, string)
- func (b *InMemoryBackend) GetAnomalyMonitors(monitorARNList []string, maxResults int, nextPageToken string) ([]*AnomalyMonitor, string, error)
- func (b *InMemoryBackend) GetAnomalySubscriptions(subscriptionARNList []string, monitorARN string, maxResults int, ...) ([]*AnomalySubscription, string, error)
- func (b *InMemoryBackend) GetApproximateUsageRecords(services []string) (string, string, map[string]int64, int64)
- func (b *InMemoryBackend) GetCommitmentAnalysis(analysisID string) (*CommitmentAnalysis, error)
- func (b *InMemoryBackend) GetCostAndUsage(start, end, granularity string, metrics []string, groupBy []GroupBySpec, ...) []ResultByTime
- func (b *InMemoryBackend) GetCostAndUsageFiltered(start, end, granularity string, metrics []string, groupBy []GroupBySpec, ...) []ResultByTime
- func (b *InMemoryBackend) GetCostCategories(costCategoryName string) []string
- func (b *InMemoryBackend) GetCostCategoryNames() []string
- func (b *InMemoryBackend) GetDimensionValues(dimension string) []string
- func (b *InMemoryBackend) GetDimensionValuesFiltered(dimension, constraintDimension string, constraintValues []string) []string
- func (b *InMemoryBackend) GetForecastByTime(start, end, granularity, metric string, predictionIntervalLevel int, ...) ([]ForecastResult, float64, float64, float64)
- func (b *InMemoryBackend) GetReservationCoverage(start, end, granularity string) []ReservationCoverageByTime
- func (b *InMemoryBackend) GetReservationCoverageFiltered(start, end, granularity string, serviceFilter []string) []ReservationCoverageByTime
- func (b *InMemoryBackend) GetReservationPurchaseRecommendations(service, lookback, term, payment string) []ReservationRecommendation
- func (b *InMemoryBackend) GetReservationUtilization(start, end, granularity string) []ReservationUtilizationByTime
- func (b *InMemoryBackend) GetReservationUtilizationFiltered(start, end, granularity string, serviceFilter []string) []ReservationUtilizationByTime
- func (b *InMemoryBackend) GetRightsizingRecommendations(_ string) []RightsizingRecommendation
- func (b *InMemoryBackend) GetSavingsPlansUtilization(start, end string) *SavingsPlansUtilizationResult
- func (b *InMemoryBackend) GetSavingsPlansUtilizationDetails(start, end string) []SavingsPlansUtilizationDetail
- func (b *InMemoryBackend) GetTagKeys() []string
- func (b *InMemoryBackend) GetTagKeysFiltered(constraintKey string, constraintValues []string) []string
- func (b *InMemoryBackend) GetTagValues(tagKey string) []string
- func (b *InMemoryBackend) GetTagValuesFiltered(tagKey, constraintKey string, constraintValues []string) []string
- func (b *InMemoryBackend) ListBackfillHistory() []*BackfillJob
- func (b *InMemoryBackend) ListCommitmentAnalyses(statusFilter string) []*CommitmentAnalysis
- func (b *InMemoryBackend) ListCostAllocationTags(status, tagType string, tagKeys []string) []*CostAllocationTag
- func (b *InMemoryBackend) ListCostCategoryDefinitions(maxResults int, nextPageToken, effectiveOn string) ([]*CostCategory, string)
- func (b *InMemoryBackend) ListSavingsPlansGenerations(status string, recommendationIDs []string) []*SavingsPlansGeneration
- func (b *InMemoryBackend) ListTagsForResource(resourceARN string) (map[string]string, error)
- func (b *InMemoryBackend) ProvideAnomalyFeedback(anomalyID, feedback string) error
- func (b *InMemoryBackend) Region() string
- func (b *InMemoryBackend) Reset()
- func (b *InMemoryBackend) Restore(ctx context.Context, data []byte) error
- func (b *InMemoryBackend) Snapshot(ctx context.Context) []byte
- func (b *InMemoryBackend) StartJanitor(ctx context.Context, interval time.Duration)
- func (b *InMemoryBackend) TagResource(resourceARN string, resourceTags map[string]string) error
- func (b *InMemoryBackend) TagValueCost(tagKey, value, metric string) float64
- func (b *InMemoryBackend) TaggedResources() []TaggedEntry
- func (b *InMemoryBackend) UntagResource(resourceARN string, tagKeys []string) error
- func (b *InMemoryBackend) UpdateAnomalyMonitor(monARN, monitorName string) (*AnomalyMonitor, error)
- func (b *InMemoryBackend) UpdateAnomalySubscription(subARN, frequency, subscriptionName string, monitorARNList []string, ...) (*AnomalySubscription, error)
- func (b *InMemoryBackend) UpdateCostAllocationTagsStatus(updates []CostAllocationTagStatusEntry) []CostAllocationTagError
- func (b *InMemoryBackend) UpdateCostCategoryDefinition(catARN, ruleVersion, defaultValue string, rules []CostCategoryRule, ...) (*CostCategory, error)
- type MetricValue
- type Provider
- type ReservationCoverageAgg
- type ReservationCoverageByTime
- type ReservationCoverageCost
- type ReservationCoverageHours
- type ReservationCoverageNormalizedUnits
- type ReservationRecommendation
- type ReservationRecommendationDetail
- type ReservationUtilizationAgg
- type ReservationUtilizationByTime
- type ResultByTime
- type RightsizingCurrentInstance
- type RightsizingModifyDetail
- type RightsizingRecommendation
- type RightsizingTargetInstance
- type RightsizingTerminateDetail
- type SavingsPlansAmortized
- type SavingsPlansGeneration
- type SavingsPlansSavings
- type SavingsPlansUtilizationAgg
- type SavingsPlansUtilizationDetail
- type SavingsPlansUtilizationResult
- type SplitChargeRule
- type Subscriber
- type TaggedEntry
- type TotalImpactFilter
Constants ¶
const DefaultAnomalyTTL = 30 * 24 * time.Hour
DefaultAnomalyTTL is the default time-to-live for detected anomalies.
Variables ¶
var ( // ErrNotFound is returned when a requested resource does not exist. ErrNotFound = awserr.New("ResourceNotFoundException", awserr.ErrNotFound) // ErrAlreadyExists is returned when a resource with the same name already exists. ErrAlreadyExists = awserr.New("ServiceQuotaExceededException", awserr.ErrConflict) // ErrValidation is returned when input parameters fail validation. Real AWS CE's // documented common-error type for malformed/missing-required-member requests is // "ValidationError" (confirmed via the CE API reference's CommonErrors page), not a // named per-operation exception -- CE's errors.go typed-exception list (checked // against aws-sdk-go-v2/service/costexplorer/types) has no ValidationException or // InvalidParameterException entry for any operation in this audit. ErrValidation = errors.New("ValidationError") ErrDataUnavailable = awserr.New("DataUnavailableException", awserr.ErrNotFound) // ErrUnknownMonitor is returned when a referenced cost anomaly monitor ARN does not // exist. Real AWS CE returns this (not the generic ResourceNotFoundException) from // every anomaly-monitor op and from any op whose MonitorArnList references a monitor // that doesn't exist. ErrUnknownMonitor = awserr.New("UnknownMonitorException", awserr.ErrNotFound) // ErrUnknownSubscription is returned when a referenced cost anomaly subscription ARN // does not exist. Real AWS CE returns this (not the generic ResourceNotFoundException) // from every anomaly-subscription op. ErrUnknownSubscription = awserr.New("UnknownSubscriptionException", awserr.ErrNotFound) )
Functions ¶
This section is empty.
Types ¶
type Anomaly ¶
type Anomaly struct {
CreationDate time.Time `json:"creationDate"`
AnomalyID string `json:"anomalyID"`
AnomalyStartDate string `json:"anomalyStartDate"`
AnomalyEndDate string `json:"anomalyEndDate"`
DimensionValue string `json:"dimensionValue"`
MonitorARN string `json:"monitorARN"`
SubscriptionARN string `json:"subscriptionARN"`
FeedbackType string `json:"feedbackType"`
RootCauses []AnomalyRootCause `json:"rootCauses,omitempty"`
AnomalyScore AnomalyScore `json:"anomalyScore"`
TotalImpact float64 `json:"totalImpact"`
}
Anomaly represents a detected cost anomaly in AWS CE.
type AnomalyMonitor ¶
type AnomalyMonitor struct {
CreationDate time.Time `json:"creationDate"`
LastUpdatedDate time.Time `json:"lastUpdatedDate"`
Tags map[string]string `json:"tags"`
MonitorSpecification *ceExpression `json:"monitorSpecification,omitempty"`
MonitorARN string `json:"monitorARN"`
MonitorName string `json:"monitorName"`
MonitorType string `json:"monitorType"`
MonitorDimension string `json:"monitorDimension"`
}
AnomalyMonitor represents an in-memory AWS CE anomaly monitor. MonitorSpecification is the Expression that scopes a CUSTOM monitor (or a DIMENSIONAL monitor with MonitorDimension TAG/COST_CATEGORY) -- required input on CreateAnomalyMonitor, echoed back on GetAnomalyMonitors per types.AnomalyMonitor (costexplorer@v1.67.4 types/types.go).
type AnomalyRootCause ¶
type AnomalyRootCause struct {
Service string `json:"Service,omitempty"`
Region string `json:"Region,omitempty"`
LinkedAccount string `json:"LinkedAccount,omitempty"`
UsageType string `json:"UsageType,omitempty"`
}
AnomalyRootCause identifies a root cause dimension for an anomaly.
type AnomalyScore ¶
type AnomalyScore struct {
MaxScore float64 `json:"MaxScore"`
CurrentScore float64 `json:"CurrentScore"`
}
AnomalyScore represents the anomaly detection score.
type AnomalySubscription ¶
type AnomalySubscription struct {
CreationDate time.Time `json:"creationDate"`
Tags map[string]string `json:"tags"`
ThresholdExpression *ceExpression `json:"thresholdExpression,omitempty"`
SubscriptionARN string `json:"subscriptionARN"`
SubscriptionName string `json:"subscriptionName"`
AccountID string `json:"accountID"`
Frequency string `json:"frequency"`
MonitorARNList []string `json:"monitorARNList"`
Subscribers []Subscriber `json:"subscribers"`
Threshold float64 `json:"threshold"`
}
AnomalySubscription represents an in-memory AWS CE anomaly subscription. ThresholdExpression is the non-deprecated alternative to Threshold (real AWS: "you can specify either Threshold or ThresholdExpression, but not both" -- costexplorer@v1.67.4 types/types.go's AnomalySubscription doc comment); both CreateAnomalySubscriptionInput and UpdateAnomalySubscriptionInput accept it.
type BackfillJob ¶
type BackfillJob struct {
BackfillID string `json:"backfillID"`
BackfillFrom string `json:"backfillFrom"`
RequestedAt string `json:"requestedAt"`
CompletedAt string `json:"completedAt,omitempty"`
BackfillStatus string `json:"backfillStatus"` // SUCCEEDED|PROCESSING|FAILED
LastUpdatedAt string `json:"lastUpdatedAt"`
}
BackfillJob represents a cost allocation tag backfill job. BackfillID is internal-only -- real AWS's CostAllocationTagBackfillRequest has no unique identifier field at all (NextToken is fully opaque), so this is not a fabricated wire field, just a stable sort/pagination key this backend needs since RequestedAt alone (second precision) can tie between jobs created in the same second.
type CommitmentAnalysis ¶
type CommitmentAnalysis struct {
Configuration any `json:"configuration,omitempty"`
AnalysisID string `json:"analysisId"`
AnalysisStatus string `json:"analysisStatus"` // SUCCEEDED|PROCESSING|FAILED
AnalysisStartedTime string `json:"analysisStartedTime"`
EstimatedCompletionTime string `json:"estimatedCompletionTime"`
ErrorCode string `json:"errorCode,omitempty"`
}
CommitmentAnalysis represents a commitment purchase analysis.
type CostAllocationTag ¶
type CostAllocationTag struct {
TagKey string `json:"tagKey"`
Status string `json:"status"` // Active | Inactive
Type string `json:"type"` // AWSGenerated | UserDefined
LastUpdatedDate string `json:"lastUpdatedDate"`
}
CostAllocationTag represents an AWS CE cost allocation tag.
type CostAllocationTagError ¶
type CostAllocationTagError struct {
TagKey string `json:"TagKey"`
Code string `json:"Code"`
Message string `json:"Message"`
}
CostAllocationTagError holds an error for a single tag key update.
type CostAllocationTagStatusEntry ¶
type CostAllocationTagStatusEntry struct {
TagKey string `json:"TagKey"`
Status string `json:"Status"`
}
CostAllocationTagStatusEntry is a TagKey+Status pair for UpdateCostAllocationTagsStatus.
type CostCategory ¶
type CostCategory struct {
CreationDate time.Time `json:"creationDate"`
Tags map[string]string `json:"tags"`
ARN string `json:"arn"`
Name string `json:"name"`
RuleVersion string `json:"ruleVersion"`
DefaultValue string `json:"defaultValue"`
EffectiveStart string `json:"effectiveStart"`
Rules []CostCategoryRule `json:"rules"`
SplitChargeRules []SplitChargeRule `json:"splitChargeRules"`
}
CostCategory represents an in-memory AWS Cost Explorer cost category.
type CostCategoryRule ¶
type CostCategoryRule struct {
Value string `json:"value"`
}
CostCategoryRule represents a single cost category rule.
type CostEntry ¶
type CostEntry struct {
Tags map[string]string `json:"tags"`
Date string `json:"date"`
Service string `json:"service"`
Region string `json:"region"`
UsageType string `json:"usageType"`
Account string `json:"account"`
BlendedCost float64 `json:"blendedCost"`
UnblendedCost float64 `json:"unblendedCost"`
UsageQuantity float64 `json:"usageQuantity"`
}
CostEntry is a synthetic cost ledger entry for a single day+service combination.
type CostGroup ¶
type CostGroup struct {
Metrics map[string]MetricValue `json:"Metrics"`
Keys []string `json:"Keys"`
}
CostGroup represents a group in a cost result.
type ForecastResult ¶
type ForecastResult struct {
TimePeriod map[string]string `json:"TimePeriod"`
MeanValue string `json:"MeanValue"`
PredictionIntervalLowerBound string `json:"PredictionIntervalLowerBound,omitempty"`
PredictionIntervalUpperBound string `json:"PredictionIntervalUpperBound,omitempty"`
}
ForecastResult represents a single time-bucket forecast entry.
type GroupBySpec ¶
GroupBySpec represents a single GroupBy dimension spec.
type Handler ¶
type Handler struct {
Backend *InMemoryBackend
// contains filtered or unexported fields
}
Handler is the Echo HTTP handler for Cost Explorer (Ce) operations.
func NewHandler ¶
func NewHandler(backend *InMemoryBackend) *Handler
NewHandler creates a new Cost Explorer handler backed by backend. backend must not be nil.
func (*Handler) ChaosOperations ¶
ChaosOperations returns all operations that can be fault-injected.
func (*Handler) ChaosRegions ¶
ChaosRegions returns all regions this handler instance handles.
func (*Handler) ChaosServiceName ¶
ChaosServiceName returns the lowercase AWS service name for fault rule matching.
func (*Handler) ExtractOperation ¶
ExtractOperation extracts the Cost Explorer action from the X-Amz-Target header.
func (*Handler) ExtractResource ¶
ExtractResource extracts the resource identifier from the request (not used for Ce).
func (*Handler) GetSupportedOperations ¶
GetSupportedOperations returns the list of supported operations.
func (*Handler) Handler ¶
func (h *Handler) Handler() echo.HandlerFunc
Handler returns the Echo handler function for Cost Explorer requests.
func (*Handler) MatchPriority ¶
MatchPriority returns the routing priority.
func (*Handler) Reset ¶
func (h *Handler) Reset()
Reset implements service.Resettable by delegating to the backend.
func (*Handler) RouteMatcher ¶
RouteMatcher returns a function that matches Cost Explorer requests.
type InMemoryBackend ¶
type InMemoryBackend struct {
// contains filtered or unexported fields
}
InMemoryBackend is a thread-safe in-memory store for Cost Explorer resources.
func NewInMemoryBackend ¶
func NewInMemoryBackend(accountID, region string) *InMemoryBackend
NewInMemoryBackend creates a new backend for the given account and region.
func (*InMemoryBackend) AddAnomaly ¶
func (b *InMemoryBackend) AddAnomaly(a Anomaly)
AddAnomaly inserts an anomaly into the backend. It is intended for testing.
func (*InMemoryBackend) CreateAnomalyMonitor ¶
func (b *InMemoryBackend) CreateAnomalyMonitor( monitorName, monitorType, monitorDimension string, monitorSpecification *ceExpression, resourceTags map[string]string, ) (*AnomalyMonitor, error)
CreateAnomalyMonitor creates a new anomaly monitor.
func (*InMemoryBackend) CreateAnomalySubscription ¶
func (b *InMemoryBackend) CreateAnomalySubscription( subscriptionName, frequency string, monitorARNList []string, subscribers []Subscriber, threshold float64, thresholdExpression *ceExpression, resourceTags map[string]string, ) (*AnomalySubscription, error)
CreateAnomalySubscription creates a new anomaly subscription.
func (*InMemoryBackend) CreateBackfillJob ¶
func (b *InMemoryBackend) CreateBackfillJob(backfillFrom string) *BackfillJob
CreateBackfillJob creates a new cost allocation tag backfill job.
func (*InMemoryBackend) CreateCommitmentAnalysis ¶
func (b *InMemoryBackend) CreateCommitmentAnalysis(configuration any) *CommitmentAnalysis
CreateCommitmentAnalysis starts a new commitment purchase analysis. configuration is stored and echoed back verbatim on Get/List/Start (real GetCommitmentPurchaseAnalysisOutput/AnalysisSummary both carry CommitmentPurchaseAnalysisConfiguration) -- this backend doesn't simulate analysis internals, so it round-trips the request's configuration rather than fabricating computed contents.
func (*InMemoryBackend) CreateCostCategoryDefinition ¶
func (b *InMemoryBackend) CreateCostCategoryDefinition( name, ruleVersion, defaultValue string, rules []CostCategoryRule, resourceTags map[string]string, splitChargeRules []SplitChargeRule, requestedEffectiveStart string, ) (*CostCategory, error)
CreateCostCategoryDefinition creates a new cost category and returns it. requestedEffectiveStart, when non-empty, overrides the default "first day of the current month" real AWS also defaults to when the field is omitted (api_op_CreateCostCategoryDefinition.go).
func (*InMemoryBackend) CreateSavingsPlansGeneration ¶ added in v1.2.0
func (b *InMemoryBackend) CreateSavingsPlansGeneration() *SavingsPlansGeneration
CreateSavingsPlansGeneration starts a new Savings Plans purchase recommendation generation job and persists it, mirroring the CommitmentAnalysis start/persist/list/get pattern used elsewhere in this backend.
func (*InMemoryBackend) DeleteAnomalyMonitor ¶
func (b *InMemoryBackend) DeleteAnomalyMonitor(monARN string) error
DeleteAnomalyMonitor removes an anomaly monitor by ARN.
func (*InMemoryBackend) DeleteAnomalySubscription ¶
func (b *InMemoryBackend) DeleteAnomalySubscription(subARN string) error
DeleteAnomalySubscription removes an anomaly subscription by ARN.
func (*InMemoryBackend) DeleteCostCategoryDefinition ¶
func (b *InMemoryBackend) DeleteCostCategoryDefinition(catARN string) (*CostCategory, error)
DeleteCostCategoryDefinition removes a cost category by ARN.
func (*InMemoryBackend) DescribeCostCategoryDefinition ¶
func (b *InMemoryBackend) DescribeCostCategoryDefinition(catARN string) (*CostCategory, error)
DescribeCostCategoryDefinition returns a cost category by ARN.
func (*InMemoryBackend) DimensionValueCost ¶ added in v1.3.1
func (b *InMemoryBackend) DimensionValueCost(dimension, value, metric string) float64
DimensionValueCost sums the requested cost metric ("UnblendedCost" or any other value, which defaults to BlendedCost) across ledger entries whose `dimension` equals value. Used to give GetDimensionValues' SortBy a real, non-fabricated ordering over the returned dimension values.
func (*InMemoryBackend) GetAnomalies ¶
func (b *InMemoryBackend) GetAnomalies( monitorARN, feedback, startDate, endDate string, maxResults int, nextPageToken string, totalImpact *TotalImpactFilter, ) ([]*Anomaly, string)
GetAnomalies returns detected anomalies, optionally filtered by monitor ARN, feedback type, date interval, and total dollar impact. maxResults and nextPageToken implement opaque-cursor pagination.
func (*InMemoryBackend) GetAnomalyMonitors ¶
func (b *InMemoryBackend) GetAnomalyMonitors( monitorARNList []string, maxResults int, nextPageToken string, ) ([]*AnomalyMonitor, string, error)
GetAnomalyMonitors returns anomaly monitors, optionally filtered by ARNs, sorted by MonitorARN. maxResults and nextPageToken implement opaque-cursor pagination (real AWS behaviour). If monitorARNList references an ARN that doesn't exist, it returns ErrUnknownMonitor, matching real AWS.
func (*InMemoryBackend) GetAnomalySubscriptions ¶
func (b *InMemoryBackend) GetAnomalySubscriptions( subscriptionARNList []string, monitorARN string, maxResults int, nextPageToken string, ) ([]*AnomalySubscription, string, error)
GetAnomalySubscriptions returns anomaly subscriptions, optionally filtered by ARNs or monitor ARN, sorted by SubscriptionARN. maxResults and nextPageToken implement opaque-cursor pagination. If subscriptionARNList references an ARN that doesn't exist, it returns ErrUnknownSubscription, matching real AWS. monitorARN is a simple filter (real AWS does not require it to reference an existing monitor).
func (*InMemoryBackend) GetApproximateUsageRecords ¶ added in v1.2.0
func (b *InMemoryBackend) GetApproximateUsageRecords( services []string, ) (string, string, map[string]int64, int64)
GetApproximateUsageRecords returns estimated per-service usage record counts derived from the cost ledger's UsageQuantity over the trailing daysPerMonth-day lookback window, optionally filtered to services. Matches real AWS's GetApproximateUsageRecords shape: LookbackPeriod + per-service counts + a grand total.
func (*InMemoryBackend) GetCommitmentAnalysis ¶
func (b *InMemoryBackend) GetCommitmentAnalysis(analysisID string) (*CommitmentAnalysis, error)
GetCommitmentAnalysis retrieves a commitment analysis by ID.
func (*InMemoryBackend) GetCostAndUsage ¶
func (b *InMemoryBackend) GetCostAndUsage( start, end, granularity string, metrics []string, groupBy []GroupBySpec, serviceFilter []string, ) []ResultByTime
GetCostAndUsage aggregates cost ledger entries by granularity, applying optional GroupBy. serviceFilter only narrows by the SERVICE dimension; callers that need the full Filter expression (Dimensions on any modeled dimension, Tags, And/Or/Not) must use GetCostAndUsageFiltered instead.
func (*InMemoryBackend) GetCostAndUsageFiltered ¶
func (b *InMemoryBackend) GetCostAndUsageFiltered( start, end, granularity string, metrics []string, groupBy []GroupBySpec, filter *ceExpression, ) []ResultByTime
GetCostAndUsageFiltered is GetCostAndUsage with the full Filter expression (Dimensions on any modeled dimension, Tags, And/Or/Not) applied via matchesExpression, instead of GetCostAndUsage's SERVICE-only narrowing.
func (*InMemoryBackend) GetCostCategories ¶
func (b *InMemoryBackend) GetCostCategories(costCategoryName string) []string
GetCostCategories returns the distinct cost category values stored in the backend, optionally filtered by cost category name. Values are sorted alphabetically.
func (*InMemoryBackend) GetCostCategoryNames ¶ added in v1.3.1
func (b *InMemoryBackend) GetCostCategoryNames() []string
GetCostCategoryNames returns the distinct cost category names stored in the backend, sorted alphabetically. Real GetCostCategories emits this list instead of CostCategoryValues when the request omits CostCategoryName (see api_op_GetCostCategories.go: "If the CostCategoryName key isn't specified in the request, the CostCategoryValues fields aren't returned").
func (*InMemoryBackend) GetDimensionValues ¶
func (b *InMemoryBackend) GetDimensionValues(dimension string) []string
GetDimensionValues returns unique values for the given dimension from the cost ledger.
func (*InMemoryBackend) GetDimensionValuesFiltered ¶ added in v1.3.1
func (b *InMemoryBackend) GetDimensionValuesFiltered( dimension, constraintDimension string, constraintValues []string, ) []string
GetDimensionValuesFiltered returns unique values for `dimension`, restricted to ledger entries whose `constraintDimension` value is one of constraintValues (when constraintDimension is non-empty). This gives a real, non-fabricated effect to GetDimensionValuesInput.Filter when it carries a single (non-nested) Dimensions clause.
func (*InMemoryBackend) GetForecastByTime ¶
func (b *InMemoryBackend) GetForecastByTime( start, end, granularity, metric string, predictionIntervalLevel int, serviceFilter []string, ) ([]ForecastResult, float64, float64, float64)
GetForecastByTime returns per-bucket cost/usage forecasts for a time range, computed from the requested metric (GetCostForecastInput/ GetUsageForecastInput.Metric) over ledger entries narrowed by serviceFilter (GetCostForecastInput/GetUsageForecastInput.Filter's SERVICE dimension), matching the same pattern used across this file. A prior revision always used BlendedCost and ignored Filter regardless of what was requested.
func (*InMemoryBackend) GetReservationCoverage ¶
func (b *InMemoryBackend) GetReservationCoverage( start, end, granularity string, ) []ReservationCoverageByTime
GetReservationCoverage returns synthetic RI coverage by time.
func (*InMemoryBackend) GetReservationCoverageFiltered ¶ added in v1.3.1
func (b *InMemoryBackend) GetReservationCoverageFiltered( start, end, granularity string, serviceFilter []string, ) []ReservationCoverageByTime
GetReservationCoverageFiltered is GetReservationCoverage narrowed to ledger entries whose Service is in serviceFilter (when non-empty), giving GetReservationCoverageInput.Filter's SERVICE dimension a real, non-fabricated effect. Other documented Filter dimensions (AZ, PLATFORM, TENANCY, ...) have no per-entry breakdown in this emulator's ledger and are not applied.
func (*InMemoryBackend) GetReservationPurchaseRecommendations ¶
func (b *InMemoryBackend) GetReservationPurchaseRecommendations( service, lookback, term, payment string, ) []ReservationRecommendation
GetReservationPurchaseRecommendations returns synthetic RI purchase recommendations.
func (*InMemoryBackend) GetReservationUtilization ¶
func (b *InMemoryBackend) GetReservationUtilization( start, end, granularity string, ) []ReservationUtilizationByTime
GetReservationUtilization returns synthetic RI utilization by time.
func (*InMemoryBackend) GetReservationUtilizationFiltered ¶ added in v1.3.1
func (b *InMemoryBackend) GetReservationUtilizationFiltered( start, end, granularity string, serviceFilter []string, ) []ReservationUtilizationByTime
GetReservationUtilizationFiltered is GetReservationUtilization narrowed to ledger entries whose Service is in serviceFilter (when non-empty), giving GetReservationUtilizationInput.Filter's SERVICE dimension a real, non-fabricated effect. Other documented Filter dimensions (AZ, PLATFORM, TENANCY, ...) have no per-entry breakdown in this emulator's ledger and are not applied.
func (*InMemoryBackend) GetRightsizingRecommendations ¶
func (b *InMemoryBackend) GetRightsizingRecommendations( _ string, ) []RightsizingRecommendation
GetRightsizingRecommendations returns synthetic rightsizing recommendations.
func (*InMemoryBackend) GetSavingsPlansUtilization ¶
func (b *InMemoryBackend) GetSavingsPlansUtilization( start, end string, ) *SavingsPlansUtilizationResult
GetSavingsPlansUtilization returns a synthetic savings-plans utilization aggregate.
func (*InMemoryBackend) GetSavingsPlansUtilizationDetails ¶
func (b *InMemoryBackend) GetSavingsPlansUtilizationDetails( start, end string, ) []SavingsPlansUtilizationDetail
GetSavingsPlansUtilizationDetails returns per-plan utilization details.
func (*InMemoryBackend) GetTagKeys ¶
func (b *InMemoryBackend) GetTagKeys() []string
GetTagKeys returns all distinct tag keys used across the cost ledger.
func (*InMemoryBackend) GetTagKeysFiltered ¶ added in v1.3.1
func (b *InMemoryBackend) GetTagKeysFiltered(constraintKey string, constraintValues []string) []string
GetTagKeysFiltered returns distinct tag keys, restricted to ledger entries whose `constraintKey` tag value is one of constraintValues (when constraintKey is non-empty). Gives GetTagsInput.Filter's Tags clause a real, non-fabricated effect.
func (*InMemoryBackend) GetTagValues ¶
func (b *InMemoryBackend) GetTagValues(tagKey string) []string
GetTagValues returns distinct values for a tag key.
func (*InMemoryBackend) GetTagValuesFiltered ¶ added in v1.3.1
func (b *InMemoryBackend) GetTagValuesFiltered(tagKey, constraintKey string, constraintValues []string) []string
GetTagValuesFiltered returns distinct values of tagKey, restricted to ledger entries whose `constraintKey` tag value is one of constraintValues (when constraintKey is non-empty).
func (*InMemoryBackend) ListBackfillHistory ¶
func (b *InMemoryBackend) ListBackfillHistory() []*BackfillJob
ListBackfillHistory returns backfill jobs sorted by RequestedAt descending. b.backfillJobs is an append-only slice (not a Table.All() map walk), so its insertion order is already stable across calls; the BackfillID tiebreak below only matters for RequestedAt's second-precision ties, making the full order deterministic for pagination cursoring.
func (*InMemoryBackend) ListCommitmentAnalyses ¶
func (b *InMemoryBackend) ListCommitmentAnalyses(statusFilter string) []*CommitmentAnalysis
ListCommitmentAnalyses returns commitment analyses sorted by AnalysisStartedTime descending, optionally filtered to statusFilter.
Table.All() walks the table's backing map in unspecified order, and AnalysisStartedTime has only second precision, so two analyses started in the same second tie under a plain sort.Slice: the tiebreak on AnalysisID below makes the order fully deterministic across repeated calls instead of depending on map iteration order, which matters once pagination cursors on this same order (see handleListCommitmentPurchaseAnalyses).
func (*InMemoryBackend) ListCostAllocationTags ¶
func (b *InMemoryBackend) ListCostAllocationTags( status, tagType string, tagKeys []string, ) []*CostAllocationTag
ListCostAllocationTags returns cost allocation tags, optionally filtered.
func (*InMemoryBackend) ListCostCategoryDefinitions ¶
func (b *InMemoryBackend) ListCostCategoryDefinitions( maxResults int, nextPageToken, effectiveOn string, ) ([]*CostCategory, string)
ListCostCategoryDefinitions returns cost categories sorted by name with opaque pagination, narrowed to categories whose EffectiveStart is on or before effectiveOn -- see DescribeCostCategoryDefinition's EffectiveOn handling for why this backend can only honor "existed by this date", not real AWS's full historical-version lookup. Per ListCostCategoryDefinitionsInput.EffectiveOn's doc comment, an empty effectiveOn defaults to the current date rather than disabling the filter.
func (*InMemoryBackend) ListSavingsPlansGenerations ¶ added in v1.2.0
func (b *InMemoryBackend) ListSavingsPlansGenerations( status string, recommendationIDs []string, ) []*SavingsPlansGeneration
ListSavingsPlansGenerations returns generation jobs, optionally filtered by GenerationStatus and/or recommendationIDs (RecommendationId allow-list), most recently started first.
Table.All() walks the table's backing map in unspecified order, and GenerationStartedTime has only second precision, so two jobs started in the same second tie under a plain sort.Slice: the tiebreak on RecommendationID below makes the order fully deterministic across repeated calls instead of depending on map iteration order, which matters once pagination cursors on this same order (see handleListSavingsPlansPurchaseRecommendationGeneration).
func (*InMemoryBackend) ListTagsForResource ¶
func (b *InMemoryBackend) ListTagsForResource(resourceARN string) (map[string]string, error)
ListTagsForResource returns the tags for a CE resource by ARN.
func (*InMemoryBackend) ProvideAnomalyFeedback ¶
func (b *InMemoryBackend) ProvideAnomalyFeedback(anomalyID, feedback string) error
ProvideAnomalyFeedback persists feedback for an anomaly.
func (*InMemoryBackend) Region ¶
func (b *InMemoryBackend) Region() string
Region returns the region for this backend instance.
func (*InMemoryBackend) Restore ¶
func (b *InMemoryBackend) Restore(ctx context.Context, data []byte) error
Restore loads backend state from a JSON snapshot. It implements persistence.Persistable.
func (*InMemoryBackend) Snapshot ¶
func (b *InMemoryBackend) Snapshot(ctx context.Context) []byte
Snapshot serialises the backend state to JSON. It implements persistence.Persistable.
func (*InMemoryBackend) StartJanitor ¶
func (b *InMemoryBackend) StartJanitor(ctx context.Context, interval time.Duration)
StartJanitor launches a background goroutine that evicts anomalies older than the backend's TTL. It stops when ctx is cancelled.
func (*InMemoryBackend) TagResource ¶
func (b *InMemoryBackend) TagResource(resourceARN string, resourceTags map[string]string) error
TagResource adds or updates tags on a CE resource.
func (*InMemoryBackend) TagValueCost ¶ added in v1.3.1
func (b *InMemoryBackend) TagValueCost(tagKey, value, metric string) float64
TagValueCost sums the requested cost metric across ledger entries whose tag `tagKey` equals value. Used to give GetTags' SortBy a real ordering.
func (*InMemoryBackend) TaggedResources ¶ added in v1.3.1
func (b *InMemoryBackend) TaggedResources() []TaggedEntry
TaggedResources returns every CE resource ARN (cost categories, anomaly monitors, anomaly subscriptions) that currently has at least one tag applied via TagResource.
func (*InMemoryBackend) UntagResource ¶
func (b *InMemoryBackend) UntagResource(resourceARN string, tagKeys []string) error
UntagResource removes tags from a CE resource.
func (*InMemoryBackend) UpdateAnomalyMonitor ¶
func (b *InMemoryBackend) UpdateAnomalyMonitor( monARN, monitorName string, ) (*AnomalyMonitor, error)
UpdateAnomalyMonitor updates the name of an anomaly monitor.
func (*InMemoryBackend) UpdateAnomalySubscription ¶
func (b *InMemoryBackend) UpdateAnomalySubscription( subARN, frequency, subscriptionName string, monitorARNList []string, subscribers []Subscriber, threshold float64, thresholdExpression *ceExpression, ) (*AnomalySubscription, error)
UpdateAnomalySubscription updates a CE anomaly subscription.
func (*InMemoryBackend) UpdateCostAllocationTagsStatus ¶
func (b *InMemoryBackend) UpdateCostAllocationTagsStatus( updates []CostAllocationTagStatusEntry, ) []CostAllocationTagError
UpdateCostAllocationTagsStatus updates the Active/Inactive status of cost allocation tags. Returns a list of errors for tags that could not be updated.
func (*InMemoryBackend) UpdateCostCategoryDefinition ¶
func (b *InMemoryBackend) UpdateCostCategoryDefinition( catARN, ruleVersion, defaultValue string, rules []CostCategoryRule, splitChargeRules []SplitChargeRule, requestedEffectiveStart string, ) (*CostCategory, error)
UpdateCostCategoryDefinition updates an existing cost category. requestedEffectiveStart, when non-empty, overrides the default "first day of the current month" -- same optional-field default as CreateCostCategoryDefinition (api_op_UpdateCostCategoryDefinition.go's EffectiveStart doc is identical to Create's: "If the date isn't provided, it's the first day of the current month").
type MetricValue ¶
MetricValue holds Amount+Unit for a cost metric.
type Provider ¶
type Provider struct{}
Provider implements service.Provider for the Cost Explorer (Ce) service.
func (*Provider) Init ¶
func (p *Provider) Init(ctx *service.AppContext) (service.Registerable, error)
Init initializes the Cost Explorer service.
type ReservationCoverageAgg ¶
type ReservationCoverageAgg struct {
CoverageHours ReservationCoverageHours `json:"CoverageHours"`
CoverageNormalizedUnits ReservationCoverageNormalizedUnits `json:"CoverageNormalizedUnits"`
CoverageCost ReservationCoverageCost `json:"CoverageCost"`
}
ReservationCoverageAgg holds RI coverage aggregates.
type ReservationCoverageByTime ¶
type ReservationCoverageByTime struct {
TimePeriod map[string]string `json:"TimePeriod"`
Total ReservationCoverageAgg `json:"Total"`
Groups []any `json:"Groups"`
}
ReservationCoverageByTime holds RI coverage for a time period.
type ReservationCoverageCost ¶
type ReservationCoverageCost struct {
OnDemandCost string `json:"OnDemandCost"`
}
ReservationCoverageCost holds cost-based RI coverage.
type ReservationCoverageHours ¶
type ReservationCoverageHours struct {
OnDemandHours string `json:"OnDemandHours"`
ReservedHours string `json:"ReservedHours"`
TotalRunningHours string `json:"TotalRunningHours"`
CoverageHoursPercentage string `json:"CoverageHoursPercentage"`
}
ReservationCoverageHours holds hourly RI coverage data.
type ReservationCoverageNormalizedUnits ¶
type ReservationCoverageNormalizedUnits struct {
OnDemandNormalizedUnits string `json:"OnDemandNormalizedUnits"`
ReservedNormalizedUnits string `json:"ReservedNormalizedUnits"`
TotalRunningNormalizedUnits string `json:"TotalRunningNormalizedUnits"`
CoverageNormalizedUnitsPercentage string `json:"CoverageNormalizedUnitsPercentage"`
}
ReservationCoverageNormalizedUnits holds normalized unit coverage.
type ReservationRecommendation ¶
type ReservationRecommendation struct {
ServiceSpecification map[string]any `json:"ServiceSpecification,omitempty"`
RecommendationSummary map[string]string `json:"RecommendationSummary,omitempty"`
AccountScope string `json:"AccountScope,omitempty"`
LookbackPeriodInDays string `json:"LookbackPeriodInDays,omitempty"`
TermInYears string `json:"TermInYears,omitempty"`
PaymentOption string `json:"PaymentOption,omitempty"`
RecommendationDetails []ReservationRecommendationDetail `json:"RecommendationDetails"`
}
ReservationRecommendation holds a single RI recommendation group.
type ReservationRecommendationDetail ¶
type ReservationRecommendationDetail struct {
AccountID string `json:"AccountId,omitempty"`
InstanceDetails map[string]any `json:"InstanceDetails,omitempty"`
RecommendedNumberOfInstancesToPurchase string `json:"RecommendedNumberOfInstancesToPurchase"`
RecommendedNormalizedUnitsToPurchase string `json:"RecommendedNormalizedUnitsToPurchase"`
MinimumNumberOfInstancesUsedPerHour string `json:"MinimumNumberOfInstancesUsedPerHour"`
MinimumNormalizedUnitsUsedPerHour string `json:"MinimumNormalizedUnitsUsedPerHour"`
MaximumNumberOfInstancesUsedPerHour string `json:"MaximumNumberOfInstancesUsedPerHour"`
MaximumNormalizedUnitsUsedPerHour string `json:"MaximumNormalizedUnitsUsedPerHour"`
AverageNumberOfInstancesUsedPerHour string `json:"AverageNumberOfInstancesUsedPerHour"`
AverageNormalizedUnitsUsedPerHour string `json:"AverageNormalizedUnitsUsedPerHour"`
AverageUtilization string `json:"AverageUtilization"`
EstimatedBreakEvenInMonths string `json:"EstimatedBreakEvenInMonths"`
CurrencyCode string `json:"CurrencyCode"`
EstimatedMonthlySavingsAmount string `json:"EstimatedMonthlySavingsAmount"`
EstimatedMonthlySavingsPercentage string `json:"EstimatedMonthlySavingsPercentage"`
EstimatedMonthlyOnDemandCost string `json:"EstimatedMonthlyOnDemandCost"`
EstimatedReservationCostForLookbackPeriod string `json:"EstimatedReservationCostForLookbackPeriod"`
UpfrontCost string `json:"UpfrontCost"`
RecurringStandardMonthlyCost string `json:"RecurringStandardMonthlyCost"`
}
ReservationRecommendationDetail is one RI recommendation.
type ReservationUtilizationAgg ¶
type ReservationUtilizationAgg struct {
UtilizationPercentage string `json:"UtilizationPercentage"`
PurchasedHours string `json:"PurchasedHours"`
TotalActualHours string `json:"TotalActualHours"`
UnusedHours string `json:"UnusedHours"`
OnDemandCostOfRIHoursUsed string `json:"OnDemandCostOfRIHoursUsed"`
NetRISavings string `json:"NetRISavings"`
TotalPotentialRISavings string `json:"TotalPotentialRISavings"`
AmortizedUpfrontFee string `json:"AmortizedUpfrontFee"`
AmortizedRecurringFee string `json:"AmortizedRecurringFee"`
TotalAmortizedFee string `json:"TotalAmortizedFee"`
RICostForUnusedHours string `json:"RICostForUnusedHours"`
RealizedSavings string `json:"RealizedSavings"`
UnrealizedSavings string `json:"UnrealizedSavings"`
}
ReservationUtilizationAgg holds RI utilization aggregates.
type ReservationUtilizationByTime ¶
type ReservationUtilizationByTime struct {
TimePeriod map[string]string `json:"TimePeriod"`
Total ReservationUtilizationAgg `json:"Total"`
Groups []any `json:"Groups"`
}
ReservationUtilizationByTime holds RI utilization for a time period.
type ResultByTime ¶
type ResultByTime struct {
TimePeriod map[string]string `json:"TimePeriod"`
Total map[string]MetricValue `json:"Total"`
Groups []CostGroup `json:"Groups"`
Estimated bool `json:"Estimated"`
}
ResultByTime represents a single time period in GetCostAndUsage.
type RightsizingCurrentInstance ¶
type RightsizingCurrentInstance struct {
ResourceID string `json:"ResourceId"`
InstanceType string `json:"InstanceType,omitempty"`
MonthlyCost string `json:"MonthlyCost,omitempty"`
CurrencyCode string `json:"CurrencyCode,omitempty"`
}
RightsizingCurrentInstance holds details about the current instance.
type RightsizingModifyDetail ¶
type RightsizingModifyDetail struct {
TargetInstances []RightsizingTargetInstance `json:"TargetInstances"`
}
RightsizingModifyDetail holds modification target options.
type RightsizingRecommendation ¶
type RightsizingRecommendation struct {
ModifyRecommendationDetail *RightsizingModifyDetail `json:"ModifyRecommendationDetail,omitempty"`
TerminateRecommendationDetail *RightsizingTerminateDetail `json:"TerminateRecommendationDetail,omitempty"`
CurrentInstance RightsizingCurrentInstance `json:"CurrentInstance"`
AccountID string `json:"AccountId"`
RightsizingType string `json:"RightsizingType"`
}
RightsizingRecommendation is a single rightsizing recommendation.
type RightsizingTargetInstance ¶
type RightsizingTargetInstance struct {
ResourceDetails map[string]any `json:"ResourceDetails,omitempty"`
EstimatedMonthlyCost string `json:"EstimatedMonthlyCost"`
EstimatedMonthlySavings string `json:"EstimatedMonthlySavings"`
EstimatedSavingsPercentage string `json:"EstimatedSavingsPercentage"`
CurrencyCode string `json:"CurrencyCode"`
DefaultTargetInstance bool `json:"DefaultTargetInstance"`
}
RightsizingTargetInstance is a recommended replacement instance.
type RightsizingTerminateDetail ¶
type RightsizingTerminateDetail struct {
EstimatedMonthlySavings string `json:"EstimatedMonthlySavings,omitempty"`
CurrencyCode string `json:"CurrencyCode,omitempty"`
}
RightsizingTerminateDetail holds termination savings estimate.
type SavingsPlansAmortized ¶
type SavingsPlansAmortized struct {
AmortizedRecurringCommitment string `json:"AmortizedRecurringCommitment"`
AmortizedUpfrontCommitment string `json:"AmortizedUpfrontCommitment"`
TotalAmortizedCommitment string `json:"TotalAmortizedCommitment"`
}
SavingsPlansAmortized holds amortized commitment.
type SavingsPlansGeneration ¶ added in v1.2.0
type SavingsPlansGeneration struct {
RecommendationID string `json:"recommendationId"`
GenerationStatus string `json:"generationStatus"` // PROCESSING|SUCCEEDED|FAILED
GenerationStartedTime string `json:"generationStartedTime"`
GenerationCompletionTime string `json:"generationCompletionTime,omitempty"`
EstimatedCompletionTime string `json:"estimatedCompletionTime"`
}
SavingsPlansGeneration represents a Savings Plans purchase recommendation generation job, matching real AWS CE's GenerationSummary shape (RecommendationId, not GenerationId -- see api_op_StartSavingsPlansPurchaseRecommendationGeneration.go).
type SavingsPlansSavings ¶
type SavingsPlansSavings struct {
NetSavings string `json:"NetSavings"`
OnDemandCostEquivalent string `json:"OnDemandCostEquivalent"`
}
SavingsPlansSavings holds SP savings.
type SavingsPlansUtilizationAgg ¶
type SavingsPlansUtilizationAgg struct {
TotalCommitment string `json:"TotalCommitment"`
UsedCommitment string `json:"UsedCommitment"`
UnusedCommitment string `json:"UnusedCommitment"`
UtilizationPercentage string `json:"UtilizationPercentage"`
}
SavingsPlansUtilizationAgg holds SP utilization aggregates.
type SavingsPlansUtilizationDetail ¶
type SavingsPlansUtilizationDetail struct {
Attributes map[string]string `json:"Attributes,omitempty"`
Utilization *SavingsPlansUtilizationAgg `json:"Utilization,omitempty"`
AmortizedCommitment *SavingsPlansAmortized `json:"AmortizedCommitment,omitempty"`
Savings *SavingsPlansSavings `json:"Savings,omitempty"`
SavingsPlanARN string `json:"SavingsPlanArn"`
}
SavingsPlansUtilizationDetail is a per-plan utilization entry. Utilization/AmortizedCommitment/Savings/Attributes are pointers so GetSavingsPlansUtilizationDetailsInput.DataType (real []types.SavingsPlansDataType -- ATTRIBUTES/UTILIZATION/ AMORTIZED_COMMITMENT/SAVINGS) can genuinely omit the sections a request didn't ask for, matching real AWS's per-item selective population instead of always emitting every section regardless of what was requested.
type SavingsPlansUtilizationResult ¶
type SavingsPlansUtilizationResult struct {
Utilization SavingsPlansUtilizationAgg `json:"Utilization"`
Savings SavingsPlansSavings `json:"Savings"`
AmortizedCommitment SavingsPlansAmortized `json:"AmortizedCommitment"`
}
SavingsPlansUtilizationResult is the total savings plans utilization.
type SplitChargeRule ¶
type SplitChargeRule struct {
Source string `json:"source"`
Method string `json:"method"`
Targets []string `json:"targets"`
}
SplitChargeRule represents a cost category split charge rule.
type Subscriber ¶
type Subscriber struct {
Address string `json:"address"`
Type string `json:"type"`
Status string `json:"status"`
}
Subscriber represents a CE anomaly subscription notification target.
type TaggedEntry ¶ added in v1.3.1
TaggedEntry pairs a resource ARN with its tags.
type TotalImpactFilter ¶
TotalImpactFilter narrows GetAnomalies results by an anomaly's total dollar impact -- mirrors aws-sdk-go-v2/service/costexplorer/types.TotalImpactFilter.
Source Files
¶
- anomalies.go
- commitment_purchase_analysis.go
- cost_allocation_tags.go
- cost_categories.go
- cost_usage.go
- errors.go
- filter.go
- handler.go
- handler_anomalies.go
- handler_commitment_purchase_analysis.go
- handler_cost_allocation_tags.go
- handler_cost_categories.go
- handler_cost_usage.go
- handler_reservations.go
- handler_savings_plans.go
- handler_tags.go
- models.go
- persistence.go
- provider.go
- reservations.go
- savings_plans.go
- store.go
- store_setup.go
- tags.go