Skip to content

Instantly share code, notes, and snippets.

@amitness
Last active December 31, 2018 05:54
Show Gist options
  • Save amitness/c02e97f96ab4b1d03627e62be3253bb7 to your computer and use it in GitHub Desktop.
Save amitness/c02e97f96ab4b1d03627e62be3253bb7 to your computer and use it in GitHub Desktop.
List all AWS Services and their associated methods
import csv
import boto3
def get_available_methods(service):
client = boto3.client(service)
all_attributes = dir(client)
available_methods = [attribute for attribute in all_attributes if callable(getattr(client, attribute))]
available_methods = [i for i in available_methods if not i.startswith('_')]
return available_methods
with open('aws_services.csv', 'w') as file:
writer = csv.writer(file)
writer.writerow(['ranking', 'method', 'service'])
counter = 0
sess = boto3.Session()
services = sess.get_available_services()
for service in services:
methods = get_available_methods(service)
for method in methods:
print("{}, {}, {}".format(counter, method, service))
writer.writerow([counter, method, service])
counter += 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment