Skip to content

EC2  >  Operations  >  create_networking_flex_cost_allocation_policy

create_networking_flex_cost_allocation_policy

Operation

create_networking_flex_cost_allocation_policy async

create_networking_flex_cost_allocation_policy(*, plugins: list[Plugin] | None = None, **kwargs: Unpack[CreateNetworkingFlexCostAllocationPolicyInputDict]) -> CreateNetworkingFlexCostAllocationPolicyOutput

Creates a flex cost allocation policy for Networking Flexible Cost Allocation (FCA), a feature of Amazon Virtual Private Cloud (Amazon VPC). The policy allocates the charges of a shared networking resource at the reporting granularity that you specify. You can create a policy for one of the following resource types: NAT gateways, Amazon VPC peering connections, or EC2 instances. Policies can allocate data transfer charges for all three types, and data processing charges for NAT gateways.

You can have up to 100 policies per account in each Amazon Web Services Region, plus one additional policy per network resource type created by a declarative policy, for a maximum of 103 policies in an Amazon Web Services Region.

Parameters:

Name Type Description Default
plugins list[Plugin] | None

A list of callables that modify the configuration dynamically. Changes made by these plugins only apply for the duration of the operation execution and will not affect any other operation invocations.

None

Returns:

Type Description
CreateNetworkingFlexCostAllocationPolicyOutput

An instance of CreateNetworkingFlexCostAllocationPolicyOutput.

Input

Pass the input fields as keyword arguments, or pass a model or dictionary as the first positional argument. Pass plugins separately as a keyword argument.

Model

CreateNetworkingFlexCostAllocationPolicyInput dataclass

Bases: _SerdeShape

Dataclass for CreateNetworkingFlexCostAllocationPolicyInput structure.

Attributes
client_token class-attribute instance-attribute
client_token: str | None = ...

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.

description class-attribute instance-attribute
description: str | None = ...

A description for the policy. The description can be up to 1024 characters long.

dry_run class-attribute instance-attribute
dry_run: bool | None = ...

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.

instance_fca_policy_document class-attribute instance-attribute
instance_fca_policy_document: InstanceFlexCostAllocationPolicyDocument | None = ...

The policy document that defines cost allocation for EC2 instances. Provide this document when NetworkResourceType is ec2.

nat_fca_policy_document class-attribute instance-attribute
nat_fca_policy_document: NatFlexCostAllocationPolicyDocument | None = ...

The policy document that defines cost allocation for NAT gateways. Provide this document when NetworkResourceType is natgw.

network_resource_type class-attribute instance-attribute
network_resource_type: str | None = ...

The type of network resource that the policy applies to. This parameter is required. Valid values are natgw (NAT gateway), pcx (Amazon VPC peering connection), and ec2 (EC2 instance).

Specify the policy document that matches the resource type: NatFcaPolicyDocument for natgw, InstanceFcaPolicyDocument for ec2, or PcxFcaPolicyDocument for pcx. Don't specify a policy document for a different resource type.

pcx_fca_policy_document class-attribute instance-attribute
pcx_fca_policy_document: PcxFlexCostAllocationPolicyDocument | None = ...

The policy document that defines cost allocation for Amazon VPC peering connections. Provide this document when NetworkResourceType is pcx.

show_back_enabled class-attribute instance-attribute
show_back_enabled: bool | None = ...

Specifies whether showback reporting is enabled for the policy.

Default: true

tag_specifications class-attribute instance-attribute
tag_specifications: list[TagSpecification] | None = ...

The tags to assign to the policy.

Dictionaries

CreateNetworkingFlexCostAllocationPolicyInputDict

Bases: TypedDict

Dictionary form of CreateNetworkingFlexCostAllocationPolicyInput.

Attributes
client_token instance-attribute
client_token: str | None

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.

description instance-attribute
description: str | None

A description for the policy. The description can be up to 1024 characters long.

dry_run instance-attribute
dry_run: bool | None

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.

instance_fca_policy_document instance-attribute

The policy document that defines cost allocation for EC2 instances. Provide this document when NetworkResourceType is ec2.

nat_fca_policy_document instance-attribute

The policy document that defines cost allocation for NAT gateways. Provide this document when NetworkResourceType is natgw.

network_resource_type instance-attribute
network_resource_type: Required[str]

The type of network resource that the policy applies to. This parameter is required. Valid values are natgw (NAT gateway), pcx (Amazon VPC peering connection), and ec2 (EC2 instance).

Specify the policy document that matches the resource type: NatFcaPolicyDocument for natgw, InstanceFcaPolicyDocument for ec2, or PcxFcaPolicyDocument for pcx. Don't specify a policy document for a different resource type.

pcx_fca_policy_document instance-attribute

The policy document that defines cost allocation for Amazon VPC peering connections. Provide this document when NetworkResourceType is pcx.

show_back_enabled instance-attribute
show_back_enabled: bool | None

Specifies whether showback reporting is enabled for the policy.

Default: true

tag_specifications instance-attribute
tag_specifications: Sequence[TagSpecification | TagSpecificationDict] | None

The tags to assign to the policy.

Output

CreateNetworkingFlexCostAllocationPolicyOutput dataclass

Bases: _SerdeShape

Dataclass for CreateNetworkingFlexCostAllocationPolicyOutput structure.

Attributes

created_at class-attribute instance-attribute
created_at: datetime | None = ...

The date and time when the policy was created.

expected_effective_at class-attribute instance-attribute
expected_effective_at: datetime | None = ...

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

fca_policy_arn class-attribute instance-attribute
fca_policy_arn: str | None = ...

The Amazon Resource Name (ARN) of the flex cost allocation policy.

fca_policy_id class-attribute instance-attribute
fca_policy_id: str | None = ...

The ID of the flex cost allocation policy.

response_metadata class-attribute instance-attribute
response_metadata: ResponseMetadata = ...

Metadata about the response that produced this output. Use this to recover the request identifiers a service's support team needs in order to investigate a call. Members of the metadata are individually optional.