EC2 / Client / modify_networking_flex_cost_allocation_policy

modify_networking_flex_cost_allocation_policy

EC2.Client.modify_networking_flex_cost_allocation_policy(**kwargs)

Modifies a flex cost allocation policy. Changing a policy document or ShowBackEnabled creates a new version of the policy. Changing only the description doesn’t create a new version.

A policy can have up to 100 versions. Versions are never removed, so after a policy reaches 100 versions, you can’t change its policy document or ShowBackEnabled. Policies that are managed by a declarative policy aren’t subject to this limit.

See also: AWS API Documentation

Request Syntax

response = client.modify_networking_flex_cost_allocation_policy(
    FcaPolicyId='string',
    NatFcaPolicyDocument={
        'ReportingGranularity': [
            'eni'|'ec2'|'subnet'|'vpc'|'account'|'peering-id'|'cidr',
        ],
        'Dimensions': [
            'data-transfer'|'data-processing',
        ],
        'CidrRangeSpecifications': {
            'PrefixesType': 'string',
            'Prefixes': [
                {
                    'CidrRange': 'string',
                    'CidrLabel': 'string'
                },
            ]
        }
    },
    InstanceFcaPolicyDocument={
        'ReportingGranularity': [
            'eni'|'ec2'|'subnet'|'vpc'|'account'|'peering-id'|'cidr',
        ],
        'Dimensions': [
            'data-transfer'|'data-processing',
        ],
        'CidrRangeSpecifications': {
            'PrefixesType': 'string',
            'Prefixes': [
                {
                    'CidrRange': 'string',
                    'CidrLabel': 'string'
                },
            ]
        }
    },
    PcxFcaPolicyDocument={
        'ReportingGranularity': [
            'eni'|'ec2'|'subnet'|'vpc'|'account'|'peering-id'|'cidr',
        ],
        'Dimensions': [
            'data-transfer'|'data-processing',
        ],
        'CidrRangeSpecifications': {
            'PrefixesType': 'string',
            'Prefixes': [
                {
                    'CidrRange': 'string',
                    'CidrLabel': 'string'
                },
            ]
        }
    },
    ShowBackEnabled=True|False,
    Description='string',
    ClientToken='string',
    DryRun=True|False
)
Parameters:
  • FcaPolicyId (string) –

    [REQUIRED]

    The ID of the flex cost allocation policy to modify. This parameter is required.

  • NatFcaPolicyDocument (dict) –

    The updated policy document that defines cost allocation for NAT gateways.

    • ReportingGranularity (list) – [REQUIRED]

      The resource granularity level at which networking costs are allocated. This parameter is required. Specify exactly one value. Valid values are eni, ec2, subnet, vpc, account, and cidr.

      • (string) –

        The resource granularity level at which networking costs are allocated. Valid values are eni, ec2, subnet, vpc, account, peering-id, and cidr.

        Which values you can use depends on the policy document. peering-id is valid only in a PcxFcaPolicyDocument.

    • Dimensions (list) – [REQUIRED]

      The cost dimensions to report. This parameter is required. Valid values are data-transfer and data-processing.

      • (string) –

        A cost dimension used for allocation. Valid values are data-transfer and data-processing. data-processing is valid only in a NatFcaPolicyDocument.

    • CidrRangeSpecifications (dict) –

      The CIDR range mappings to use for cost allocation. Specify this value when ReportingGranularity is cidr, and omit it otherwise.

      • PrefixesType (string) – [REQUIRED]

        The type of prefixes to use. This parameter is required. Valid values are source-prefixes and destination-prefixes.

      • Prefixes (list) – [REQUIRED]

        The CIDR range to label mappings. You can specify from 1 to 100 mappings. This parameter is required.

        • (dict) –

          Maps a CIDR range to a label for cost allocation reporting.

          • CidrRange (string) – [REQUIRED]

            The CIDR range. This parameter is required.

          • CidrLabel (string) – [REQUIRED]

            The label to assign to the CIDR range. The label can be up to 64 characters long. It can contain letters, numbers, hyphens ( -), and underscores ( _), and must start with a letter or a number. This parameter is required.

  • InstanceFcaPolicyDocument (dict) –

    The updated policy document that defines cost allocation for EC2 instances.

    • ReportingGranularity (list) – [REQUIRED]

      The resource granularity level at which networking costs are allocated. This parameter is required. Specify exactly one value. Valid values are eni, ec2, subnet, vpc, account, and cidr.

      • (string) –

        The resource granularity level at which networking costs are allocated. Valid values are eni, ec2, subnet, vpc, account, peering-id, and cidr.

        Which values you can use depends on the policy document. peering-id is valid only in a PcxFcaPolicyDocument.

    • Dimensions (list) – [REQUIRED]

      The cost dimensions to report. This parameter is required. The only valid value is data-transfer.

      • (string) –

        A cost dimension used for allocation. Valid values are data-transfer and data-processing. data-processing is valid only in a NatFcaPolicyDocument.

    • CidrRangeSpecifications (dict) –

      The CIDR range mappings to use for cost allocation. Specify this value when ReportingGranularity is cidr, and omit it otherwise.

      • PrefixesType (string) – [REQUIRED]

        The type of prefixes to use. This parameter is required. Valid values are source-prefixes and destination-prefixes.

      • Prefixes (list) – [REQUIRED]

        The CIDR range to label mappings. You can specify from 1 to 100 mappings. This parameter is required.

        • (dict) –

          Maps a CIDR range to a label for cost allocation reporting.

          • CidrRange (string) – [REQUIRED]

            The CIDR range. This parameter is required.

          • CidrLabel (string) – [REQUIRED]

            The label to assign to the CIDR range. The label can be up to 64 characters long. It can contain letters, numbers, hyphens ( -), and underscores ( _), and must start with a letter or a number. This parameter is required.

  • PcxFcaPolicyDocument (dict) –

    The updated policy document that defines cost allocation for Amazon VPC peering connections.

    • ReportingGranularity (list) – [REQUIRED]

      The resource granularity level at which networking costs are allocated. This parameter is required. Specify exactly one value. Valid values are eni, ec2, subnet, vpc, account, peering-id, and cidr.

      • (string) –

        The resource granularity level at which networking costs are allocated. Valid values are eni, ec2, subnet, vpc, account, peering-id, and cidr.

        Which values you can use depends on the policy document. peering-id is valid only in a PcxFcaPolicyDocument.

    • Dimensions (list) – [REQUIRED]

      The cost dimensions to report. This parameter is required. The only valid value is data-transfer.

      • (string) –

        A cost dimension used for allocation. Valid values are data-transfer and data-processing. data-processing is valid only in a NatFcaPolicyDocument.

    • CidrRangeSpecifications (dict) –

      The CIDR range mappings to use for cost allocation. Specify this value when ReportingGranularity is cidr, and omit it otherwise.

      • PrefixesType (string) – [REQUIRED]

        The type of prefixes to use. This parameter is required. Valid values are source-prefixes and destination-prefixes.

      • Prefixes (list) – [REQUIRED]

        The CIDR range to label mappings. You can specify from 1 to 100 mappings. This parameter is required.

        • (dict) –

          Maps a CIDR range to a label for cost allocation reporting.

          • CidrRange (string) – [REQUIRED]

            The CIDR range. This parameter is required.

          • CidrLabel (string) – [REQUIRED]

            The label to assign to the CIDR range. The label can be up to 64 characters long. It can contain letters, numbers, hyphens ( -), and underscores ( _), and must start with a letter or a number. This parameter is required.

  • ShowBackEnabled (boolean) – Specifies whether showback reporting is enabled for the policy. If you omit this parameter, the current setting is unchanged.

  • Description (string) – A description for the policy. The description can be up to 1024 characters long.

  • ClientToken (string) –

    Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see Ensuring idempotency.

    This field is autopopulated if not provided.

  • DryRun (boolean) – Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

Return type:

dict

Returns:

Response Syntax

{
    'FcaPolicyId': 'string',
    'UpdatedAt': datetime(2015, 1, 1),
    'Version': 123,
    'VersionExpectedEffectiveAt': datetime(2015, 1, 1)
}

Response Structure

  • (dict) –

    • FcaPolicyId (string) –

      The ID of the flex cost allocation policy.

    • UpdatedAt (datetime) –

      The date and time when the policy was updated.

    • Version (integer) –

      The version number of the policy that this modification created.

    • VersionExpectedEffectiveAt (datetime) –

      The date and time when the new version of the policy is expected to apply to network traffic.