CloudWanderer Reference¶
Main cloudwanderer module.
-
class
cloudwanderer.cloud_wanderer.
CloudWanderer
(storage_connector, boto3_session=None)¶ CloudWanderer.
- Parameters
storage_connector – A CloudWanderer storage connector object.
boto3_session (boto3.session.Session) – A boto3 Session object.
-
property
account_id
¶ Return the AWS Account ID our boto3 session is authenticated against.
-
property
client_region
¶ Return the region our boto3 session is configured to use.
-
read_all_resources_in_account
(account_id)¶ Return all resources in the provided AWS Account from storage.
-
read_resource
(urn)¶ Return a specific resource by its urn from storage.
-
read_resource_of_type
(service, resource_type)¶ Return all resources of type.
- Parameters
service (str) – Service name (e.g. ec2)
resource_type (str) – Resource Type (e.g. instance)
-
read_resource_of_type_in_account
(service, resource_type, account_id)¶ Return all resources of this type in the provided AWS Account from storage.
-
write_all_resources
(exclude_resources=None)¶ Write all AWS resources in this account from all services to storage.
-
write_resource_attributes
(service_name)¶ Write all AWS resource attributes in this account in this service to storage.
These custom resource attribute definitions allow us to fetch resource attributes that are not returned by the resource’s default describe calls.
- Parameters
service_name (str) – The name of the service to write the attributes of (e.g.
ec2
)
-
write_resources
(service_name, exclude_resources=None)¶ Write all AWS resources in this account in this service to storage.
- Parameters
service_name (str) – The name of the service to write resources for (e.g.
'ec2'
)exclude_resources (list) – A list of resources to exclude (e.g. [‘instances’])
-
class
cloudwanderer.cloud_wanderer.
CloudWandererResource
(urn, resource_data, resource_attributes=None)¶ A simple representation of a resource that prevents any storage metadata polluting the resource dictionary.
Use
dict(my_resource_dict)
to convert this object into a dictionary that contains only the resource’s metadata.-
urn
¶ The AWS URN of the resource.
- Type
cloudwanderer.AwsUrn
-
metadata
¶ The original storage representation of the resource as it was passed in.
- Type
dict
-
-
class
cloudwanderer.cloud_wanderer.
ResourceMetadata
(resource_data, resource_attributes)¶ Metadata for a
CloudWandererResource
.Contains the original dictionaries of the resource and its attributes.
-
resource_data
¶ The raw dictionary representation of the Resource.
- Type
dict
-
resource_attributes
¶ the list of raw dictionary representation of the Resource’s attributes.
- Type
list
-