AWSBillingConductor

2023/09/05 - AWSBillingConductor - 4 updated api methods

Changes  This release adds support for line item filtering in for the custom line item resource.

CreateCustomLineItem (updated) Link ¶
Changes (request)
{'ChargeDetails': {'LineItemFilters': [{'Attribute': 'LINE_ITEM_TYPE',
                                        'MatchOption': 'NOT_EQUAL',
                                        'Values': ['SAVINGS_PLAN_NEGATION']}]}}

Creates a custom line item that can be used to create a one-time fixed charge that can be applied to a single billing group for the current or previous billing period. The one-time fixed charge is either a fee or discount.

See also: AWS API Documentation

Request Syntax

client.create_custom_line_item(
    ClientToken='string',
    Name='string',
    Description='string',
    BillingGroupArn='string',
    BillingPeriodRange={
        'InclusiveStartBillingPeriod': 'string',
        'ExclusiveEndBillingPeriod': 'string'
    },
    Tags={
        'string': 'string'
    },
    ChargeDetails={
        'Flat': {
            'ChargeValue': 123.0
        },
        'Percentage': {
            'PercentageValue': 123.0,
            'AssociatedValues': [
                'string',
            ]
        },
        'Type': 'CREDIT'|'FEE',
        'LineItemFilters': [
            {
                'Attribute': 'LINE_ITEM_TYPE',
                'MatchOption': 'NOT_EQUAL',
                'Values': [
                    'SAVINGS_PLAN_NEGATION',
                ]
            },
        ]
    }
)
type ClientToken

string

param ClientToken

The token that is needed to support idempotency. Idempotency isn't currently supported, but will be implemented in a future update.

This field is autopopulated if not provided.

type Name

string

param Name

[REQUIRED]

The name of the custom line item.

type Description

string

param Description

[REQUIRED]

The description of the custom line item. This is shown on the Bills page in association with the charge value.

type BillingGroupArn

string

param BillingGroupArn

[REQUIRED]

The Amazon Resource Name (ARN) that references the billing group where the custom line item applies to.

type BillingPeriodRange

dict

param BillingPeriodRange

A time range for which the custom line item is effective.

  • InclusiveStartBillingPeriod (string) -- [REQUIRED]

    The inclusive start billing period that defines a billing period range where a custom line is applied.

  • ExclusiveEndBillingPeriod (string) --

    The inclusive end billing period that defines a billing period range where a custom line is applied.

type Tags

dict

param Tags

A map that contains tag keys and tag values that are attached to a custom line item.

  • (string) --

    • (string) --

type ChargeDetails

dict

param ChargeDetails

[REQUIRED]

A CustomLineItemChargeDetails that describes the charge details for a custom line item.

  • Flat (dict) --

    A CustomLineItemFlatChargeDetails that describes the charge details of a flat custom line item.

    • ChargeValue (float) -- [REQUIRED]

      The custom line item's fixed charge value in USD.

  • Percentage (dict) --

    A CustomLineItemPercentageChargeDetails that describes the charge details of a percentage custom line item.

    • PercentageValue (float) -- [REQUIRED]

      The custom line item's percentage value. This will be multiplied against the combined value of its associated resources to determine its charge value.

    • AssociatedValues (list) --

      A list of resource ARNs to associate to the percentage custom line item.

      • (string) --

  • Type (string) -- [REQUIRED]

    The type of the custom line item that indicates whether the charge is a fee or credit.

  • LineItemFilters (list) --

    A representation of the line item filter.

    • (dict) --

      A representation of the line item filter for your custom line item. You can use line item filters to include or exclude specific resource values from the billing group's total cost. For example, if you create a custom line item and you want to filter out a value, such as Savings Plan discounts, you can update LineItemFilter to exclude it.

      • Attribute (string) -- [REQUIRED]

        The attribute of the line item filter. This specifies what attribute that you can filter on.

      • MatchOption (string) -- [REQUIRED]

        The match criteria of the line item filter. This parameter specifies whether not to include the resource value from the billing group total cost.

      • Values (list) -- [REQUIRED]

        The values of the line item filter. This specifies the values to filter on. Currently, you can only exclude Savings Plan discounts.

        • (string) --

