Understanding AWS EC2 Data Transfer Charges: Regional Traffic Between Availability Zones Explained for Developers


2 views

When reviewing your AWS bill, you might encounter this line item:

$0.010 per GB - regional data transfer - in/out/between EC2 Avail Zones 
or when using public/elastic IP addresses or ELB

Even with a single micro instance running, several scenarios can trigger these data transfer fees:

  • Communication between EC2 instances in different Availability Zones
  • Data transferred through Elastic Load Balancers (ELB)
  • Traffic using public or Elastic IP addresses
  • Some monitoring and management traffic from AWS services

Consider these common cases where you might see small charges:

# Example 1: Simple web request
curl http://your-ec2-instance/public-endpoint

# Example 2: Database replication across AZs
# (Even if you didn't explicitly configure this, some AWS services might do it)
aws rds create-db-instance \
    --db-instance-identifier mydb \
    --availability-zone us-east-1a \
    --db-instance-class db.t2.micro \
    --engine mysql

Use AWS Cost Explorer with these filters:

{
  "Dimensions": {
    "Key": "SERVICE",
    "Values": ["AWS Data Transfer"]
  },
  "Tags": {
    "Key": "CostCenter",
    "Values": ["Production"]
  }
}

To minimize costs:

  • Keep instances in the same AZ when possible
  • Use private IPs for inter-instance communication
  • Consider VPC endpoints for AWS services

Run these AWS CLI commands to investigate:

# Check data transfer metrics
aws cloudwatch get-metric-statistics \
    --namespace AWS/EC2 \
    --metric-name NetworkOut \
    --dimensions Name=InstanceId,Value=i-1234567890abcdef0 \
    --start-time 2023-01-01T00:00:00Z \
    --end-time 2023-01-31T23:59:59Z \
    --period 86400 \
    --statistics Sum

# List all elastic IPs associated with your account
aws ec2 describe-addresses

When you see a line item for "$0.010 per GB - regional data transfer" on your AWS bill, it typically refers to traffic between EC2 instances in different Availability Zones (AZs) within the same region, or when using public/elastic IPs and ELBs. Even with just one micro instance running, you might still incur these charges.

Here are common scenarios that trigger these charges:

  • Your instance communicates with other AWS services in different AZs
  • You use Elastic Load Balancing (ELB) which distributes traffic across AZs
  • Your application makes calls to public AWS endpoints (S3, SQS, etc.)
  • System monitoring or logging services transfer data between AZs

Even a simple CloudWatch monitoring setup can generate inter-AZ traffic:

# Example CloudWatch Agent configuration (generates metrics traffic)
{
  "metrics": {
    "append_dimensions": {
      "InstanceId": "${aws:InstanceId}"
    },
    "metrics_collected": {
      "cpu": {
        "measurement": ["cpu_usage_idle"],
        "resources": ["*"],
        "metrics_collection_interval": 60
      }
    }
  }
}

Use AWS Cost Explorer with these filters:

  1. Service: EC2
  2. Operation: DataTransfer-Regional-Bytes
  3. Usage Type: DataTransfer-Regional-Bytes

Implementation tips to minimize costs:

  • Use VPC endpoints for AWS services
  • Configure security groups to restrict unnecessary outbound traffic
  • Monitor your instance's network interfaces with:
# Check network usage on Linux instances
vnstat -i eth0
# Or for Windows:
Get-NetAdapterStatistics | Select-Object Name,ReceivedBytes,SentBytes

These are typical scenarios where you'll see the charge:

Scenario Data Direction Chargeable
EC2 to S3 in same region Outbound No
EC2 to EC2 in different AZs Both Yes
Through ELB Inbound Yes

The small charges you're seeing are likely from system processes or minor traffic bursts. AWS bills these in increments, so even a few MB of monitoring data can appear on your bill.