Skip to content

Get Reservation Purchase Recommendation

costexplorer_get_reservation_purchase_recommendation R Documentation

Gets recommendations for reservation purchases

Description

Gets recommendations for reservation purchases. These recommendations might help you to reduce your costs. Reservations provide a discounted hourly rate (up to 75%) compared to On-Demand pricing.

Amazon Web Services generates your recommendations by identifying your On-Demand usage during a specific time period and collecting your usage into categories that are eligible for a reservation. After Amazon Web Services has these categories, it simulates every combination of reservations in each category of usage to identify the best number of each type of Reserved Instance (RI) to purchase to maximize your estimated savings.

For example, Amazon Web Services automatically aggregates your Amazon EC2 Linux, shared tenancy, and c4 family usage in the US West (Oregon) Region and recommends that you buy size-flexible regional reservations to apply to the c4 family usage. Amazon Web Services recommends the smallest size instance in an instance family. This makes it easier to purchase a size-flexible Reserved Instance (RI). Amazon Web Services also shows the equal number of normalized units. This way, you can purchase any instance size that you want. For this example, your RI recommendation is for c4.large because that is the smallest size instance in the c4 instance family.

Usage

costexplorer_get_reservation_purchase_recommendation(AccountId, Service,
  Filter, AccountScope, LookbackPeriodInDays, TermInYears, PaymentOption,
  ServiceSpecification, PageSize, NextPageToken)

Arguments

AccountId

The account ID that's associated with the recommendation.

Service

[required] The specific service that you want recommendations for.

Filter

Use Expression to filter in various Cost Explorer APIs.

Not all Expression types are supported in each API. Refer to the documentation for each specific API to see what is supported.

