config_list_discovered_resources
Retrieve a JSON list of resource identifiers discovered by AWS Config in a specified AWS region and resource type, enabling efficient resource management and tracking.
Instructions
List resource identifiers that AWS Config has discovered.
Parameters:
aws_region (str): The AWS region - use 'us-east-1' if not specified.
resource_type (str): e.g. 'AWS::EC2::Instance'.
Returns:
JSON list of resourceIdentifier objects.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| aws_region | Yes | ||
| resource_type | Yes |
Implementation Reference
- server.py:703-720 (handler)The main handler function for the 'config_list_discovered_resources' MCP tool. It is decorated with @mcp.tool(), which registers it in the FastMCP server. The function paginates through AWS Config's list_discovered_resources API to retrieve all resource identifiers of the specified type in the given region and returns them as JSON.@mcp.tool() async def config_list_discovered_resources(aws_region: str, resource_type: str) -> str: """ List resource identifiers that AWS Config has discovered. Parameters: aws_region (str): The AWS region - use 'us-east-1' if not specified. resource_type (str): e.g. 'AWS::EC2::Instance'. Returns: JSON list of resourceIdentifier objects. """ client = boto3.client('config', region_name=aws_region) paginator = client.get_paginator('list_discovered_resources') all_resources = [] for page in paginator.paginate(resourceType=resource_type): all_resources.extend(page.get('resourceIdentifiers', [])) return json.dumps(all_resources, indent=2)