networkinsights_start_analysis
Initiate analysis of AWS network access scope with specified region and scope ID. Optional dry run checks permissions, tagging allows annotation, and client token ensures request idempotency.
Instructions
Start a Network Access Scope analysis.
Parameters:
aws_region (str): AWS region - use 'us-east-1' if not specified.
scope_id (str): The NetworkInsightsAccessScopeId to analyze.
dry_run (bool): If True, checks permissions without starting.
tag_specifications (list): TagSpecification dicts for annotating the analysis.
client_token (str): Idempotency token for the request.
Returns:
str: JSON representation of the NetworkInsightsAccessScopeAnalysis object.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| aws_region | Yes | ||
| client_token | No | ||
| dry_run | No | ||
| scope_id | Yes | ||
| tag_specifications | No |
Implementation Reference
- server.py:891-926 (handler)The handler function for the 'networkinsights_start_analysis' tool. It starts a Network Access Scope analysis using the EC2 client, constructs parameters based on inputs, calls start_network_insights_access_scope_analysis, and returns the JSON response.@mcp.tool() async def networkinsights_start_analysis( aws_region: str, scope_id: str, dry_run: bool = False, tag_specifications: list[dict] = None, client_token: str = None ) -> str: """ Start a Network Access Scope analysis. Parameters: aws_region (str): AWS region - use 'us-east-1' if not specified. scope_id (str): The NetworkInsightsAccessScopeId to analyze. dry_run (bool): If True, checks permissions without starting. tag_specifications (list): TagSpecification dicts for annotating the analysis. client_token (str): Idempotency token for the request. Returns: str: JSON representation of the NetworkInsightsAccessScopeAnalysis object. """ client = boto3.client('ec2', region_name=aws_region) params = {'NetworkInsightsAccessScopeId': scope_id} if dry_run: params['DryRun'] = True if tag_specifications: params['TagSpecifications'] = [{ 'ResourceType': 'network-insights-access-scope-analysis', 'Tags': tag_specifications }] if client_token: params['ClientToken'] = client_token response = client.start_network_insights_access_scope_analysis(**params) analysis = response.get('NetworkInsightsAccessScopeAnalysis', {}) return json.dumps(analysis, indent=2, cls=DateTimeEncoder)