rtype

dict

returns

Response Syntax

{
    'Arn': 'string'
}

Response Structure

  • (dict) --

    • Arn (string) --

      The Amazon Resource Name (ARN) of the created custom line item.

ListCustomLineItemVersions (updated) Link ¶
Changes (response)
{'CustomLineItemVersions': {'ChargeDetails': {'LineItemFilters': [{'Attribute': 'LINE_ITEM_TYPE',
                                                                   'MatchOption': 'NOT_EQUAL',
                                                                   'Values': ['SAVINGS_PLAN_NEGATION']}]}}}

A paginated call to get a list of all custom line item versions.

See also: AWS API Documentation

Request Syntax

client.list_custom_line_item_versions(
    Arn='string',
    MaxResults=123,
    NextToken='string',
    Filters={
        'BillingPeriodRange': {
            'StartBillingPeriod': 'string',
            'EndBillingPeriod': 'string'
        }
    }
)
type Arn

string

param Arn

[REQUIRED]

The Amazon Resource Name (ARN) for the custom line item.

type MaxResults

integer

param MaxResults

The maximum number of custom line item versions to retrieve.

type NextToken

string

param NextToken

The pagination token that's used on subsequent calls to retrieve custom line item versions.

type Filters

dict

param Filters

A ListCustomLineItemVersionsFilter that specifies the billing period range in which the custom line item versions are applied.

  • BillingPeriodRange (dict) --

    The billing period range in which the custom line item version is applied.

    • StartBillingPeriod (string) --

      The inclusive start billing period that defines a billing period range where a custom line item version is applied.

    • EndBillingPeriod (string) --

      The exclusive end billing period that defines a billing period range where a custom line item version is applied.

rtype

dict

returns

Response Syntax

