

# Create Networking Flexible Cost Allocation resources with Amazon CloudFormation
<a name="networking-flex-cost-allocation-cfn"></a>

Networking Flexible Cost Allocation (FCA) is integrated with Amazon CloudFormation (Amazon CloudFormation), a service that helps you model and set up your Amazon resources so that you can spend less time creating and managing your resources and infrastructure. You create a template that describes the FCA policies and associations that you want, and Amazon CloudFormation provisions and configures those resources for you.

## FCA and Amazon CloudFormation templates
<a name="networking-flex-cost-allocation-cfn-templates"></a>

FCA provides the following Amazon CloudFormation resource types:
+ `AWS::EC2::FcaPolicy` – Creates a Networking Flexible Cost Allocation policy.
+ `AWS::EC2::FcaPolicyAssociation` – Associates a policy with a resource, or with an account, VPC, or subnet scope.

For the properties, return values, and syntax of each resource type, see [Amazon EC2 resource type reference](https://docs.amazonaws.cn/AWSCloudFormation/latest/TemplateReference/AWS_EC2.html) in the *Amazon CloudFormation User Guide*.

To create an association, the IAM principal that deploys the stack also needs permission to describe the associated resource, for example `ec2:DescribeNatGateways` for a NAT gateway.

For complete examples that create policies with Amazon CloudFormation alongside the console and the Amazon CLI, see the following use-case topics:
+ [Allocate EC2 instance data transfer](networking-flex-cost-allocation-ec2.md)
+ [Allocate NAT gateway costs](networking-flex-cost-allocation-natgw.md)
+ [Allocate VPC peering data transfer](networking-flex-cost-allocation-pcx.md)

## Learn more about Amazon CloudFormation
<a name="networking-flex-cost-allocation-cfn-learn-more"></a>

To learn more about Amazon CloudFormation, see the following resources:
+ [Amazon CloudFormation](https://www.amazonaws.cn/cloudformation/)
+ [Amazon CloudFormation User Guide](https://docs.amazonaws.cn/AWSCloudFormation/latest/UserGuide/Welcome.html)
+ [Amazon CloudFormation command line interface User Guide](https://docs.amazonaws.cn/cloudformation-cli/latest/userguide/what-is-cloudformation-cli.html)