BillingConductor / Client / create_custom_line_item

create_custom_line_item#

BillingConductor.Client.create_custom_line_item(**kwargs)#

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

response = 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',
                ]
            },
        ]
    },
    AccountId='string'
)
Parameters:
  • ClientToken (string) –

    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.

  • Name (string) –

    [REQUIRED]

    The name of the custom line item.

  • Description (string) –

    [REQUIRED]

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

  • BillingGroupArn (string) –

    [REQUIRED]

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

  • BillingPeriodRange (dict) –

    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.

  • Tags (dict) –

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

    • (string) –

      • (string) –

  • ChargeDetails (dict) –

    [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) –

  • AccountId (string) – The Amazon Web Services account in which this custom line item will be applied to.

Return type:

dict

Returns:

Response Syntax

{
    'Arn': 'string'
}

Response Structure

  • (dict) –

    • Arn (string) –

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

Exceptions