Boto3 Loaders

Boto3 Loaders.

Loaders and data classes to load custom CloudWanderer Boto3 service definitions and merge them with the boto3 provided ones. This allows cloudwanderer to extend Boto3 to support AWS resources that it does not support natively. We can do this quite easily because CloudWanderer only needs a fraction of the functionality that native Boto3 resources provide (i.e. the description of the resources).

class CustomServiceLoader(definition_path='resource_definitions')

A class to load custom services.

property available_services

Return a list of available snake_case service names.

property service_definitions

Return our custom resource definitions.

class MergedServiceLoader(custom_service_loader=None)

A class to merge the services from a custom service loader with those of Boto3.

property available_services

Return a list of service names that can be loaded.

property boto3_available_services

Return a list of services defined by Boto3.

property cloudwanderer_available_services

Return a list of services defined by CloudWanderer.

get_service_definition(service_name)

Return a combined dictionary service definition of both CloudWanderer and Boto3 services.

Parameters

service_name (str) – The PascalCase name of the service to return the definition for.

Raises

UnsupportedServiceError – Occurs if a service is requested that CloudWanderer does not support.

Return type

dict

class ResourceMap(type, region_request, ignored_subresources)

Specification for additional CloudWanderer specific metadata about a Boto3 resource type.

property ignored_subresource_types

Return a list of (PascalCase) ignored subresource types.

property ignored_subresources

Alias for field number 2

property region_request

Alias for field number 1

property type

Alias for field number 0

class ResourceRegionRequest(operation, params, path_to_region, default_value)

Specification for a request to get a resource’s region.

build_params(resource)

Return the params required to query the resource’s region from the Boto3 resource’s attributes.

Parameters

resource (boto3.resources.base.ServiceResource) – The Boto3 Resource to build params for.

Return type

dict

property default_value

Alias for field number 3

property operation

Alias for field number 0

property params

Alias for field number 1

property path_to_region

Alias for field number 2

class ResourceRegionRequestParam(target, source, name)

Specification for a request param data model.

property name

Alias for field number 2

property source

Alias for field number 1

property target

Alias for field number 0

class ServiceMap(name, resource_definition, global_service, global_service_region, regional_resources, service_definition)

Specification for additional CloudWanderer specific metadata about a Boto3 service.

get_resource_map(boto3_resource_name)

Return the resource map given a PascalCase resource name.

Parameters

boto3_resource_name (str) – The (PascalCase) name of the resource map to get.

Return type

cloudwanderer.boto3_loaders.ResourceMap

property global_service

Alias for field number 2

property global_service_region

Alias for field number 3

property is_default_service

Return True if this service has no definition and should return default values.

property is_global_service

Return whether this service is a global service.

property name

Alias for field number 0

property regional_resources

Alias for field number 4

property resource_definition

Alias for field number 1

property service_definition

Alias for field number 5

class ServiceMappingLoader

A class to load and retrieve service mappings.

Service Mappings provide additional metadata about an AWS service. This includes things like, whether it is a global service, whether it has regional resources, etc.

__init__()

Load and retrieve service mappings.

Return type

None

get_service_mapping(service_name)

Return the mapping for service_name.

Parameters

service_name (str) – The name of the service (e.g. 'ec2')

Return type

dict

property service_maps

Return our custom resource definitions.