Programmatic way to get a list of available AWS products?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP



Programmatic way to get a list of available AWS products?



There seems to be about a hundred AWS products available. The only way to get an authoritative listing of them is to look on the web.



Is there any API that could give me a list of all currently available AWS products, ideally with some metadata about each one (product title, description, what regions and edge locations it's available in, etc)?




4 Answers
4



One way is to make use of aws command line interface to get the list of available services and make use of their corresponding describe or list commands to get the configured/available services.


describe


list



Python API libraries Boto3 and Botocore. I am providing a code snippet to list the services. You have to look at the docs to get other info you want.


>>> import boto3
>>> session = boto3.Session()
>>> session.get_available_services()
['acm', 'apigateway', 'application-autoscaling', 'appstream', 'autoscaling', 'batch', 'budgets', 'clouddirectory', 'cloudformation', 'cloudfront', 'cloudhsm', 'cloudsearch', 'cloudsearchdomain', 'cloudtrail', 'cloudwatch', 'codebuild', 'codecommit', 'codedeploy', 'codepipeline', 'cognito-identity', 'cognito-idp', 'cognito-sync', 'config', 'cur', 'datapipeline', 'devicefarm', 'directconnect', 'discovery', 'dms', 'ds', 'dynamodb', 'dynamodbstreams', 'ec2', 'ecr', 'ecs', 'efs', 'elasticache', 'elasticbeanstalk', 'elastictranscoder', 'elb', 'elbv2', 'emr', 'es', 'events', 'firehose', 'gamelift', 'glacier', 'health', 'iam', 'importexport', 'inspector', 'iot', 'iot-data', 'kinesis', 'kinesisanalytics', 'kms', 'lambda', 'lex-runtime', 'lightsail', 'logs', 'machinelearning', 'marketplacecommerceanalytics', 'meteringmarketplace', 'opsworks', 'opsworkscm', 'pinpoint', 'polly', 'rds', 'redshift', 'rekognition', 'route53', 'route53domains', 's3', 'sdb', 'servicecatalog', 'ses', 'shield', 'sms', 'snowball', 'sns', 'sqs', 'ssm', 'stepfunctions', 'storagegateway', 'sts', 'support', 'swf', 'waf', 'waf-regional', 'workspaces', 'xray']

>>> for item, service in (enumerate(session.get_available_services(), 1)):
... print item, service
...
1 acm
2 apigateway
3 application-autoscaling
4 appstream
5 autoscaling
6 batch
7 budgets
8 clouddirectory
9 cloudformation
10 cloudfront
11 cloudhsm
12 cloudsearch
13 cloudsearchdomain
14 cloudtrail
15 cloudwatch
16 codebuild
17 codecommit
18 codedeploy
19 codepipeline
20 cognito-identity
21 cognito-idp
22 cognito-sync
23 config
24 cur
25 datapipeline
26 devicefarm
27 directconnect
28 discovery
29 dms
30 ds
31 dynamodb
32 dynamodbstreams
33 ec2
34 ecr
35 ecs
36 efs
37 elasticache
38 elasticbeanstalk
39 elastictranscoder
40 elb
41 elbv2
42 emr
43 es
44 events
45 firehose
46 gamelift
47 glacier
48 health
49 iam
50 importexport
51 inspector
52 iot
53 iot-data
54 kinesis
55 kinesisanalytics
56 kms
57 lambda
58 lex-runtime
59 lightsail
60 logs
61 machinelearning
62 marketplacecommerceanalytics
63 meteringmarketplace
64 opsworks
65 opsworkscm
66 pinpoint
67 polly
68 rds
69 redshift
70 rekognition
71 route53
72 route53domains
73 s3
74 sdb
75 servicecatalog
76 ses
77 shield
78 sms
79 snowball
80 sns
81 sqs
82 ssm
83 stepfunctions
84 storagegateway
85 sts
86 support
87 swf
88 waf
89 waf-regional
90 workspaces
91 xray



Interestingly enough, I suspect the most complete source for this information (at very fine level of detail) is the Price List API.



For example:



To find a list of all available offer files, download the offer index file. Note what it provides:



Offer index file – A JSON file that lists the supported AWS services, with a URL for each offer file where you can download pricing details. The file also includes metadata about the offer index file itself, URLs for service offer files, and URLs for regional offer index files.



http://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/price-changes.html



In turn, the individual service files detail all of the pricing information for all possible service elements.



One particularly useful example is the case of EC2, the various instance type attributes are provided here among the pricing data -- you'll find things like processor model, clock speed, number of CPUs, etc., detailed.



Quick perl script to get data by scraping html from /products page. This will get a nice json data set.


#!/usr/bin/perl
#
#This script is intended to simply piece togather a json file for available JSON services.
#

use v5.16.1;
use strict;
use warnings;
use JSON;

my ($category,%data, %opts, $marker);
my $count = 1;

my @foo = `curl https://aws.amazon.com/products/`;

foreach my $line (@foo)
if ($line =~ /<h6> <a href.*?>(.*?)<i class/)
$category = $1;
next;


if ($line =~ /^s*<a href="https://aws.amazon.com/.*?/?(.*?)/?nc2.*?>(.*?)<span>(.*?)</span/)
$datacategory$categoryservices$1name = $2;
$datacategory$categoryservices$1description = $3;



my $json = encode_json %data;
say $json;
exit;



Ensure you have installed perl JSON module. Usage:


script_name.pl | python -m json.tool > your_json_file.json



Example output:


"Storage": {
"services": {
"ebs":
"description": "EC2 Block Storage Volumes",
"name": "Amazon Elastic Block Store (EBS)"
,
"efs":
"description": "Fully Managed File System for EC2",
"name": "Amazon Elastic File System (EFS)"
,
"glacier":
"description": "Low-cost Archive Storage in the Cloud",
"name": "Amazon Glacier"
,



It will work up till they change that page :)






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

Firebase Auth - with Email and Password - Check user already registered

Dynamically update html content plain JS

How to determine optimal route across keyboard