CloudWanderer

Main cloudwanderer module.

class CloudWanderer(storage_connectors, cloud_interface=None)

CloudWanderer.

write_resources(exclude_resources=None, **kwargs)

Write all AWS resources in this account from all regions and all services to storage.

Any additional args will be passed into the cloud interface’s get_ methods.

Parameters
  • exclude_resources (list) – A list of resource names to exclude (e.g. ['instance'])

  • **kwargs – Additional keyword argumentss will be passed down to the cloud interface methods.

Return type

None

write_resources_concurrently(cloud_interface_generator, exclude_resources=None, concurrency=10, **kwargs)

Write all AWS resources in this account from all regions and all services to storage.

Any additional args will be passed into the cloud interface’s get_ methods.

Parameters
  • exclude_resources (list) – A list of resource names to exclude (e.g. ['instance'])

  • concurrency (int) – Number of query threads to invoke concurrently. If the number of threads exceeds the number of regions by at least two times multiple services to be queried concurrently in each region. WARNING: Experimental. Complete data capture depends heavily on the thread safeness of the storage connector and has not been thoroughly tested!

  • cloud_interface_generator (Callable) – A method which returns a new cloud interface session when called. This helps prevent non-threadsafe cloud interfaces from interfering with each others.

  • **kwargs – Additional keyword argumentss will be passed down to the cloud interface methods.

Return type

None

write_resources_in_region(exclude_resources=None, region_name=None, **kwargs)

Write all AWS resources in this account region from all services to storage.

Any additional args will be passed into the cloud interface’s get_ methods.

Parameters
  • exclude_resources (list) – A list of resource names to exclude (e.g. ['instance'])

  • region_name (str) – The name of the region to get resources from (defaults to session default if not specified)

  • **kwargs – Additional keyword argumentss will be passed down to the cloud interface methods.

Return type

None

write_resources_of_service_in_region(service_name, exclude_resources=None, region_name=None, **kwargs)

Write all AWS resources in this region in this service to storage.

Cleans up any resources in the StorageConnector that no longer exist.

Any additional args will be passed into the cloud interface’s get_ methods.

Parameters
  • service_name (str) – The name of the service to write resources for (e.g. 'ec2')

  • exclude_resources (list) – A list of resource names to exclude (e.g. ['instance'])

  • region_name (str) – The name of the region to get resources from (defaults to session default if not specified)

  • **kwargs – Additional keyword argumentss will be passed down to the cloud interface methods.

Return type

None

write_resources_of_type_in_region(service_name, resource_type=None, region_name=None, **kwargs)

Write all AWS resources in this region in this service to storage.

Cleans up any resources in the StorageConnector that no longer exist.

Any additional args will be passed into the cloud interface’s get_ methods.

Parameters
  • service_name (str) – The name of the service to write resources for (e.g. 'ec2')

  • resource_type (str) – The name of the type of the resource to write (e.g. 'instance')

  • region_name (str) – The name of the region to get resources from (defaults to session default if not specified)

  • **kwargs – Additional keyword argumentss will be passed down to the cloud interface methods.

Return type

None