What is the service code for AWS ELB to be used in AWS Pricing API

Viewed 800

AWS provides a PRICING API to query the prices of the services. The describe-services action of the pricing API provides service code(e.g: AmazonEC2, AmazonRDS) and attributes of the almost all the services. These service codes and attributes must be used in the get-products action of the pricing API to get the price list. But I could not find service code and attributes related to AWS ELB, ALB and NLB in the result of describe-services action. If somebody knows what service code and attributes are to be used for ELB, ALB and NLB, please help.

1 Answers

The Load Balancer products are in the AmazonEC2 service code.

The names in productFamily are:

Classic Load Balancer == Load Balancer
Network Load Balancer == Load Balancer-Network
Application Load Balancer == Load Balancer-Application

From the command line you can use something similar to this to get the results for a specific region:

aws pricing get-products --service-code AmazonEC2 --filters "Type=TERM_MATCH,Field=productFamily,Value=Load Balancer" "Type=TERM_MATCH,Field=location,Value=US East (N. Virginia)"

Will give this output:

{ "PriceList": [ "{\"product\":{\"productFamily\":\"Load Balancer\",\"attributes\":{\"servicecode\":\"AmazonEC2\",\"groupDescription\":\"Data processed by Elastic Load Balancer\",\"usagetype\":\"DataProcessing-Bytes\",\"locationType\":\"AWS Region\",\"location\":\"US East (N. Virginia)\",\"servicename\":\"Amazon Elastic Compute Cloud\",\"operation\":\"LoadBalancing\",\"group\":\"ELB:Balancing\"},\"sku\":\"4YYNPC2WZJJXCMPG\"},\"serviceCode\":\"AmazonEC2\",\"terms\":{\"OnDemand\":{\"4YYNPC2WZJJXCMPG.JRTCKXETXF\":{\"priceDimensions\":{\"4YYNPC2WZJJXCMPG.JRTCKXETXF.6YS6EN2CT7\":{\"unit\":\"GB\",\"endRange\":\"Inf\",\"description\":\"$0.008 per GB Data Processed by the LoadBalancer\",\"appliesTo\":[],\"rateCode\":\"4YYNPC2WZJJXCMPG.JRTCKXETXF.6YS6EN2CT7\",\"beginRange\":\"0\",\"pricePerUnit\":{\"USD\":\"0.0080000000\"}}},\"sku\":\"4YYNPC2WZJJXCMPG\",\"effectiveDate\":\"2019-10-01T00:00:00Z\",\"offerTermCode\":\"JRTCKXETXF\",\"termAttributes\":{}}}},\"version\":\"20191017052535\",\"publicationDate\":\"2019-10-17T05:25:35Z\"}", "{\"product\":{\"productFamily\":\"Load Balancer\",\"attributes\":{\"servicecode\":\"AmazonEC2\",\"groupDescription\":\"Standard Elastic Load Balancer\",\"usagetype\":\"LoadBalancerUsage\",\"locationType\":\"AWS Region\",\"location\":\"US East (N. Virginia)\",\"servicename\":\"Amazon Elastic Compute Cloud\",\"operation\":\"LoadBalancing\",\"group\":\"ELB:Balancer\"},\"sku\":\"T3YPSF6NJ69JWWNM\"},\"serviceCode\":\"AmazonEC2\",\"terms\":{\"OnDemand\":{\"T3YPSF6NJ69JWWNM.JRTCKXETXF\":{\"priceDimensions\":{\"T3YPSF6NJ69JWWNM.JRTCKXETXF.6YS6EN2CT7\":{\"unit\":\"Hrs\",\"endRange\":\"Inf\",\"description\":\"$0.025 per LoadBalancer-hour (or partial hour)\",\"appliesTo\":[],\"rateCode\":\"T3YPSF6NJ69JWWNM.JRTCKXETXF.6YS6EN2CT7\",\"beginRange\":\"0\",\"pricePerUnit\":{\"USD\":\"0.0250000000\"}}},\"sku\":\"T3YPSF6NJ69JWWNM\",\"effectiveDate\":\"2019-10-01T00:00:00Z\",\"offerTermCode\":\"JRTCKXETXF\",\"termAttributes\":{}}}},\"version\":\"20191017052535\",\"publicationDate\":\"2019-10-17T05:25:35Z\"}" ], "FormatVersion": "aws_v1" }

References

Pricing Get-Products
Pricing Describe-Services

Related