- Newest
- Most votes
- Most comments
Hello,
By VPC instance, do you mean EC2 instances?
You're not actually charged for VPC it's free of charge, but AWS will charge for resources that you create inside the VPC like the NAT gateway, VPC endpoint, EC2 instances, Public IPv4 address etc.
I would recommend to review your AWS bills and use cost explorer to look for specific resources or activities that are incurring costs under AWS Billing and cost management console. This might help you and should be able to identify the source of the unexpected charges you're incurring for the resources in the VPC.
Review the CloudTrail logs to identify who created the EC2 instances and when.
A VPC, Virtual Private Cloud, is a virtual network, similar in purpose to a network you could have at an office or in your home. When you create an AWS account, a default VPC will be created automatically by AWS in every AWS region that is enabled by default. If you later enable other, opt-in regions, a default VPC will be created in each region as you enable it.
Neither the default VPCs that get created automatically nor any that you might create yourself have any cost in themselves. Just sitting there, with nothing connected to them, VPCs are completely free. It's only when resources are created in the VPCs that costs may start to accrue. For example, you might have placed your API Gateway and Lambda function in one of the VPCs. Both kinds of resources would typically be connected to multiple availability zones (AZ) for redundancy and scalability, and if a Lambda invocation in one AZ connected to the API Gateway endpoint in another AZ, the cross-AZ traffic would have a cost associated with it.
AWS doesn't place any billable resources in your VPCs without you telling them to do so. In the above hypothetical situation, you would've chosen to which VPC and subnets to connect the API Gateway endpoints when you created the API Gateway. The same would apply to a Lambda function. A Lambda function can run outside any VPC, but you can also choose to connect it to a VPC, if you want it to connect to resources inside your VPC or to connect to the internet with static IP addresses not shared by other AWS customers.
You can find details on what exactly is incurring costs and how much by opening Cost Explorer, setting the granularity to daily, time period to end 2 days ago (newer data is incomplete and misleading) and start maybe a couple of months ago or whatever time period you want to see, filter the data by "Service" set to "VPC", and finally, select in to group the costs by Usage Type. This level usually gives a good overview of what you're billed for. Cross-AZ traffic, public IP addresses, NAT gateways, VPC endpoint hourly and data processing charges, etc. would all be pretty clearly itemised by the "Usage Type" split.
Relevant content
- asked 2 years ago
- asked 10 months ago
- asked 2 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 5 months ago
- AWS OFFICIALUpdated 3 years ago
- AWS OFFICIALUpdated 5 months ago