Models

AWS Interface specific model classes.

class AWSResourceTypeFilter(service, resource_type, botocore_filters=None, jmespath_filters=None)

AWS Specific resource type filter.

Allows specification of either botocore filters or jmespath filters.

Parameters
  • service (str) –

  • resource_type (str) –

  • botocore_filters (Dict[str, Any]) –

  • jmespath_filters (List[str]) –

Return type

None

class IdPartSpecification(path, regex_pattern)

Specification for getting the ID parts of a resource’s relationship with another resource.

Parameters
  • path (str) –

  • regex_pattern (str) –

get_urn_parts(data)

Return id parts from a given data dict.

Parameters

data (Dict[str, Any]) – The data dictionary to get URN parts from.

Return type

Optional[Dict[str, Any]]

property path

The path to the ID Part

property regex_pattern

The regex pattern to apply to the ID part to extract the URN

property specified_urn_parts: Dict[str, List[str]]

Return a dictionary specifying the URN components which were specified in this id part specification.

class RelationshipSpecification(base_path, id_parts, service, resource_type, region_source, account_id_source, direction)

Specification for a relationship between two resources.

Parameters
property account_id_source

Alias for field number 5

property base_path

Alias for field number 0

property direction

Alias for field number 6

property id_parts

Alias for field number 1

property region_source

Alias for field number 4

property resource_type

Alias for field number 3

property service

Alias for field number 2

class ResourceMap(name, type, id_uniqueness_scope, region_request, default_aws_resource_type_filter, service_map, relationships, secondary_attribute_maps, urn_overrides, regional_resource=True, requires_load=False)

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

Parameters
property default_aws_resource_type_filter

The default AWSResourceTypeFilter for this resource.

property id_uniqueness_scope

The scope in which this resource’s ID is unique.

property name

The PascalCase name of the resource (e.g. Instance)

property region_request

An optional definition for how to perform a secondary query to discover the region in which this resource exists

property regional_resource

Whether or not this resource exists in every region.

property relationships

The specifications for the relationships this resource can have.

property requires_load

If the resource requires .load() calling on it before it has a complete set of metadata. Used by IAM PolicyVersion because as a dependent resource it needs to be listed with ListPolicyVersions, then subsequently got with GetPolicyVersion.

property secondary_attribute_maps

The specifications for the secondary attributes for this resource.

property service_map

A link back to the parent ServiceMap object.

should_query_resources_in_region(region)

Return whether this resource should be queried from this region.

Parameters

region (str) – The region in which to query the resource.

Return type

bool

property type

The snake_case type of the resource (e.g. instance)

property urn_overrides

Optional specifications for overriding URN parts based on resource metadata.

class ResourceRegionRequest(operation, params, path_to_region, default_value)

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

Parameters
  • operation (str) –

  • params (list) –

  • path_to_region (str) –

  • default_value (str) –

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.

Parameters
  • target (str) –

  • source (str) –

  • name (str) –

property name

Alias for field number 2

property source

Alias for field number 1

property target

Alias for field number 0

class SecondaryAttributeMap(source_path, destination_name)

Specification for mapping attributes contained in a secondary attribute to its parent’s resource.

Parameters
  • source_path (str) –

  • destination_name (str) –

property destination_name

The key to place this secondary attribute under in the parent resource.

property source_path

The path to get the URN from in the Secondary Attribute resource metadata itself.

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

Specification for additional CloudWanderer specific metadata about a Boto3 service.

Parameters
  • name (str) –

  • resource_definition (dict) –

  • global_service (bool) –

  • global_service_region (str) –

  • service_definition (dict) –

get_resource_map(resource_type)

Return the resource map given a snake_case resource name.

Parameters

resource_type (str) – The snake_case name of the resource map to get.

Return type

cloudwanderer.aws_interface.models.ResourceMap

property global_service

Alias for field number 2

property global_service_region

Alias for field number 3

property is_default_service: bool

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

property is_global_service: bool

Return whether this service is a global service.

property name

Alias for field number 0

property resource_definition

Alias for field number 1

property service_definition

Alias for field number 4