There are two patterns:

  • Simple dimension values.

    • There are three types of simple dimension values: CostCategories, Tags, and Dimensions.

      • Specify the CostCategories field to define a filter that acts on Cost Categories.

      • Specify the Tags field to define a filter that acts on Cost Allocation Tags.

      • Specify the Dimensions field to define a filter that acts on the DimensionValues .

    • For each filter type, you can set the dimension name and values for the filters that you plan to use.

      • For example, you can filter for ⁠REGION==us-east-1 OR REGION==us-west-1⁠. For get_rightsizing_recommendation, the Region is a full name (for example, ⁠REGION==US East (N. Virginia)⁠.

      • The corresponding Expression for this example is as follows: ⁠{ "Dimensions": { "Key": "REGION", "Values": [ "us-east-1", "us-west-1" ] } }⁠

      • As shown in the previous example, lists of dimension values are combined with OR when applying the filter.

    • You can also set different match options to further control how the filter behaves. Not all APIs support match options. Refer to the documentation for each specific API to see what is supported.

      • For example, you can filter for linked account names that start with "a".

      • The corresponding Expression for this example is as follows: ⁠{ "Dimensions": { "Key": "LINKED_ACCOUNT_NAME", "MatchOptions": [ "STARTS_WITH" ], "Values": [ "a" ] } }⁠

  • Compound Expression types 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. By doing this, you can filter by more advanced options.

    • For example, you can filter by ⁠((REGION == us-east-1 OR REGION == us-west-1) OR (TAG.Type == Type1)) AND (USAGE_TYPE != DataTransfer)⁠.

    • The corresponding Expression for this example is as follows: ⁠{ "And": [ {"Or": [ {"Dimensions": { "Key": "REGION", "Values": [ "us-east-1", "us-west-1" ] }}, {"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": [ ... ], "Dimensions": { "Key": "USAGE_TYPE", "Values": [ "DataTransfer" ] } }⁠

    The following is an example of the corresponding error message: "Expression has more than one roots. Only one root operator is allowed for each expression: And, Or, Not, Dimensions, Tags, CostCategories"

For the get_rightsizing_recommendation action, a combination of OR and NOT isn't supported. OR isn't supported between different dimensions, or dimensions and tags. NOT operators aren't supported. Dimensions are also limited to LINKED_ACCOUNT, REGION, or RIGHTSIZING_TYPE.

For the get_reservation_purchase_recommendation action, only NOT is supported. AND and OR aren't supported. Dimensions are limited to LINKED_ACCOUNT.

AccountScope

The account scope that you want your recommendations for. Amazon Web Services calculates recommendations including the management account and member accounts if the value is set to PAYER. If the value is LINKED, recommendations are calculated for individual member accounts only.

LookbackPeriodInDays

The number of previous days that you want Amazon Web Services to consider when it calculates your recommendations.

TermInYears

The reservation term that you want recommendations for.

PaymentOption

The reservation purchase option that you want recommendations for.

ServiceSpecification

The hardware specifications for the service instances that you want recommendations for, such as standard or convertible Amazon EC2 instances.

PageSize

The number of recommendations that you want returned in a single response object.

NextPageToken

The pagination token that indicates the next set of results that you want to retrieve.

Value

A list with the following syntax:

list(
  Metadata = list(
    RecommendationId = "string",
    GenerationTimestamp = "string",
    AdditionalMetadata = "string"
  ),
  Recommendations = list(
    list(
      AccountScope = "PAYER"|"LINKED",
      LookbackPeriodInDays = "SEVEN_DAYS"|"THIRTY_DAYS"|"SIXTY_DAYS",
      TermInYears = "ONE_YEAR"|"THREE_YEARS",
      PaymentOption = "NO_UPFRONT"|"PARTIAL_UPFRONT"|"ALL_UPFRONT"|"LIGHT_UTILIZATION"|"MEDIUM_UTILIZATION"|"HEAVY_UTILIZATION",
      ServiceSpecification = list(
        EC2Specification = list(
          OfferingClass = "STANDARD"|"CONVERTIBLE"
        )
      ),
      RecommendationDetails = list(
        list(
          AccountId = "string",
          InstanceDetails = list(
            EC2InstanceDetails = list(
              Family = "string",
              InstanceType = "string",
              Region = "string",
              AvailabilityZone = "string",
              Platform = "string",
              Tenancy = "string",
              CurrentGeneration = TRUE|FALSE,
              SizeFlexEligible = TRUE|FALSE
            ),
            RDSInstanceDetails = list(
              Family = "string",
              InstanceType = "string",
              Region = "string",
              DatabaseEngine = "string",
              DatabaseEdition = "string",
              DeploymentOption = "string",
              LicenseModel = "string",
              CurrentGeneration = TRUE|FALSE,
              SizeFlexEligible = TRUE|FALSE,
              DeploymentModel = "string"
            ),
            RedshiftInstanceDetails = list(
              Family = "string",
              NodeType = "string",
              Region = "string",
              CurrentGeneration = TRUE|FALSE,
              SizeFlexEligible = TRUE|FALSE
            ),
            ElastiCacheInstanceDetails = list(
              Family = "string",
              NodeType = "string",
              Region = "string",
              ProductDescription = "string",
              CurrentGeneration = TRUE|FALSE,
              SizeFlexEligible = TRUE|FALSE
            ),
            ESInstanceDetails = list(
              InstanceClass = "string",
              InstanceSize = "string",
              Region = "string",
              CurrentGeneration = TRUE|FALSE,
              SizeFlexEligible = TRUE|FALSE
            ),
            MemoryDBInstanceDetails = list(
              Family = "string",
              NodeType = "string",
              Region = "string",
              CurrentGeneration = TRUE|FALSE,
              SizeFlexEligible = TRUE|FALSE
            )
          ),
          RecommendedNumberOfInstancesToPurchase = "string",
          RecommendedNormalizedUnitsToPurchase = "string",
          MinimumNumberOfInstancesUsedPerHour = "string",
          MinimumNormalizedUnitsUsedPerHour = "string",
          MaximumNumberOfInstancesUsedPerHour = "string",
          MaximumNormalizedUnitsUsedPerHour = "string",
          AverageNumberOfInstancesUsedPerHour = "string",
          AverageNormalizedUnitsUsedPerHour = "string",
          AverageUtilization = "string",
          EstimatedBreakEvenInMonths = "string",
          CurrencyCode = "string",
          EstimatedMonthlySavingsAmount = "string",
          EstimatedMonthlySavingsPercentage = "string",
          EstimatedMonthlyOnDemandCost = "string",
          EstimatedReservationCostForLookbackPeriod = "string",
          UpfrontCost = "string",
          RecurringStandardMonthlyCost = "string",
          ReservedCapacityDetails = list(
            DynamoDBCapacityDetails = list(
              CapacityUnits = "string",
              Region = "string"
            )
          ),
          RecommendedNumberOfCapacityUnitsToPurchase = "string",
          MinimumNumberOfCapacityUnitsUsedPerHour = "string",
          MaximumNumberOfCapacityUnitsUsedPerHour = "string",
          AverageNumberOfCapacityUnitsUsedPerHour = "string"
        )
      ),
      RecommendationSummary = list(
        TotalEstimatedMonthlySavingsAmount = "string",
        TotalEstimatedMonthlySavingsPercentage = "string",
        CurrencyCode = "string"
      )
    )
  ),
  NextPageToken = "string"
)

Request syntax

svc$get_reservation_purchase_recommendation(
  AccountId = "string",
  Service = "string",
  Filter = list(
    Or = list(
      list()
    ),
    And = list(
      list()
    ),
    Not = list(),
    Dimensions = list(
      Key = "AZ"|"INSTANCE_TYPE"|"LINKED_ACCOUNT"|"PAYER_ACCOUNT"|"LINKED_ACCOUNT_NAME"|"OPERATION"|"PURCHASE_TYPE"|"REGION"|"SERVICE"|"SERVICE_CODE"|"USAGE_TYPE"|"USAGE_TYPE_GROUP"|"RECORD_TYPE"|"OPERATING_SYSTEM"|"TENANCY"|"SCOPE"|"PLATFORM"|"SUBSCRIPTION_ID"|"LEGAL_ENTITY_NAME"|"DEPLOYMENT_OPTION"|"DATABASE_ENGINE"|"CACHE_ENGINE"|"INSTANCE_TYPE_FAMILY"|"BILLING_ENTITY"|"RESERVATION_ID"|"RESOURCE_ID"|"RIGHTSIZING_TYPE"|"SAVINGS_PLANS_TYPE"|"SAVINGS_PLAN_ARN"|"PAYMENT_OPTION"|"AGREEMENT_END_DATE_TIME_AFTER"|"AGREEMENT_END_DATE_TIME_BEFORE"|"INVOICING_ENTITY"|"ANOMALY_TOTAL_IMPACT_ABSOLUTE"|"ANOMALY_TOTAL_IMPACT_PERCENTAGE",
      Values = list(
        "string"
      ),
      MatchOptions = list(
        "EQUALS"|"ABSENT"|"STARTS_WITH"|"ENDS_WITH"|"CONTAINS"|"CASE_SENSITIVE"|"CASE_INSENSITIVE"|"GREATER_THAN_OR_EQUAL"
      )
    ),
    Tags = list(
      Key = "string",
      Values = list(
        "string"
      ),
      MatchOptions = list(
        "EQUALS"|"ABSENT"|"STARTS_WITH"|"ENDS_WITH"|"CONTAINS"|"CASE_SENSITIVE"|"CASE_INSENSITIVE"|"GREATER_THAN_OR_EQUAL"
      )
    ),
    CostCategories = list(
      Key = "string",
      Values = list(
        "string"
      ),
      MatchOptions = list(
        "EQUALS"|"ABSENT"|"STARTS_WITH"|"ENDS_WITH"|"CONTAINS"|"CASE_SENSITIVE"|"CASE_INSENSITIVE"|"GREATER_THAN_OR_EQUAL"
      )
    )
  ),
  AccountScope = "PAYER"|"LINKED",
  LookbackPeriodInDays = "SEVEN_DAYS"|"THIRTY_DAYS"|"SIXTY_DAYS",
  TermInYears = "ONE_YEAR"|"THREE_YEARS",
  PaymentOption = "NO_UPFRONT"|"PARTIAL_UPFRONT"|"ALL_UPFRONT"|"LIGHT_UTILIZATION"|"MEDIUM_UTILIZATION"|"HEAVY_UTILIZATION",
  ServiceSpecification = list(
    EC2Specification = list(
      OfferingClass = "STANDARD"|"CONVERTIBLE"
    )
  ),
  PageSize = 123,
  NextPageToken = "string"
)