A Python package which wanders across your AWS account and records your resources in DynamoDB
Project description
A Python package which wanders across your AWS account and records your resources in DynamoDB
Documentation: CloudWanderer.io
Installation
pip install cloudwanderer
Usage
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
>>> storage_connector = DynamoDbConnector(
... endpoint_url='http://localhost:8000'
... )
>>> wanderer = CloudWanderer(storage_connectors=[storage_connector])
>>> logging.basicConfig(level='INFO')
>>> storage_connector.init()
Get all the resources from your AWS account and save them to your local dynamodb.
>>> wanderer.write_resources()
Get a list of VPCs back.
>>> vpcs = storage_connector.read_resources(service='ec2', resource_type='vpc')
>>> first_vpc = next(vpcs)
>>> first_vpc.urn
URN(account_id='123456789012', region='us-east-1', service='ec2', resource_type='vpc', resource_id_parts=['vpc-11111111'])
Load the full details of the resource.
>>> first_vpc.load()
>>> first_vpc.cidr_block
'172.31.0.0/16'
>>> first_vpc.instance_tenancy
'default'
>>> first_vpc.is_default
True
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
cloudwanderer-0.16.1.tar.gz
(31.4 kB
view hashes)
Built Distribution
Close
Hashes for cloudwanderer-0.16.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f13c5b455a6a79bdb447ed8e22d45062e9f4680f6d826af5e8e1129c83fca836 |
|
MD5 | 197ccf56851f4fa8e4fd0da822c3c7f7 |
|
BLAKE2b-256 | f1b55afc2f7d570abcea2a987c8ebfb9d8aba0fbb2785f9f5a773bd8a199d43d |