AWS Billing and Cost Management Pricing Calculator

2025/03/27 - AWS Billing and Cost Management Pricing Calculator - 6 updated api methods

Changes  Added standaloneAccountRateTypeSelections for GetPreferences and UpdatePreferences APIs. Added STALE enum value to status attribute in GetBillScenario and UpdateBillScenario APIs.

CreateBillScenario (updated) Link ¶
Changes (response)
{'status': {'STALE'}}

Creates a new bill scenario to model potential changes to Amazon Web Services usage and costs.

See also: AWS API Documentation

Request Syntax

client.create_bill_scenario(
    name='string',
    clientToken='string',
    tags={
        'string': 'string'
    }
)
type name:

string

param name:

[REQUIRED]

A descriptive name for the bill scenario.

type clientToken:

string

param clientToken:

A unique, case-sensitive identifier to ensure idempotency of the request.

This field is autopopulated if not provided.

type tags:

dict

param tags:

The tags to apply to the bill scenario.

  • (string) --

    • (string) --

rtype:

dict

returns:

Response Syntax

{
    'id': 'string',
    'name': 'string',
    'billInterval': {
        'start': datetime(2015, 1, 1),
        'end': datetime(2015, 1, 1)
    },
    'status': 'READY'|'LOCKED'|'FAILED'|'STALE',
    'createdAt': datetime(2015, 1, 1),
    'expiresAt': datetime(2015, 1, 1),
    'failureMessage': 'string'
}

Response Structure

  • (dict) --

    • id (string) --

      The unique identifier for the created bill scenario.

    • name (string) --

      The name of the created bill scenario.

    • billInterval (dict) --

      The time period covered by the bill scenario.

      • start (datetime) --

        The start date and time of the interval.

      • end (datetime) --

        The end date and time of the interval.

    • status (string) --

      The current status of the bill scenario.

    • createdAt (datetime) --

      The timestamp when the bill scenario was created.

    • expiresAt (datetime) --

      The timestamp when the bill scenario will expire.

    • failureMessage (string) --

      An error message if the bill scenario creation failed.

GetBillScenario (updated) Link ¶
Changes (response)
{'status': {'STALE'}}

Retrieves details of a specific bill scenario.

See also: AWS API Documentation

Request Syntax

client.get_bill_scenario(
    identifier='string'
)
type identifier:

string

param identifier:

[REQUIRED]

The unique identifier of the bill scenario to retrieve.

rtype:

dict

returns:

Response Syntax

{
    'id': 'string',
    'name': 'string',
    'billInterval': {
        'start': datetime(2015, 1, 1),
        'end': datetime(2015, 1, 1)
    },
    'status': 'READY'|'LOCKED'|'FAILED'|'STALE',
    'createdAt': datetime(2015, 1, 1),
    'expiresAt': datetime(2015, 1, 1),
    'failureMessage': 'string'
}

Response Structure

  • (dict) --

    • id (string) --

      The unique identifier of the retrieved bill scenario.

    • name (string) --

      The name of the retrieved bill scenario.

    • billInterval (dict) --

      The time period covered by the bill scenario.

      • start (datetime) --

        The start date and time of the interval.

      • end (datetime) --

        The end date and time of the interval.

    • status (string) --

      The current status of the bill scenario.

    • createdAt (datetime) --

      The timestamp when the bill scenario was created.

    • expiresAt (datetime) --

      The timestamp when the bill scenario will expire.

    • failureMessage (string) --

      An error message if the bill scenario retrieval failed.

GetPreferences (updated) Link ¶
Changes (response)
{'standaloneAccountRateTypeSelections': ['BEFORE_DISCOUNTS | AFTER_DISCOUNTS']}

Retrieves the current preferences for Pricing Calculator.

See also: AWS API Documentation

Request Syntax

client.get_preferences()
rtype:

dict

returns:

Response Syntax

{
    'managementAccountRateTypeSelections': [
        'BEFORE_DISCOUNTS'|'AFTER_DISCOUNTS',
    ],
    'memberAccountRateTypeSelections': [
        'BEFORE_DISCOUNTS'|'AFTER_DISCOUNTS',
    ],
    'standaloneAccountRateTypeSelections': [
        'BEFORE_DISCOUNTS'|'AFTER_DISCOUNTS',
    ]
}

Response Structure

  • (dict) --

    • managementAccountRateTypeSelections (list) --

      The preferred rate types for the management account.

      • (string) --

    • memberAccountRateTypeSelections (list) --

      The preferred rate types for member accounts.

      • (string) --

    • standaloneAccountRateTypeSelections (list) --

      The preferred rate types for a standalone account.

      • (string) --

ListBillScenarios (updated) Link ¶
Changes (response)
{'items': {'status': {'STALE'}}}

Lists all bill scenarios for the account.

See also: AWS API Documentation

Request Syntax

client.list_bill_scenarios(
    filters=[
        {
            'name': 'STATUS'|'NAME',
            'values': [
                'string',
            ],
            'matchOption': 'EQUALS'|'STARTS_WITH'|'CONTAINS'
        },
    ],
    createdAtFilter={
        'afterTimestamp': datetime(2015, 1, 1),
        'beforeTimestamp': datetime(2015, 1, 1)
    },
    expiresAtFilter={
        'afterTimestamp': datetime(2015, 1, 1),
        'beforeTimestamp': datetime(2015, 1, 1)
    },
    nextToken='string',
    maxResults=123
)
type filters:

list

param filters:

Filters to apply to the list of bill scenarios.

  • (dict) --

    Represents a filter for listing bill scenarios.

    • name (string) -- [REQUIRED]

      The name of the filter attribute.

    • values (list) -- [REQUIRED]

      The values to filter by.

      • (string) --

    • matchOption (string) --

      The match option for the filter (e.g., equals, contains).

