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.
- class IdPartSpecification(path, regex_pattern)
Specification for getting the ID parts of a resource’s relationship with another resource.
- get_urn_parts(data)
Return id parts from a given data dict.
- property path
The path to the ID Part
- property regex_pattern
The regex pattern to apply to the ID part to extract the URN
- class RelationshipSpecification(base_path, id_parts, service, resource_type, region_source, account_id_source, direction)
Specification for a relationship between two resources.
- Parameters
base_path (str) –
id_parts (List[cloudwanderer.aws_interface.models.IdPartSpecification]) –
service (str) –
resource_type (str) –
region_source (cloudwanderer.models.RelationshipRegionSource) –
account_id_source (cloudwanderer.models.RelationshipAccountIdSource) –
direction (cloudwanderer.models.RelationshipDirection) –
- property account_id_source
The source for determining the account id of the partner resource
- property base_path
The base path to the id parts
- property direction
The direction of the relationship. Whether the resource HAS the partner resource (outbound) or the partner resource HAS the resource (inbound)
- property id_parts
The specifications for the parts of relationship partner resource’s URN
- property region_source
The source for determining the region of the partner resource
- property resource_type
The resource type of the partner resource
- property service
The service name of the partner resource
- 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
name (str) –
type (Optional[str]) –
id_uniqueness_scope (cloudwanderer.models.ResourceIdUniquenessScope) –
region_request (Optional[cloudwanderer.aws_interface.models.ResourceRegionRequest]) –
default_aws_resource_type_filter (cloudwanderer.aws_interface.models.AWSResourceTypeFilter) –
service_map (cloudwanderer.aws_interface.models.ServiceMap) –
relationships (List[cloudwanderer.aws_interface.models.RelationshipSpecification]) –
secondary_attribute_maps (List[cloudwanderer.aws_interface.models.SecondaryAttributeMap]) –
urn_overrides (List[cloudwanderer.aws_interface.models.IdPartSpecification]) –
regional_resource (bool) –
requires_load (bool) –
- 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.
- 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[cloudwanderer.aws_interface.models.ResourceRegionRequestParam]) –
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
- property default_value
The value to use if no region is found
- property operation
The (snake_case) name of the botocore client operation to call
- property params
The parameters to the request
- property path_to_region
The path of to the region value in the request response
- class ResourceRegionRequestParam(target, source, name)
Specification for a request param data model.
- property name
The name of the attribute to pull the value from
- property source
The source for the value of the argument (e.g.
resourceAttribute
)
- property target
The name of the argument to supply
- class SecondaryAttributeMap(source_path, destination_name)
Specification for mapping attributes contained in a secondary attribute to its parent’s resource.
- 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
- 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
- property global_service
Whether or not it is a global service
- property global_service_region
If it is a global service, what region is its primary region
- property is_default_service: bool
Return True if this service has no definition and should return default values.
- property name
The name of the service
- property resource_definition
The raw definition of the resources in this service
- property service_definition
The raw service definition