- Newest
- Most votes
- Most comments
Based on your setup, I'll clarify the data transfer charges that apply in your scenario.
First, since both EC2 instances (A and B) are in the same Availability Zone (AZ), data transfer between them would normally be free if they communicated directly. However, your setup routes traffic through the ALB using its public DNS, which changes the cost structure.
When Instance A communicates with Instance B through the public ALB:
- The traffic goes from Instance A to the ALB, then from the ALB to Instance B
- Since Instance A is using the public DNS of the ALB (even though everything is in the same VPC), the traffic is effectively going through the Internet Gateway and back into your VPC
- This creates an additional charge of $0.01/GB in each direction
For the specific usage type you mentioned (APS2-DataTransfer-Out-Bytes), this represents data transfer from the Asia Pacific (Sydney) region to the internet. This would include traffic from your ALB to external clients, but not the internal traffic between your ALB and EC2 instances within the same region.
To identify the data transfer costs between your instances and the ALB, you should look for usage types that include "Regional" in their name, such as "APS2-DataTransfer-Regional-Bytes", which would capture the inter-AZ or intra-region data transfer charges.
Note that AWS provides 100 GB of free data transfer out to the internet each month (aggregated across all AWS services and regions, except China and GovCloud).
To optimize costs, you could consider:
- Having Instance A communicate directly with Instance B using private IP addresses
- Using an internal ALB instead of a public one for internal communications
- If you need to maintain the current architecture, monitor your data transfer costs closely using AWS Cost Explorer with the appropriate usage type filters
Sources
Can someone explain data transfer charges in detail? | AWS re:Post
Understanding data transfer charges - AWS Data Exports
Community | Optimizing Network Traffic and Cost in AWS During Migration
Data Transfer Charges | AWS re:Post
Exploring Data Transfer Costs for AWS Network Load Balancers | Networking & Content Delivery
Since you're using an ALB with all resources in the same AZ, internal traffic between Instance A and the ALB should not incur cross-AZ charges. However, traffic from the ALB to external internet users will incur outbound data transfer charges
You can use the Tag filter in Cost Explorer to visualize cost and usage by tag according to your tagging strategy. For example, if you've tagged resources with a "Project" tag, you can filter by project in Cost Explorer to see the total cost of that project across multiple AWS services. Similarly, you can filter by team, environment, cost center, or any other custom tag you've defined.
Ref: https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/cost-alloc-tags.html
That said, what you can try is:
Apply Region Filter: First, filter by Region and select Asia Pacific (Sydney). This narrows your view to all costs associated with resources in that region.
Apply Usage Type Filter: Next, add a Usage Type filter specifically for "APS2-DataTransfer-Out-Bytes" to isolate outbound data transfer to the internet. This ensures you're only viewing charges for data leaving AWS to external destinations, not internal traffic.
Add Tag Filters: If you want to further segment this by specific resources, apply your tag filters on top of these dimension filters. When applying a tag filter, Cost Explorer displays charges only for resources tagged with the selected tag values.
Some extra considerations:
- After you create and attach tags to resources, they appear in the AWS Billing Console's Cost Allocation Tags section within 24 hours. You must then activate these tags for AWS to start tracking them.
- After activation, it can take up to 24 hours for tags to appear in Cost Explorer and become fully available for filtering and grouping.
- Cost allocation tags do not apply retroactively to historical data by default. Tags only track costs from the time they are activated forward.
APS2-DataTransfer-Out-Byte refers to cross-AZ charges within the same region (ap-southeast-2 in this case). There will be charges from ALB to EC2 if the traffic is going cross AZ. If you have other resources like RDS, ECS, it will include those cross-AZ charges as well. You might get specific details from cost utilisation report (CUR).
Also, if you want to remove cross AZ charges for ALB, you can go to
Load Balancer > Attributes -> Availability Zone routing configuration > Cross-zone load balancing
and turn this setting to off.
Relevant content
- asked 3 years ago

In my scenario, is "APS2-DataTransfer-Regional-Bytes" billed under EC2 or ELB for the traffic between ALB and EC2? Thank you.