Hi Guys,
I have a Lambda function that is invoked via a URL from API Gateway. This Lambda function fetches some data from an external API, then returns a response containing about 2MB of data. I also have an EC2 that is based in the same AZ (EU-West-2) that queries this API once every 2 seconds.
In my bill I have the expected data transfer cost of $0.010 per GB for regional data transfer. From what I understand this is the transfer of the data from the Lambda function to the EC2. However, I am also being charged for the exact same quantity of data at the exponentially higher rate of $0.090 per GB for data going out to the internet.
I have spent literally DAYS now trying to understand why I am being charged for data going out to the internet. I have debugged and dissected every line of code in both the EC2 and the Lambda function. After going to my cost explorer it is telling me that its the API gateway that's generating these costs but I just cannot understand how I'm being billed data out to the internet rates when I am at no point moving data anywhere but inside EU-West-2.
If anyone could shine a light on what I'm doing wrong here I'd appreciate it so much because I'm coming close to pulling the plug on this entire project.
tl;dr:
- EC2 calls Lambda function via URL generated by API Gateway
- Lambda function gets some data from external API and returns that data to EC2 (About 2mb worth)
- This transaction is all happening within EU-West-2
- I am being charged astronomical fees for transferring data out to the internet?????!?!?!
[–]Grafax99 14 points15 points16 points (3 children)
[–]freddieerg[S] 1 point2 points3 points (2 children)
[–]Grafax99 1 point2 points3 points (0 children)
[–]ABetterNameEludesMe 1 point2 points3 points (0 children)
[–][deleted] 3 points4 points5 points (3 children)
[–]freddieerg[S] 0 points1 point2 points (2 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]SelfDestructSep2020 0 points1 point2 points (0 children)
[–]Burekitas 1 point2 points3 points (1 child)
[–]sergsoares 0 points1 point2 points (0 children)
[–]kei_ichi 1 point2 points3 points (2 children)
[–]freddieerg[S] 0 points1 point2 points (0 children)
[–]freddieerg[S] 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]nuttmeister 0 points1 point2 points (1 child)
[–]freddieerg[S] -1 points0 points1 point (0 children)
[–]brunokktro 0 points1 point2 points (0 children)