AWS Interface¶
A standardised interface for interacting with AWS.
Provides simpler methods for CloudWanderer
to call.
-
class
CloudWandererAWSInterface
(boto3_session=None, service_loader=None, service_mapping_loader=None)¶ Simplifies lookup of Boto3 services and resources.
-
__init__
(boto3_session=None, service_loader=None, service_mapping_loader=None)¶ Simplifies lookup of Boto3 services and resources.
- Parameters
boto3_session (boto3.session.Session) – A Boto3 session, if not provided the default will be used.
service_loader (Optional[cloudwanderer.boto3_loaders.MergedServiceLoader]) – An optional loader to allow the injection of additional custom services
service_mapping_loader (Optional[cloudwanderer.boto3_loaders.ServiceMappingLoader]) – An optional loader to allow the injection of additional custom service mappings
- Return type
None
-
get_actions
(regions=None, service_names=None, resource_types=None, exclude_resources=None)¶ Return the query and cleanup actions to be performed based on the parameters provided.
All arguments are optional.
- Parameters
regions (list) – The name of the region to get resources from (defaults to session default if not specified)
service_names (str) – The names of the services to write resources for (e.g.
['ec2']
)resource_types (list) – A list of resource types to include (e.g.
['instance']
)exclude_resources (list) – A list of service:resources to exclude (e.g.
['ec2:instance']
)
- Return type
-
get_resource
(urn, include_subresources=True)¶ Yield the resource picked out by this URN and optionally its subresources.
- Parameters
urn (URN) – The urn of the resource to get.
include_subresources (bool) – Whether or not to additionally yield the subresources of the resource.
- Return type
Iterator[cloudwanderer.cloud_wanderer_resource.CloudWandererResource]
-
get_resources
(service_name, resource_type, region=None, **kwargs)¶ Return all resources of resource_type from Boto3.
- Parameters
service_name (str) – The name of the service to get resource for (e.g.
'ec2'
)resource_type (str) – The type of resource to get resources of (e.g.
'instance'
)region (str) – The region to get resources of (e.g.
'eu-west-1'
)**kwargs – Additional keyword arguments will be passed down to the Boto3 client.
- Raises
botocore.exceptions.ClientError – Occurs if the Boto3 Client Errors.
- Return type
Iterator[cloudwanderer.cloud_wanderer_resource.CloudWandererResource]
-