AWS SDK for Go (PILOT)
API Reference

PREVIEW DOCUMENTATION - This is a preview of a new format for the AWS SDK for Go API Reference documentation. For the current AWS SDK for Go API Reference, see https://docs.aws.amazon.com/sdk-for-go/api/.

We welcome your feedback on this new version of the documentation. Send your comments to aws-sdkdocs-feedback@amazon.com.

GetCostForecastInput

import "github.com/aws/aws-sdk-go/service/costexplorer"

type GetCostForecastInput struct { Filter *Expression `type:"structure"` Granularity *string `type:"string" required:"true" enum:"Granularity"` Metric *string `type:"string" required:"true" enum:"Metric"` PredictionIntervalLevel *int64 `min:"51" type:"integer"` TimePeriod *DateInterval `type:"structure" required:"true"` }

Filter

Use Expression to filter by cost or by usage. There are two patterns:

  • Simple dimension values - You can set the dimension name and values for the filters that you plan to use. For example, you can filter for INSTANCE_TYPE==m4.xlarge OR INSTANCE_TYPE==c4.large. The Expression for that looks like this:

{ "Dimensions": { "Key": "INSTANCE_TYPE", "Values": [ "m4.xlarge", “c4.large”

] } }

The list of dimension values are OR'd together to retrieve cost or usage

data. You can create Expression and DimensionValues objects using either with* methods or set* methods in multiple lines.
  • Compound dimension values with logical operations - You can use multiple Expression types and the logical operators AND/OR/NOT to create a list of one or more Expression objects. This allows you to filter on more advanced options. For example, you can filter on ((INSTANCE_TYPE == m4.large OR INSTANCE_TYPE == m3.large) OR (TAG.Type == Type1)) AND (USAGE_TYPE != DataTransfer). The Expression for that looks like this:

{ "And": [ {"Or": [ {"Dimensions": { "Key": "INSTANCE_TYPE", "Values": [

"m4.x.large", "c4.large" ] }}, {"Tags": { "Key": "TagName", "Values": ["Value1"] } } ]}, {"Not": {"Dimensions": { "Key": "USAGE_TYPE", "Values": ["DataTransfer"] }}} ] }

Because each Expression can have only one operator, the service returns an

error if more than one is specified. The following example shows an Expression object that creates an error.

{ "And": [ ... ], "DimensionValues": { "Dimension": "USAGE_TYPE", "Values":

[ "DataTransfer" ] } }
Granularity

Type: *string

How granular you want the forecast to be. You can get 3 months of DAILY forecasts or 12 months of MONTHLY forecasts.

The GetCostForecast operation supports only DAILY and MONTHLY granularities.

Granularity is a required field

Metric

Type: *string

Which metric Cost Explorer uses to create your forecast. For more information about blended and unblended rates, see Why does the "blended" annotation appear on some line items in my bill? (https://aws.amazon.com/premiumsupport/knowledge-center/blended-rates-intro/).

Valid values for a GetCostForecast call are the following:

  • AmortizedCost

  • BlendedCost

  • NetAmortizedCost

  • NetUnblendedCost

  • UnblendedCost

Metric is a required field

PredictionIntervalLevel

Type: *int64

Cost Explorer always returns the mean forecast as a single point. You can request a prediction interval around the mean by specifying a confidence level. The higher the confidence level, the more confident Cost Explorer is about the actual value falling in the prediction interval. Higher confidence levels result in wider prediction intervals.

TimePeriod

The time period that you want the usage and costs for.

Method

GoString

func (s GetCostForecastInput) GoString() string

GoString returns the string representation

SetFilter

func (s *GetCostForecastInput) SetFilter(v *Expression) *GetCostForecastInput

SetFilter sets the Filter field's value.

SetGranularity

func (s *GetCostForecastInput) SetGranularity(v string) *GetCostForecastInput

SetGranularity sets the Granularity field's value.

SetMetric

func (s *GetCostForecastInput) SetMetric(v string) *GetCostForecastInput

SetMetric sets the Metric field's value.

SetPredictionIntervalLevel

func (s *GetCostForecastInput) SetPredictionIntervalLevel(v int64) *GetCostForecastInput

SetPredictionIntervalLevel sets the PredictionIntervalLevel field's value.

SetTimePeriod

func (s *GetCostForecastInput) SetTimePeriod(v *DateInterval) *GetCostForecastInput

SetTimePeriod sets the TimePeriod field's value.

String

func (s GetCostForecastInput) String() string

String returns the string representation

Validate

func (s *GetCostForecastInput) Validate() error

Validate inspects the fields of the type to determine if they are valid.

On this page: