config_describe_compliance_by_resource
Generate compliance summaries for AWS resources, filterable by type, to monitor and ensure adherence to configuration standards across specified regions.
Instructions
List compliance summaries for resources, optionally filtered by type.
Parameters:
aws_region (str): The AWS region - use 'us-east-1' if not specified.
resource_type (str): optional AWS resource type filter.
Returns:
JSON list of ComplianceByResource objects.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| aws_region | Yes | ||
| resource_type | No |
Input Schema (JSON Schema)
{
"properties": {
"aws_region": {
"title": "Aws Region",
"type": "string"
},
"resource_type": {
"default": null,
"title": "Resource Type",
"type": "string"
}
},
"required": [
"aws_region"
],
"title": "config_describe_compliance_by_resourceArguments",
"type": "object"
}
Implementation Reference
- server.py:763-763 (registration)The @mcp.tool() decorator that registers the config_describe_compliance_by_resource tool.@mcp.tool()
- server.py:764-784 (handler)Handler function that invokes AWS Config service to describe compliance by resource and returns formatted JSON response.async def config_describe_compliance_by_resource( aws_region: str, resource_type: str = None ) -> str: """ List compliance summaries for resources, optionally filtered by type. Parameters: aws_region (str): The AWS region - use 'us-east-1' if not specified. resource_type (str): optional AWS resource type filter. Returns: JSON list of ComplianceByResource objects. """ client = boto3.client('config', region_name=aws_region) params = {} if resource_type: params["ResourceType"] = resource_type resp = client.describe_compliance_by_resource(**params) compliances = resp.get("ComplianceByResources", []) return json.dumps(compliances, indent=2)