Storage Connector Reference¶
DynamoDB Connector¶
-
class
cloudwanderer.storage_connectors.
DynamoDbConnector
(table_name='cloud_wanderer', endpoint_url=None)¶ CloudWanderer Storage Connector for DynamoDB.
- Parameters
table_name (str) – The name of the table to store resources in.
endpoint_url (str) – optional override endpoint url for DynamoDB.
-
init
()¶ Create the DynamoDB Database.
-
read_all
()¶ Return all DynamoDB table records (not just resources).
-
read_all_resources_in_account
(account_id)¶ Return all resources in account.
- Parameters
account_id (str) – AWS Account ID
-
read_resource
(urn)¶ Return the resource with the specified
cloudwanderer.AwsUrn
.- Parameters
urn (cloudwanderer.AwsUrn) – The AWS URN of the resource to return
-
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 the specified type in the specified AWS account.
- Parameters
service (str) – Service name, e.g.
ec2
resource_type (str) – Resouce type, e.g.
instance
account_id (str) – AWS Account ID
-
write_resource
(urn, resource)¶ Write the specified resource to DynamoDB.
- Parameters
urn (cloudwanderer.AwsUrn) – The URN of the resource.
resource – The boto3 Resource object representing the resource.
-
write_resource_attribute
(urn, attribute_type, resource_attribute)¶ Write the specified resource attribute to DynamoDb.