{
    'CustomLineItemVersions': [
        {
            'Name': 'string',
            'ChargeDetails': {
                'Flat': {
                    'ChargeValue': 123.0
                },
                'Percentage': {
                    'PercentageValue': 123.0
                },
                'Type': 'CREDIT'|'FEE',
                'LineItemFilters': [
                    {
                        'Attribute': 'LINE_ITEM_TYPE',
                        'MatchOption': 'NOT_EQUAL',
                        'Values': [
                            'SAVINGS_PLAN_NEGATION',
                        ]
                    },
                ]
            },
            'CurrencyCode': 'USD'|'CNY',
            'Description': 'string',
            'ProductCode': 'string',
            'BillingGroupArn': 'string',
            'CreationTime': 123,
            'LastModifiedTime': 123,
            'AssociationSize': 123,
            'StartBillingPeriod': 'string',
            'EndBillingPeriod': 'string',
            'Arn': 'string',
            'StartTime': 123
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • CustomLineItemVersions (list) --

      A list of CustomLineItemVersionListElements that are received.

      • (dict) --

        A representation of a custom line item version.

        • Name (string) --

          The name of the custom line item.

        • ChargeDetails (dict) --

          A representation of the charge details of a custom line item.

          • Flat (dict) --

            A ListCustomLineItemFlatChargeDetails that describes the charge details of a flat custom line item.

            • ChargeValue (float) --

              The custom line item's fixed charge value in USD.

          • Percentage (dict) --

            A ListCustomLineItemPercentageChargeDetails that describes the charge details of a percentage custom line item.

            • PercentageValue (float) --

              The custom line item's percentage value. This will be multiplied against the combined value of its associated resources to determine its charge value.

          • Type (string) --

            The type of the custom line item that indicates whether the charge is a fee or credit .

          • LineItemFilters (list) --

            A representation of the line item filter.

            • (dict) --

              A representation of the line item filter for your custom line item. You can use line item filters to include or exclude specific resource values from the billing group's total cost. For example, if you create a custom line item and you want to filter out a value, such as Savings Plan discounts, you can update LineItemFilter to exclude it.

              • Attribute (string) --

                The attribute of the line item filter. This specifies what attribute that you can filter on.

              • MatchOption (string) --

                The match criteria of the line item filter. This parameter specifies whether not to include the resource value from the billing group total cost.

              • Values (list) --

                The values of the line item filter. This specifies the values to filter on. Currently, you can only exclude Savings Plan discounts.

                • (string) --

        • CurrencyCode (string) --

          The charge value currency of the custom line item.

        • Description (string) --

          The description of the custom line item.

        • ProductCode (string) --

          The product code that’s associated with the custom line item.

        • BillingGroupArn (string) --

          The Amazon Resource Name (ARN) of the billing group that the custom line item applies to.

        • CreationTime (integer) --

          The time when the custom line item version was created.

        • LastModifiedTime (integer) --

          The most recent time that the custom line item version was modified.

        • AssociationSize (integer) --

          The number of resources that are associated with the custom line item.

        • StartBillingPeriod (string) --

          The start billing period of the custom line item version.

        • EndBillingPeriod (string) --

          The end billing period of the custom line item version.

        • Arn (string) --

          A list of custom line item Amazon Resource Names (ARNs) to retrieve information.

        • StartTime (integer) --

          The inclusive start time.

    • NextToken (string) --

      The pagination token that's used on subsequent calls to retrieve custom line item versions.

ListCustomLineItems (updated) Link ¶
Changes (response)
{'CustomLineItems': {'ChargeDetails': {'LineItemFilters': [{'Attribute': 'LINE_ITEM_TYPE',
                                                            'MatchOption': 'NOT_EQUAL',
                                                            'Values': ['SAVINGS_PLAN_NEGATION']}]}}}

A paginated call to get a list of all custom line items (FFLIs) for the given billing period. If you don't provide a billing period, the current billing period is used.

See also: AWS API Documentation

Request Syntax

client.list_custom_line_items(
    BillingPeriod='string',
    MaxResults=123,
    NextToken='string',
    Filters={
        'Names': [
            'string',
        ],
        'BillingGroups': [
            'string',
        ],
        'Arns': [
            'string',
        ]
    }
)
type BillingPeriod

string

param BillingPeriod

The preferred billing period to get custom line items (FFLIs).

type MaxResults

integer

param MaxResults

The maximum number of billing groups to retrieve.

type NextToken

string

param NextToken

The pagination token that's used on subsequent calls to get custom line items (FFLIs).

type Filters

dict

param Filters

A ListCustomLineItemsFilter that specifies the custom line item names and/or billing group Amazon Resource Names (ARNs) to retrieve FFLI information.

  • Names (list) --

    A list of custom line items to retrieve information.

    • (string) --

  • BillingGroups (list) --

    The billing group Amazon Resource Names (ARNs) to retrieve information.

    • (string) --

  • Arns (list) --

    A list of custom line item ARNs to retrieve information.

    • (string) --

rtype

dict

returns

Response Syntax

{
    'CustomLineItems': [
        {
            'Arn': 'string',
            'Name': 'string',
            'ChargeDetails': {
                'Flat': {
                    'ChargeValue': 123.0
                },
                'Percentage': {
                    'PercentageValue': 123.0
                },
                'Type': 'CREDIT'|'FEE',
                'LineItemFilters': [
                    {
                        'Attribute': 'LINE_ITEM_TYPE',
                        'MatchOption': 'NOT_EQUAL',
                        'Values': [
                            'SAVINGS_PLAN_NEGATION',
                        ]
                    },
                ]
            },
            'CurrencyCode': 'USD'|'CNY',
            'Description': 'string',
            'ProductCode': 'string',
            'BillingGroupArn': 'string',
            'CreationTime': 123,
            'LastModifiedTime': 123,
            'AssociationSize': 123
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • CustomLineItems (list) --

      A list of FreeFormLineItemListElements received.

      • (dict) --

        A representation of a custom line item.

        • Arn (string) --

          The Amazon Resource Names (ARNs) for custom line items.

        • Name (string) --

          The custom line item's name.

        • ChargeDetails (dict) --

          A ListCustomLineItemChargeDetails that describes the charge details of a custom line item.

          • Flat (dict) --

            A ListCustomLineItemFlatChargeDetails that describes the charge details of a flat custom line item.

            • ChargeValue (float) --

              The custom line item's fixed charge value in USD.

          • Percentage (dict) --

            A ListCustomLineItemPercentageChargeDetails that describes the charge details of a percentage custom line item.

            • PercentageValue (float) --

              The custom line item's percentage value. This will be multiplied against the combined value of its associated resources to determine its charge value.

          • Type (string) --

            The type of the custom line item that indicates whether the charge is a fee or credit .

          • LineItemFilters (list) --

            A representation of the line item filter.

            • (dict) --

              A representation of the line item filter for your custom line item. You can use line item filters to include or exclude specific resource values from the billing group's total cost. For example, if you create a custom line item and you want to filter out a value, such as Savings Plan discounts, you can update LineItemFilter to exclude it.

              • Attribute (string) --

                The attribute of the line item filter. This specifies what attribute that you can filter on.

              • MatchOption (string) --

                The match criteria of the line item filter. This parameter specifies whether not to include the resource value from the billing group total cost.

              • Values (list) --

                The values of the line item filter. This specifies the values to filter on. Currently, you can only exclude Savings Plan discounts.

                • (string) --

        • CurrencyCode (string) --

          The custom line item's charge value currency. Only one of the valid values can be used.

        • Description (string) --

          The custom line item's description. This is shown on the Bills page in association with the charge value.

        • ProductCode (string) --

          The product code that's associated with the custom line item.

        • BillingGroupArn (string) --

          The Amazon Resource Name (ARN) that references the billing group where the custom line item applies to.

        • CreationTime (integer) --

          The time created.

        • LastModifiedTime (integer) --

          The most recent time when the custom line item was modified.

        • AssociationSize (integer) --

          The number of resources that are associated to the custom line item.

    • NextToken (string) --

      The pagination token that's used on subsequent calls to get custom line items (FFLIs).

UpdateCustomLineItem (updated) Link ¶
Changes (both)
{'ChargeDetails': {'LineItemFilters': [{'Attribute': 'LINE_ITEM_TYPE',
                                        'MatchOption': 'NOT_EQUAL',
                                        'Values': ['SAVINGS_PLAN_NEGATION']}]}}

Update an existing custom line item in the current or previous billing period.

See also: AWS API Documentation

Request Syntax

client.update_custom_line_item(
    Arn='string',
    Name='string',
    Description='string',
    ChargeDetails={
        'Flat': {
            'ChargeValue': 123.0
        },
        'Percentage': {
            'PercentageValue': 123.0
        },
        'LineItemFilters': [
            {
                'Attribute': 'LINE_ITEM_TYPE',
                'MatchOption': 'NOT_EQUAL',
                'Values': [
                    'SAVINGS_PLAN_NEGATION',
                ]
            },
        ]
    },
    BillingPeriodRange={
        'InclusiveStartBillingPeriod': 'string',
        'ExclusiveEndBillingPeriod': 'string'
    }
)
type Arn

string

param Arn

[REQUIRED]

The ARN of the custom line item to be updated.

type Name

string

param Name

The new name for the custom line item.

type Description

string

param Description

The new line item description of the custom line item.

type ChargeDetails

dict

param ChargeDetails

A ListCustomLineItemChargeDetails containing the new charge details for the custom line item.

  • Flat (dict) --

    An UpdateCustomLineItemFlatChargeDetails that describes the new charge details of a flat custom line item.

    • ChargeValue (float) -- [REQUIRED]

      The custom line item's new fixed charge value in USD.

  • Percentage (dict) --

    An UpdateCustomLineItemPercentageChargeDetails that describes the new charge details of a percentage custom line item.

    • PercentageValue (float) -- [REQUIRED]

      The custom line item's new percentage value. This will be multiplied against the combined value of its associated resources to determine its charge value.

  • LineItemFilters (list) --

    A representation of the line item filter.

    • (dict) --

      A representation of the line item filter for your custom line item. You can use line item filters to include or exclude specific resource values from the billing group's total cost. For example, if you create a custom line item and you want to filter out a value, such as Savings Plan discounts, you can update LineItemFilter to exclude it.

      • Attribute (string) -- [REQUIRED]

        The attribute of the line item filter. This specifies what attribute that you can filter on.

      • MatchOption (string) -- [REQUIRED]

        The match criteria of the line item filter. This parameter specifies whether not to include the resource value from the billing group total cost.

      • Values (list) -- [REQUIRED]

        The values of the line item filter. This specifies the values to filter on. Currently, you can only exclude Savings Plan discounts.

        • (string) --

type BillingPeriodRange

dict

param BillingPeriodRange

The billing period range in which the custom line item request will be applied.

  • InclusiveStartBillingPeriod (string) -- [REQUIRED]

    The inclusive start billing period that defines a billing period range where a custom line is applied.

  • ExclusiveEndBillingPeriod (string) --

    The inclusive end billing period that defines a billing period range where a custom line is applied.

rtype

dict

returns

Response Syntax

{
    'Arn': 'string',
    'BillingGroupArn': 'string',
    'Name': 'string',
    'Description': 'string',
    'ChargeDetails': {
        'Flat': {
            'ChargeValue': 123.0
        },
        'Percentage': {
            'PercentageValue': 123.0
        },
        'Type': 'CREDIT'|'FEE',
        'LineItemFilters': [
            {
                'Attribute': 'LINE_ITEM_TYPE',
                'MatchOption': 'NOT_EQUAL',
                'Values': [
                    'SAVINGS_PLAN_NEGATION',
                ]
            },
        ]
    },
    'LastModifiedTime': 123,
    'AssociationSize': 123
}

Response Structure

  • (dict) --

    • Arn (string) --

      The ARN of the successfully updated custom line item.

    • BillingGroupArn (string) --

      The ARN of the billing group that the custom line item is applied to.

    • Name (string) --

      The name of the successfully updated custom line item.

    • Description (string) --

      The description of the successfully updated custom line item.

    • ChargeDetails (dict) --

      A ListCustomLineItemChargeDetails containing the charge details of the successfully updated custom line item.

      • Flat (dict) --

        A ListCustomLineItemFlatChargeDetails that describes the charge details of a flat custom line item.

        • ChargeValue (float) --

          The custom line item's fixed charge value in USD.

      • Percentage (dict) --

        A ListCustomLineItemPercentageChargeDetails that describes the charge details of a percentage custom line item.

        • PercentageValue (float) --

          The custom line item's percentage value. This will be multiplied against the combined value of its associated resources to determine its charge value.

      • Type (string) --

        The type of the custom line item that indicates whether the charge is a fee or credit .

      • LineItemFilters (list) --

        A representation of the line item filter.

        • (dict) --

          A representation of the line item filter for your custom line item. You can use line item filters to include or exclude specific resource values from the billing group's total cost. For example, if you create a custom line item and you want to filter out a value, such as Savings Plan discounts, you can update LineItemFilter to exclude it.

          • Attribute (string) --

            The attribute of the line item filter. This specifies what attribute that you can filter on.

          • MatchOption (string) --

            The match criteria of the line item filter. This parameter specifies whether not to include the resource value from the billing group total cost.

          • Values (list) --

            The values of the line item filter. This specifies the values to filter on. Currently, you can only exclude Savings Plan discounts.

            • (string) --

    • LastModifiedTime (integer) --

      The most recent time when the custom line item was modified.

    • AssociationSize (integer) --

      The number of resources that are associated to the custom line item.