A Python package which wanders across your AWS account and records your resources in DynamoDB


pip install cloudwanderer


Start a local dynamodb

$  docker run -p 8000:8000 amazon/dynamodb-local

Open up python and import and initialise CloudWanderer

>>> import logging
>>> from cloudwanderer import CloudWanderer
>>> from cloudwanderer.storage_connectors import DynamoDbConnector
>>> wanderer = CloudWanderer(storage_connector=DynamoDbConnector(
...     endpoint_url='http://localhost:8000'
... ))
>>> logging.basicConfig(level='INFO')
>>> wanderer.storage_connector.init()

Query all the resources from your current account region and save them to your local dynamodb.

>>> wanderer.write_resources_in_region()

Get a list of VPCs back.

>>> vpc_urns = wanderer.read_resource_of_type(service='ec2', resource_type='vpc')
>>> first_vpc = next(vpc_urns)
>>> first_vpc.urn
AwsUrn(account_id='123456789012', region='eu-west-2', service='ec2', resource_type='vpc', resource_id='vpc-11111111')

Load the full details of the resource.

>>> vpc = wanderer.read_resource(urn=first_vpc.urn)
>>> vpc.cidr_block
>>> vpc.instance_tenancy
>>> vpc.is_default