Can someone explain the mismatch between doc and API regarding pricing of EC2 AWS Outbound traffic

1

I'm trying to understand how AWS is computing the pricing for AWS EC2 Outbound traffic. From the doc and for example for region Sao Paolo:

However when using the AWS Pricing API, I don't get the same pricing:

aws --region us-east-1  pricing get-products --cli-input-json '{"FormatVersion":"aws_v1","ServiceCode":"AmazonEC2","Filters":[{"Type":"TERM_MATCH","Field":"transferType","Value":"AWS Outbound"}]}'|jq '.PriceList[]|fromjson'                  
{
  "product": {
    "productFamily": "Data Transfer",
    "attributes": {
      "fromLocationType": "AWS Region",
      "toRegionCode": "",
      "servicecode": "AmazonEC2",
      "usagetype": "SAE1-DataTransfer-Out-Bytes",
      "fromRegionCode": "sa-east-1",
      "transferType": "AWS Outbound",
      "servicename": "Amazon Elastic Compute Cloud",
      "fromLocation": "South America (Sao Paulo)",
      "toLocationType": "Other",
      "toLocation": "External",
      "operation": ""
    },
    "sku": "6ZUKMU6RKW7EH89N"
  },
  "serviceCode": "AmazonEC2",
  "terms": {
    "OnDemand": {
      "6ZUKMU6RKW7EH89N.JRTCKXETXF": {
        "priceDimensions": {
          "6ZUKMU6RKW7EH89N.JRTCKXETXF.VF6T3GAUKQ": {
            "unit": "GB",
            "endRange": "51200",
            "description": "$0.23 per GB Internet Data Transfer - next 40 TB / month data transfer out of Amazon EC2",
            "appliesTo": [],
            "rateCode": "6ZUKMU6RKW7EH89N.JRTCKXETXF.VF6T3GAUKQ",
            "beginRange": "10240",
            "pricePerUnit": {
              "USD": "0.2300000000"
            }
          },
          "6ZUKMU6RKW7EH89N.JRTCKXETXF.8EEUB22XNJ": {
            "unit": "GB",
            "endRange": "1",
            "description": "$0.00 per GB Internet Data Transfer - first 1 GB / month data transfer out of Amazon EC2",
            "appliesTo": [],
            "rateCode": "6ZUKMU6RKW7EH89N.JRTCKXETXF.8EEUB22XNJ",
            "beginRange": "0",
            "pricePerUnit": {
              "USD": "0.0000000000"
            }
          },
          "6ZUKMU6RKW7EH89N.JRTCKXETXF.N9EW5UVVPA": {
            "unit": "GB",
            "endRange": "153600",
            "description": "$0.21 per GB Internet Data Transfer - next 100 TB / month data transfer out of Amazon EC2",
            "appliesTo": [],
            "rateCode": "6ZUKMU6RKW7EH89N.JRTCKXETXF.N9EW5UVVPA",
            "beginRange": "51200",
            "pricePerUnit": {
              "USD": "0.2100000000"
            }
          },
          "6ZUKMU6RKW7EH89N.JRTCKXETXF.WVV8R9FH29": {
            "unit": "GB",
            "endRange": "10240",
            "description": "$0.25 per GB Internet Data Transfer - remainder of first 10 TB / month data transfer out of Amazon EC2",
            "appliesTo": [],
            "rateCode": "6ZUKMU6RKW7EH89N.JRTCKXETXF.WVV8R9FH29",
            "beginRange": "1",
            "pricePerUnit": {
              "USD": "0.2500000000"
            }
          },
          "6ZUKMU6RKW7EH89N.JRTCKXETXF.GPHXDESFBB": {
            "unit": "GB",
            "endRange": "Inf",
            "description": "$0.19 per GB Internet Data Transfer - data transfer out of Amazon EC2 / month over 150 TB",
            "appliesTo": [],
            "rateCode": "6ZUKMU6RKW7EH89N.JRTCKXETXF.GPHXDESFBB",
            "beginRange": "153600",
            "pricePerUnit": {
              "USD": "0.1900000000"
            }
          }
        },
        "sku": "6ZUKMU6RKW7EH89N",
        "effectiveDate": "2022-12-01T00:00:00Z",
        "offerTermCode": "JRTCKXETXF",
        "termAttributes": {}
      }
    }
  },
  "version": "20221222205132",
  "publicationDate": "2022-12-22T20:51:32Z"
}

Indeed this is way different: $0 up to 1GB (and not 100GB), then $0.25 for first 10TB, $0.21 and so on. What is the correct price?

Finally, using the AWS Pricing API I can't get any other pricing for other regions. The request above only gives reply for Sao Paulo.

2 Answers
0

Hi.

You are right. I also tried (AWS CLI v1 & v2 )
The amount is incorrect and only the sa-east-1 region is retrieved.

This is probably the wrong behavior of the AWS CLI or AWS API.
However, I believe Document is correct and API is wrong because the documentation states:

The AWS Price List Query API provides pricing details for your information only. If there is a discrepancy between the offer file and a service pricing page, AWS charges the prices that are listed on the service pricing page. For more information about AWS service pricing, see Cloud Services Pricing.

https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/using-pelong.html

profile picture
EXPERT
iwasa
answered a year ago
0

I've run into this frustrating issue as well, but it seems that instead of the EC2 service, the AWSDataTransfer service should be queries, e.g.:

aws --region us-east-1 pricing get-products \
  --cli-input-json '{"FormatVersion":"aws_v1","ServiceCode":"AWSDataTransfer","Filters":[{"Type":"TERM_MATCH","Field":"transferType","Value":"AWS Outbound"}]}'
Gergely
answered 2 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