AWS charging me for VPC

0

Hi , I created an AWS account in December last year for the purposes of creating a website hosted on aws with lambdas as a backend. The site is hosted on S3 and we are using API gateway for the lambdas. I have never went near VPC and the lambdas were deployed on AWS around January so was the website. Suddenly around April I started getting charged for VPC. I found VPC instances (I just deleted them) why were they created? Also the cost center still estimates charges for VPC. Why am I getting charged for a service I never interacted with until now.

2 Answers
0

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.

profile picture
EXPERT
answered 10 months ago
profile pictureAWS
EXPERT
reviewed 10 months ago
0

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.

EXPERT
answered 10 months ago
profile pictureAWS
EXPERT
reviewed 10 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions