AWS Savings Plans

2020/09/24 - AWS Savings Plans - 1 new2 updated api methods

Changes  Update savingsplans client to latest version

DeleteQueuedSavingsPlan (new) Link ¶

Deletes the queued purchase for the specified Savings Plan.

See also: AWS API Documentation

Request Syntax

client.delete_queued_savings_plan(
    savingsPlanId='string'
)
type savingsPlanId:

string

param savingsPlanId:

[REQUIRED]

The ID of the Savings Plan.

rtype:

dict

returns:

Response Syntax

{}

Response Structure

  • (dict) --

CreateSavingsPlan (updated) Link ¶
Changes (request)
{'purchaseTime': 'timestamp'}

Creates a Savings Plan.

See also: AWS API Documentation

Request Syntax

client.create_savings_plan(
    savingsPlanOfferingId='string',
    commitment='string',
    upfrontPaymentAmount='string',
    purchaseTime=datetime(2015, 1, 1),
    clientToken='string',
    tags={
        'string': 'string'
    }
)
type savingsPlanOfferingId:

string

param savingsPlanOfferingId:

[REQUIRED]

The ID of the offering.

type commitment:

string

param commitment:

[REQUIRED]

The hourly commitment, in USD. This is a value between 0.001 and 1 million. You cannot specify more than three digits after the decimal point.

type upfrontPaymentAmount:

string

param upfrontPaymentAmount:

The up-front payment amount. This is a whole number between 50 and 99 percent of the total value of the Savings Plan. This parameter is supported only if the payment option is Partial Upfront.

type purchaseTime:

datetime

param purchaseTime:

The time at which to purchase the Savings Plan, in UTC format (YYYY-MM-DDTHH:MM:SSZ).

type clientToken:

string

param clientToken:

Unique, case-sensitive identifier that you provide to ensure the idempotency of the request.

This field is autopopulated if not provided.

type tags:

dict

param tags:

One or more tags.

  • (string) --

    • (string) --

rtype:

dict

returns:

Response Syntax

{
    'savingsPlanId': 'string'
}

Response Structure

  • (dict) --

    • savingsPlanId (string) --

      The ID of the Savings Plan.

DescribeSavingsPlans (updated) Link ¶
Changes (request, response)
Request
{'states': {'queued-deleted', 'queued'}}
Response
{'savingsPlans': {'state': {'queued-deleted', 'queued'}}}

Describes the specified Savings Plans.

See also: AWS API Documentation

Request Syntax

client.describe_savings_plans(
    savingsPlanArns=[
        'string',
    ],
    savingsPlanIds=[
        'string',
    ],
    nextToken='string',
    maxResults=123,
    states=[
        'payment-pending'|'payment-failed'|'active'|'retired'|'queued'|'queued-deleted',
    ],
    filters=[
        {
            'name': 'region'|'ec2-instance-family'|'commitment'|'upfront'|'term'|'savings-plan-type'|'payment-option'|'start'|'end',
            'values': [
                'string',
            ]
        },
    ]
)
type savingsPlanArns:

list

param savingsPlanArns:

The Amazon Resource Names (ARN) of the Savings Plans.

  • (string) --

type savingsPlanIds:

list

param savingsPlanIds:

The IDs of the Savings Plans.

  • (string) --

type nextToken:

string

param nextToken:

The token for the next page of results.

type maxResults:

integer

param maxResults:

The maximum number of results to return with a single call. To retrieve additional results, make another call with the returned token value.

type states:

list

param states:

The states.

  • (string) --

type filters:

list

param filters:

The filters.

  • (dict) --

    Information about a filter.

    • name (string) --

      The filter name.

    • values (list) --

      The filter value.

      • (string) --

rtype:

dict

returns:

Response Syntax

{
    'savingsPlans': [
        {
            'offeringId': 'string',
            'savingsPlanId': 'string',
            'savingsPlanArn': 'string',
            'description': 'string',
            'start': 'string',
            'end': 'string',
            'state': 'payment-pending'|'payment-failed'|'active'|'retired'|'queued'|'queued-deleted',
            'region': 'string',
            'ec2InstanceFamily': 'string',
            'savingsPlanType': 'Compute'|'EC2Instance',
            'paymentOption': 'All Upfront'|'Partial Upfront'|'No Upfront',
            'productTypes': [
                'EC2'|'Fargate'|'Lambda',
            ],
            'currency': 'CNY'|'USD',
            'commitment': 'string',
            'upfrontPaymentAmount': 'string',
            'recurringPaymentAmount': 'string',
            'termDurationInSeconds': 123,
            'tags': {
                'string': 'string'
            }
        },
    ],
    'nextToken': 'string'
}

Response Structure

  • (dict) --

    • savingsPlans (list) --

      Information about the Savings Plans.

      • (dict) --

        Information about a Savings Plan.

        • offeringId (string) --

          The ID of the offering.

        • savingsPlanId (string) --

          The ID of the Savings Plan.

        • savingsPlanArn (string) --

          The Amazon Resource Name (ARN) of the Savings Plan.

        • description (string) --

          The description.

        • start (string) --

          The start time.

        • end (string) --

          The end time.

        • state (string) --

          The state.

        • region (string) --

          The AWS Region.

        • ec2InstanceFamily (string) --

          The EC2 instance family.

        • savingsPlanType (string) --

          The plan type.

        • paymentOption (string) --

          The payment option.

        • productTypes (list) --

          The product types.

          • (string) --

        • currency (string) --

          The currency.

        • commitment (string) --

          The hourly commitment, in USD.

        • upfrontPaymentAmount (string) --

          The up-front payment amount.

        • recurringPaymentAmount (string) --

          The recurring payment amount.

        • termDurationInSeconds (integer) --

          The duration of the term, in seconds.

        • tags (dict) --

          One or more tags.

          • (string) --

            • (string) --

    • nextToken (string) --

      The token to use to retrieve the next page of results. This value is null when there are no more results to return.