type createdAtFilter:

dict

param createdAtFilter:

Filter bill scenarios based on the creation date.

  • afterTimestamp (datetime) --

    Include results after this timestamp.

  • beforeTimestamp (datetime) --

    Include results before this timestamp.

type expiresAtFilter:

dict

param expiresAtFilter:

Filter bill scenarios based on the expiration date.

  • afterTimestamp (datetime) --

    Include results after this timestamp.

  • beforeTimestamp (datetime) --

    Include results before this timestamp.

type nextToken:

string

param nextToken:

A token to retrieve the next page of results.

type maxResults:

integer

param maxResults:

The maximum number of results to return per page.

rtype:

dict

returns:

Response Syntax

{
    'items': [
        {
            'id': 'string',
            'name': 'string',
            'billInterval': {
                'start': datetime(2015, 1, 1),
                'end': datetime(2015, 1, 1)
            },
            'status': 'READY'|'LOCKED'|'FAILED'|'STALE',
            'createdAt': datetime(2015, 1, 1),
            'expiresAt': datetime(2015, 1, 1),
            'failureMessage': 'string'
        },
    ],
    'nextToken': 'string'
}

Response Structure

  • (dict) --

    • items (list) --

      The list of bill scenarios for the account.

      • (dict) --

        Provides a summary of a bill scenario.

        • id (string) --

          The unique identifier of the bill scenario.

        • name (string) --

          The name of the bill scenario.

        • billInterval (dict) --

          The time period covered by the bill scenario.

          • start (datetime) --

            The start date and time of the interval.

          • end (datetime) --

            The end date and time of the interval.

        • status (string) --

          The current status of the bill scenario.

        • createdAt (datetime) --

          The timestamp when the bill scenario was created.

        • expiresAt (datetime) --

          The timestamp when the bill scenario will expire.

        • failureMessage (string) --

          An error message if the bill scenario creation or processing failed.

    • nextToken (string) --

      A token to retrieve the next page of results, if any.

UpdateBillScenario (updated) Link ¶
Changes (response)
{'status': {'STALE'}}

Updates an existing bill scenario.

See also: AWS API Documentation

Request Syntax

client.update_bill_scenario(
    identifier='string',
    name='string',
    expiresAt=datetime(2015, 1, 1)
)
type identifier:

string

param identifier:

[REQUIRED]

The unique identifier of the bill scenario to update.

type name:

string

param name:

The new name for the bill scenario.

type expiresAt:

datetime

param expiresAt:

The new expiration date for the bill scenario.

rtype:

dict

returns:

Response Syntax

{
    'id': 'string',
    'name': 'string',
    'billInterval': {
        'start': datetime(2015, 1, 1),
        'end': datetime(2015, 1, 1)
    },
    'status': 'READY'|'LOCKED'|'FAILED'|'STALE',
    'createdAt': datetime(2015, 1, 1),
    'expiresAt': datetime(2015, 1, 1),
    'failureMessage': 'string'
}

Response Structure

  • (dict) --

    • id (string) --

      The unique identifier of the updated bill scenario.

    • name (string) --

      The updated name of the bill scenario.

    • billInterval (dict) --

      The time period covered by the updated bill scenario.

      • start (datetime) --

        The start date and time of the interval.

      • end (datetime) --

        The end date and time of the interval.

    • status (string) --

      The current status of the updated bill scenario.

    • createdAt (datetime) --

      The timestamp when the bill scenario was originally created.

    • expiresAt (datetime) --

      The updated expiration timestamp for the bill scenario.

    • failureMessage (string) --

      An error message if the bill scenario update failed.

UpdatePreferences (updated) Link ¶
Changes (both)
{'standaloneAccountRateTypeSelections': ['BEFORE_DISCOUNTS | AFTER_DISCOUNTS']}

Updates the preferences for Pricing Calculator.

See also: AWS API Documentation

Request Syntax

client.update_preferences(
    managementAccountRateTypeSelections=[
        'BEFORE_DISCOUNTS'|'AFTER_DISCOUNTS',
    ],
    memberAccountRateTypeSelections=[
        'BEFORE_DISCOUNTS'|'AFTER_DISCOUNTS',
    ],
    standaloneAccountRateTypeSelections=[
        'BEFORE_DISCOUNTS'|'AFTER_DISCOUNTS',
    ]
)
type managementAccountRateTypeSelections:

list

param managementAccountRateTypeSelections:

The updated preferred rate types for the management account.

  • (string) --

type memberAccountRateTypeSelections:

list

param memberAccountRateTypeSelections:

The updated preferred rate types for member accounts.

  • (string) --

type standaloneAccountRateTypeSelections:

list

param standaloneAccountRateTypeSelections:

The updated preferred rate types for a standalone account.

  • (string) --

rtype:

dict

returns:

Response Syntax

{
    'managementAccountRateTypeSelections': [
        'BEFORE_DISCOUNTS'|'AFTER_DISCOUNTS',
    ],
    'memberAccountRateTypeSelections': [
        'BEFORE_DISCOUNTS'|'AFTER_DISCOUNTS',
    ],
    'standaloneAccountRateTypeSelections': [
        'BEFORE_DISCOUNTS'|'AFTER_DISCOUNTS',
    ]
}

Response Structure

  • (dict) --

    • managementAccountRateTypeSelections (list) --

      The updated preferred rate types for the management account.

      • (string) --

    • memberAccountRateTypeSelections (list) --

      The updated preferred rate types for member accounts.

      • (string) --

    • standaloneAccountRateTypeSelections (list) --

      The updated preferred rate types for a standalone account.

      • (string) --