-
-
Notifications
You must be signed in to change notification settings - Fork 60
Resource files structure
The provided YAML files are configuration files that outlines the structure and details for managing an inventory of AWS resources using boto3, the AWS SDK for Python. The file uses a hierarchical structure with indentation to represent different levels of information.
At the top level, the file defines resource names, such as apprunner or autoscaling. Each resource has several associated keys that provide specific details about the resource. The region_type key indicates whether the service is available locally (local) or globally (global). The boto_resource_name key specifies the name of the boto3 resource used to interact with the service, which is typically the service name in the AWS SDK but may differ in some cases. The category key groups resources into categories like 'Compute' for EC2 or 'Storage' for EFS, FSx, Glacier, etc.
The inventory_nodes key contains a list of functions to call to retrieve the inventory of the service. Each node represents a resource type, such as Services for apprunner. Within each node, there are keys like permissions, which lists the permissions required to call the function, and function, which specifies the function to call to get the inventory of the resource.
Additionally, the configuration can include one or more detail functions to fetch more detailed information about the items returned by the inventory function. Each detail function is represented as a dictionary with keys such as permissions (listing the required permissions), item_search_id (the key in the item used as an identifier), detail_function (the function to call for detailed inventory), and detail_param (the parameter to use when calling the detailed inventory functions).
The first level of the file is the resource name.
-
region_type: The type of region where the service is available (localorglobal). -
boto_resource_name: The name of the boto3 resource to use to interact with the service. This is generally the name of the service in the AWS SDK, but it may differ. -
category: A name to group the resource in the final inventory. Examples includeComputeforec2,Storageforefs,fsx,glacier, etc.
inventory_nodes is a list of functions to call to get the inventory of the service. Most of the time, there will be only one function to call, but more can be added if needed.
The first level of the node is the resource name (e.g., Buckets, Topics, Attributes...).
-
permissions: The list of permissions needed to call the function. -
function: The function to call to get the inventory of the resource.
One or more detail functions can be called to get more details about the items returned by the inventory function. Each detail function is a dictionary with the following keys:
The first node is the object type (the key used to access the object in the response).
-
permissions: The list of permissions needed to call the function. -
item_search_id: The key in the item to use as an identifier for the detailed inventory functions. -
detail_function: The function to call to get the detailed inventory. -
detail_param: The parameter to use to call the detailed inventory functions.
|-- resource_name (e.g., apprunner, autoscaling)
|
|-- region_type: <local|global>
|
|-- boto_resource_name: <boto3_resource_name>
|
|-- category: <category_name>
|
|-- inventory_nodes:
|
|-- node_name (e.g., Services)
|
|-- permissions: <list_of_permissions>
|
|-- function: <function_name>
|
|-- details:
|
|-- detail_node_name (e.g., Service)
|
|-- permissions: <list_of_permissions>
|
|-- item_search_id: <item_identifier_key>
|
|-- detail_function: <detail_function_name>
|
|-- detail_param: <detail_parameter>
apprunner:
region_type: local
boto_resource_name: apprunner
category: Compute
inventory_nodes:
Services:
permissions: ListServices
function: list_services
details:
Service:
permissions: DescribeService
item_search_id: ServiceArn
detail_function: describe_service
detail_param: ServiceArn
autoscaling:
region_type: local
boto_resource_name: autoscaling
category: Compute
inventory_nodes:
AutoScalingGroups:
permissions: DescribeAutoScalingGroups
function: describe_auto_scaling_groups
LaunchConfigurations:
permissions: DescribeLaunchConfigurations
function: describe_launch_configurations
batch:
region_type: local
boto_resource_name: batch
category: Compute
inventory_nodes:
JobQueues:
permissions: DescribeJobQueues
function: describe_job_queues
JobDefinitions:
permissions: DescribeJobDefinitions
function: describe_job_definitions
# ... other resources follow the same structure ...