AWS VPC Direct Connect 路由学习监控系统
在现代企业的数字化转型过程中,混合云架构已经成为连接本地数据中心与云端资源的主流选择。AWS Direct Connect 作为这一架构的核心纽带,为企业提供了稳定、高速的专线连接。随着业务规模的不断扩张和网络复杂度的增加,主动监控和管理各项技术限制变得至关重要。对于大部分 AWS 服务配额,我们可以通过 Service Quotas 控制台、CloudWatch 指标进行常规监控,相关方法可参考 Service Quotas 用户指南和 CloudWatch 配额监控文档。然而某些特定的指标技术限制(如 VPC 路由表通过 BGP 学习到的路由条目数)目前还没有直接可用的监控指标。
本文将为您介绍一个基于 AWS 原生服务构建的智能化路由监控解决方案,它不仅能够实时监控您的 VPC 路由状态,还能在潜在问题发生之前主动发出预警,让您始终掌控网络的健康状态。
设计理念
监控系统采用了 AWS 的无服务器架构,充分利用了云原生服务的优势,24 小时不间断地监控着您的 VPC 路由状态。
模版中的 Lambda 函数,它定期执行路由检查任务。这个函数采用了去重算法,确保即使同一条路由出现在多个路由表中,也只会被计算一次。这种设计避免了重复计数可能导致的误报,确保监控数据的准确性。
系统采用了双阈值预警机制。当路由使用率达到第一个阈值(默认 60%)时,系统会发送中等级别的预警,提醒运维人员关注路由状态;当使用率达到第二个阈值(默认 80%)时,系统会发送高级别的预警,建议立即采取行动。这种渐进式的预警机制给了运维团队充足的时间来规划和执行优化措施。
注意:本文方案适合采用 ** **VGW ** **通过动态学习机制,利用 ** **DX ** **线路的 ** **BGP ** **协议学习的路由,并自动传播到 ** **VPC ** **子网路由表的环境。
技术架构
Amazon EventBridge 负责按照预设的时间间隔触发监控任务。您可以根据业务需求灵活配置监控频率,从每 5 分钟一次的高频监控到每天一次的日常检查(更多的设置可自行调整 CloudFromation 模版),系统都能完美支持。对于大多数企业来说,每小时或者半小时的监控频率既能及时发现问题,又不会产生过多的成本。
AWS Lambda 承担着最核心的监控逻辑,查询 VPC 路由信息,识别 Direct Connect 传播的路由,并进行准确的统计分析。
Amazon SNS 负责将监控结果和预警信息及时传达给相关人员。预警邮件不仅包含简洁的摘要信息,还提供了详细的路由列表和具体的优化建议,帮助运维人员快速理解当前状况并采取相应措施。
AWS IAM 严格遵循最小权限原则,确保整个监控过程的安全性,Lambda 函数只被授予查询路由表和发送 SNS 通知的必要权限,最大程度地降低了安全风险。
让我们来看一个实际的监控流程:每当 EventBridge 触发 Lambda 函数时,函数首先会调用 EC2 API 获取指定 VPC 的所有路由表信息。然后,它会遍历每个路由表中的路由条目,识别出那些 Origin 标为”EnableVgwRoutePropagation”的路由——这些就是通过 Direct Connect 传播的路由。
统计完成后,函数会计算当前的路由使用率,并与预设的阈值进行比较。如果使用率超过了任何一个阈值,系统就会生成详细的预警报告。这个报告不仅包含数字统计,还会列出具体的路由信息,包括目标网段、路由表 ID、目标类型等详细信息,帮助运维人员快速定位和分析问题。
实战部署
部署这个监控系统的过程被设计得尽可能简单和直观。整个系统通过一个 CloudFormation 模板进行定义,这意味着您可以通过几个简单的命令就完成整个系统的部署。
首先您需要准备一些基本信息:要监控的 VPC-ID、接收预警通知的邮箱地址、路由数量限制以及期望的监控频率。这些参数都可以在部署时进行配置,也可以在后续根据需要进行调整。
可以通过 WEB 界面直接部署:
1. 下载
CloudFormation 内容到本地,并保存为 yaml 格式
AWSTemplateFormatVersion: ‘2010-09-09’
Description: ‘VPC Direct Connect Route Monitor with AI-powered route aggregation analysis’
Parameters:
VpcId:
Type: AWS::EC2::VPC::Id
Description: Select the VPC to monitor for DX propagated routes
MaxRoutes:
Type: Number
Default: 100
MinValue: 1
MaxValue: 1000
Description: Maximum number of routes limit (default 100)
WarningThreshold1:
Type: Number
Default: 60
MinValue: 1
MaxValue: 100
Description: First warning threshold percentage (default 60%)
WarningThreshold2:
Type: Number
Default: 80
MinValue: 1
MaxValue: 100
Description: Second warning threshold percentage (default 80%)
MonitoringFrequency:
Type: String
Default: ‘1 hour’
AllowedValues:
- ‘5 minutes’
- ’10 minutes’
- ’30 minutes’
- ‘1 hour’
- ‘1 day’
Description: How often to check the route count (default 1 hour)
NotificationEmail:
Type: String
Description: Email address to receive alert notifications
AllowedPattern: ‘^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$’
ConstraintDescription: Please enter a valid email address
EnableAIAnalysis:
Type: String
Default: ‘false’
AllowedValues:
- ‘true’
- ‘false’
Description: Enable AI-powered route aggregation analysis using Amazon Bedrock Nova Lite
BedrockRegion:
Type: String
Default: ‘us-east-1’
AllowedValues:
- ‘us-east-1’
- ‘us-west-2’
- ‘eu-west-1’
- ‘ap-southeast-1’
- ‘ap-northeast-1’
- ‘eu-north-1’
Description: AWS region where Bedrock is available (default us-east-1)
Conditions:
Is5Minutes: !Equals [!Ref MonitoringFrequency, ‘5 minutes’]
Is10Minutes: !Equals [!Ref MonitoringFrequency, ’10 minutes’]
Is30Minutes: !Equals [!Ref MonitoringFrequency, ’30 minutes’]
Is1Day: !Equals [!Ref MonitoringFrequency, ‘1 day’]
AIAnalysisEnabled: !Equals [!Ref EnableAIAnalysis, ‘true’]
Resources:
AlertTopic:
Type: AWS::SNS::Topic
Properties:
TopicName: !Sub ‘${AWS::StackName}-vpc-dx-route-alerts’
DisplayName: ‘VPC DX Route Monitor Alerts’
EmailSubscription:
Type: AWS::SNS::Subscription
Properties:
TopicArn: !Ref AlertTopic
Protocol: email
Endpoint: !Ref NotificationEmail
LambdaExecutionRole:
Type: AWS::IAM::Role
Properties:
AssumeRolePolicyDocument:
Version: ‘2012-10-17’
Statement:
- Effect: Allow
Principal:
Service: lambda.amazonaws.com
Action: sts:AssumeRole
ManagedPolicyArns:
- arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole
Policies:
- PolicyName: VPCRouteMonitoringPolicy
PolicyDocument:
Version: ‘2012-10-17’
Statement:
- Effect: Allow
Action:
- ec2:DescribeRouteTables
- ec2:DescribeVpcs
Resource: ‘*’
- Effect: Allow
Action:
- sns:Publish
Resource: !Ref AlertTopic
- !If
- AIAnalysisEnabled
- PolicyName: BedrockAccessPolicy
PolicyDocument:
Version: ‘2012-10-17’
Statement:
- Effect: Allow
Action:
- bedrock:InvokeModel
Resource: !Sub ‘arn:aws:bedrock:${BedrockRegion}::foundation-model/amazon.nova-lite-v1:0’
- !Ref ‘AWS::NoValue’
RouteMonitorFunction:
Type: AWS::Lambda::Function
Properties:
FunctionName: !Sub ‘${AWS::StackName}-vpc-dx-route-monitor’
Runtime: python3.9
Handler: index.lambda_handler
Role: !GetAtt LambdaExecutionRole.Arn
Timeout: 600
MemorySize: 512
Description: ‘Monitor VPC DX propagated routes with optional AI analysis’
Environment:
Variables:
VPC_ID: !Ref VpcId
MAX_ROUTES: !Ref MaxRoutes
WARNING_THRESHOLD_1: !Ref WarningThreshold1
WARNING_THRESHOLD_2: !Ref WarningThreshold2
SNS_TOPIC_ARN: !Ref AlertTopic
ENABLE_AI_ANALYSIS: !Ref EnableAIAnalysis
BEDROCK_REGION: !Ref BedrockRegion
Code:
ZipFile: |
使用 AI 构建 AWS VPC Direct Connect 路由监控系统
“””
AWS VPC DX路由监控Lambda函数 – AI增强版本
支持通过Amazon Bedrock Nova Lite进行路由聚合分析
“””
import boto3
import json
import os
from datetime import datetime
from typing import Dict, List, Any, Set, Tuple, Optional
def lambda_handler(event, context):
“””Lambda主函数”””
try:
vpc_id = os.environ.get(‘VPC_ID’)
max_routes = int(os.environ.get(‘MAX_ROUTES’, ‘100’))
warning_threshold_1 = int(os.environ.get(‘WARNING_THRESHOLD_1′, ’60’))
warning_threshold_2 = int(os.environ.get(‘WARNING_THRESHOLD_2′, ’80’))
sns_topic_arn = os.environ.get(‘SNS_TOPIC_ARN’)
enable_ai_analysis = os.environ.get(‘ENABLE_AI_ANALYSIS’, ‘false’).lower() == ‘true’
bedrock_region = os.environ.get(‘BEDROCK_REGION’, ‘us-east-1’)
if not vpc_id or not sns_topic_arn:
raise ValueError(“缺少必要的环境变量”)
查询DX传播的路由
route_info = query_dx_propagated_routes(vpc_id)
if route_info is None:
send_error_notification(sns_topic_arn, vpc_id, “查询路由失败”)
return {‘statusCode’: 500, ‘body’: json.dumps({‘error’: ‘查询路由失败’})}
计算使用百分比
current_routes = route_info[‘unique_dx_routes’]
usage_percentage = (current_routes / max_routes) * 100
AI分析(如果启用)
ai_analysis = None
if enable_ai_analysis and current_routes > 0:
try:
ai_analysis = analyze_routes_with_ai(route_info[‘unique_routes’], bedrock_region)
print(“AI分析完成”)
except Exception as e:
print(f”AI分析失败: {e}”)
ai_analysis = {“error”: f”AI分析失败: {str(e)}”}
检查预警
should_alert = False
alert_level = None
if usage_percentage >= warning_threshold_2:
should_alert = True
alert_level = ‘HIGH’
elif usage_percentage >= warning_threshold_1:
should_alert = True
alert_level = ‘MEDIUM’
发送预警
if should_alert:
send_alert_notification(
sns_topic_arn, vpc_id, current_routes, max_routes,
usage_percentage, alert_level, route_info[‘unique_routes’], ai_analysis
)
result = {
‘vpc_id’: vpc_id,
‘unique_dx_routes’: current_routes,
‘max_routes’: max_routes,
‘usage_percentage’: round(usage_percentage, 2),
‘alert_sent’: should_alert,
‘alert_level’: alert_level,
‘ai_analysis_enabled’: enable_ai_analysis,
‘ai_analysis_status’: ‘completed’ if ai_analysis and ‘error’ not in ai_analysis else ‘failed’ if ai_analysis else ‘disabled’,
‘timestamp’: datetime.now().isoformat()
}
print(f”监控结果: {json.dumps(result, ensure_ascii=False)}”)
return {‘statusCode’: 200, ‘body’: json.dumps(result, ensure_ascii=False)}
except Exception as e:
error_msg = f”Lambda执行失败: {str(e)}”
print(error_msg)
try:
if ‘sns_topic_arn’ in locals():
send_error_notification(sns_topic_arn, vpc_id if ‘vpc_id’ in locals() else ‘Unknown’, str(e))
except:
pass
return {‘statusCode’: 500, ‘body’: json.dumps({‘error’: error_msg})}
def query_dx_propagated_routes(vpc_id: str) -> Dict[str, Any]:
“””查询VPC中通过DX传播的路由条目”””
try:
ec2_client = boto3.client(‘ec2’)
response = ec2_client.describe_route_tables(
Filters=[{‘Name’: ‘vpc-id’, ‘Values’: [vpc_id]}]
)
route_tables = response.get(‘RouteTables’, [])
if not route_tables:
print(f”未找到VPC {vpc_id} 的路由表”)
return None
if response.get(‘NextToken’):
print(“警告: 检测到分页,可能需要升级到完整版本”)
使用Set去重
unique_dx_routes: Set[Tuple[str, str, str]] = set()
unique_routes_list = []
for rt in route_tables:
rt_id = rt[‘RouteTableId’]
routes = rt.get(‘Routes’, [])
for route in routes:
if route.get(‘Origin’) == ‘EnableVgwRoutePropagation’:
destination = route.get(‘DestinationCidrBlock’) or route.get(‘DestinationIpv6CidrBlock’, ‘未知’)
target_type, target_value = get_route_target(route)
route_key = (destination, target_type, target_value)
if route_key not in unique_dx_routes:
unique_dx_routes.add(route_key)
unique_routes_list.append({
‘route_table_id’: rt_id,
‘destination’: destination,
‘target_type’: target_type,
‘target_value’: target_value,
‘state’: route.get(‘State’, ‘未知’)
})
return {
‘unique_dx_routes’: len(unique_dx_routes),
‘unique_routes’: unique_routes_list
}
except Exception as e:
print(f”查询DX路由失败: {e}”)
return None
def analyze_routes_with_ai(routes: List[Dict], bedrock_region: str) -> Optional[Dict]:
“””使用Amazon Bedrock Nova Lite分析路由聚合”””
try:
bedrock_client = boto3.client(‘bedrock-runtime’, region_name=bedrock_region)
准备路由数据
route_data = []
for route in routes:
route_data.append({
‘destination’: route[‘destination’],
‘target_type’: route[‘target_type’],
‘target_value’: route[‘target_value’],
‘state’: route[‘state’]
})
构建AI提示
prompt = f”””你是一个AWS网络专家,请分析以下Direct Connect传播的路由,并提供路由聚合建议。
当前路由列表(共{len(routes)}条):
{json.dumps(route_data, indent=2, ensure_ascii=False)}
请分析并提供以下内容:
1. 路由聚合机会分析
2. 具体的CIDR聚合建议
3. 预期的路由数量减少
4. 实施建议和注意事项
5. 风险评估
请用中文回答,格式要清晰易读。”””
调用Nova Lite
request_body = {
“messages”: [
{
“role”: “user”,
“content”: [
{
“text”: prompt
}
]
}
],
“inferenceConfig”: {
“max_new_tokens”: 4000,
“temperature”: 0.1
}
}
response = bedrock_client.invoke_model(
modelId=’amazon.nova-lite-v1:0′,
body=json.dumps(request_body)
)
response_body = json.loads(response[‘body’].read())
ai_analysis = response_body[‘output’][‘message’][‘content’][0][‘text’]
return {
‘analysis’: ai_analysis,
‘route_count’: len(routes),
‘analysis_timestamp’: datetime.now().isoformat(),
‘model_used’: ‘Amazon Nova Lite’
}
except Exception as e:
print(f”AI分析失败: {e}”)
return {“error”: str(e)}
def get_route_target(route: Dict) -> tuple:
“””获取路由目标类型和值”””
if ‘VirtualPrivateGatewayId’ in route:
return ‘vpn-gateway’, route[‘VirtualPrivateGatewayId’]
elif ‘TransitGatewayId’ in route:
return ‘transit-gateway’, route[‘TransitGatewayId’]
elif ‘DirectConnectGatewayId’ in route:
return ‘dx-gateway’, route[‘DirectConnectGatewayId’]
elif ‘GatewayId’ in route:
return ‘gateway’, route[‘GatewayId’]
elif ‘NatGatewayId’ in route:
return ‘nat-gateway’, route[‘NatGatewayId’]
elif ‘NetworkInterfaceId’ in route:
return ‘network-interface’, route[‘NetworkInterfaceId’]
elif ‘InstanceId’ in route:
return ‘instance’, route[‘InstanceId’]
else:
return ‘unknown’, ‘unknown’
def send_alert_notification(sns_topic_arn: str, vpc_id: str, current_routes: int,
max_routes: int, usage_percentage: float, alert_level: str,
routes: List[Dict], ai_analysis: Optional[Dict] = None):
“””发送预警通知(包含AI分析)”””
try:
sns_client = boto3.client(‘sns’)
subject = f”🚨 VPC DX路由预警 – {alert_level} 级别 ({usage_percentage:.1f}%)”
if ai_analysis and ‘error’ not in ai_analysis:
subject += ” [含AI分析]”
message_lines = [
f”VPC Direct Connect 路由监控预警”,
f””,
f”📊 监控摘要:”,
f” VPC ID: {vpc_id}”,
f” 当前DX传播路由数: {current_routes}”,
f” 最大路由限制: {max_routes}”,
f” 使用百分比: {usage_percentage:.2f}%”,
f” 预警级别: {alert_level}”,
f” 检查时间: {datetime.now().strftime(‘%Y-%m-%d %H:%M:%S UTC’)}”,
f””,
f”🔍 DX传播路由详情:”
]
if routes:
message_lines.append(f” {‘目标网段’:<18} {'目标类型':<15} {'目标值':<25}")
message_lines.append(f” {‘-‘*18} {‘-‘*15} {‘-‘*25}”)
for route in routes[:15]: # 限制显示数量,为AI分析留空间
message_lines.append(
f” {route[‘destination’]:<18} {route['target_type']:<15} {route['target_value']:<25}"
)
if len(routes) > 15:
message_lines.append(f” … 还有 {len(routes) – 15} 条路由未显示”)
添加AI分析结果
if ai_analysis:
message_lines.extend([
f””,
f”🤖 AI路由聚合分析 (Amazon Nova Lite):”,
f”{‘=’*60}”
])
if ‘error’ in ai_analysis:
message_lines.append(f”AI分析失败: {ai_analysis[‘error’]}”)
else:
将AI分析结果按行分割并添加适当的缩进
analysis_lines = ai_analysis[‘analysis’].split(‘\n’)
for line in analysis_lines:
if line.strip():
message_lines.append(f”{line}”)
else:
message_lines.append(“”)
message_lines.extend([
f””,
f”分析时间: {ai_analysis.get(‘analysis_timestamp’, ‘Unknown’)}”,
f”使用模型: {ai_analysis.get(‘model_used’, ‘Unknown’)}”
])
message_lines.extend([
f””,
f”⚠️ 建议操作:”,
f” – 检查是否有不必要的路由传播”,
f” – 考虑优化路由聚合”,
f” – 如需增加路由限制,请联系AWS支持”
])
if ai_analysis and ‘error’ not in ai_analysis:
message_lines.append(f” – 参考上述AI分析建议进行路由优化”)
message_lines.append(f”\n此消息由AWS Lambda自动生成”)
sns_client.publish(
TopicArn=sns_topic_arn,
Subject=subject,
Message=”\n”.join(message_lines)
)
print(“预警通知已发送”)
except Exception as e:
print(f”发送预警通知失败: {e}”)
def send_error_notification(sns_topic_arn: str, vpc_id: str, error_message: str):
“””发送错误通知”””
try:
sns_client = boto3.client(‘sns’)
subject = f”❌ VPC DX路由监控错误 – {vpc_id}”
message = f”””VPC Direct Connect 路由监控执行错误
错误信息:
VPC ID: {vpc_id}
错误消息: {error_message}
发生时间: {datetime.now().strftime(‘%Y-%m-%d %H:%M:%S UTC’)}
请检查Lambda函数配置和权限设置。”””
sns_client.publish(
TopicArn=sns_topic_arn,
Subject=subject,
Message=message
)
except Exception as e:
print(f”发送错误通知失败: {e}”)
ScheduleRule:
Type: AWS::Events::Rule
Properties:
Name: !Sub ‘${AWS::StackName}-vpc-dx-route-monitor-schedule’
Description: ‘Schedule trigger for VPC DX route monitoring’
ScheduleExpression: !If
- Is5Minutes
- ‘rate(5 minutes)’
- !If
- Is10Minutes
- ‘rate(10 minutes)’
- !If
- Is30Minutes
- ‘rate(30 minutes)’
- !If
- Is1Day
- ‘rate(1 day)’
- ‘rate(1 hour)’
State: ENABLED
Targets:
- Arn: !GetAtt RouteMonitorFunction.Arn
Id: ‘RouteMonitorTarget’
LambdaInvokePermission:
Type: AWS::Lambda::Permission
Properties:
FunctionName: !Ref RouteMonitorFunction
Action: lambda:InvokeFunction
Principal: events.amazonaws.com
SourceArn: !GetAtt ScheduleRule.Arn
LambdaLogGroup:
Type: AWS::Logs::LogGroup
Properties:
LogGroupName: !Sub ‘/aws/lambda/${RouteMonitorFunction}’
RetentionInDays: 14
Outputs:
LambdaFunctionName:
Description: ‘Lambda function name for VPC DX route monitoring’
Value: !Ref RouteMonitorFunction
SNSTopicArn:
Description: ‘SNS topic ARN for alert notifications’
Value: !Ref AlertTopic
MonitoredVPC:
Description: ‘VPC ID being monitored’
Value: !Ref VpcId
AIAnalysisEnabled:
Description: ‘Whether AI analysis is enabled’
Value: !Ref EnableAIAnalysis
BedrockRegion:
Description: ‘Bedrock region for AI analysis’
Value: !Ref BedrockRegion
Condition: AIAnalysisEnabled
2. 去网站控制台
CloudFormation 功能,上传刚才创建的 CloudFormation.yaml 文件
3. 输入监控必须项目,填写预警所需邮箱(选择已经学习 DX 路由的 VPC),并点击下一步
4. 勾选我确认,同意系统所需最小授权,并点击下一步完成堆栈部署
部署完成后,系统会自动开始工作。您会收到一封来自 Amazon SNS 的订阅确认邮件,确认后就能开始接收监控通知了。整个过程通常在几分钟内就能完成。
在实际的生产环境中,我建议您根据业务的重要性和网络的复杂程度来调整监控参数。对于关键的生产环境,可以将监控频率设置为半小时或 1 小时,并将预警阈值设置得相对保守一些,比如 50% 和 70%。对于测试环境,可以适当放宽阈值并降低监控频率,以节省成本。
值得注意的是,系统的运营成本非常低廉。以每小时监控频次为例,每月的总成本通常不超过几美元,这对于大多数企业来说几乎可以忽略不计。这种成本效益使得即使是小型企业也能轻松承担这样的监控系统。
预警机制
设置了两个预警点,您可以通过较低点的预警,通过长期的监控数据,分析路由数量的变化趋势,识别出哪些时间段路由数量增长较快,哪些网络段的路由传播最为频繁。这些信息对于网络规划和容量管理具有重要价值。
因为使用了 Lambda 作为扫描工具,系统扩展较为轻松。您可以轻松地将监控范围扩展到多个 VPC,或者集成 Slack 等即时通讯工具来接收预警通知。对于有特殊需求的企业,还可以在 Lambda 函数中添加自定义的分析逻辑,比如按照网络段类型进行分类统计,或者与 CMDB 系统集成来获取更丰富的上下文信息。
在实际运维过程中,建议建立一套标准的响应流程。当收到中等级别预警时,可以安排在下一个维护窗口进行路由优化;当收到高级别预警时,应该立即评估是否需要采取紧急措施。定期回顾预警历史和处理记录,可以帮助团队不断改进网络架构和监控策略。
当系统检测到路由使用率超过预设阈值时,它会生成一份详细而实用的预警报告,不仅提供了必要的统计信息,还包含了具体的优化建议。
常规预警邮件示例:
🚨 VPC DX路由预警 – 级别 HIGH (85.0%)
📊 监控摘要:
VPC ID: vpc-[已去除电话]
当前DX传播路由数: 85
最大路由限制: 100
使用百分比: 85.00%
预警级别: HIGH
检查时间: 2024-07-04 06:00:00 UTC
🔍 DX传播路由详情:
目标网段 路由表ID 目标类型 目标值 状态
10.1.0.0/24 rtb-abc123 vgw vgw-xyz789 active
10.2.0.0/24 rtb-abc123 vgw vgw-xyz789 active
…
⚠️ 建议操作:
- 检查是否有不必要的路由传播
- 考虑优化路由聚合,将多个小网段合并为较大的网段
- 评估是否可以移除一些不再使用的网络段
- 如需增加路由限制,请联系AWS支持团队
- 考虑使用Transit Gateway来优化网络架构
通过大模型优化
通过 Nova 大模型进行运维能力优化
Amazon Nova 是新一代基础模型,能够提供前沿情报和行业领先的性价比,可在 Amazon Bedrock 上使用。Amazon Nova 模型包含四种理解模型、两种创意内容生成模型和一种语音转语音模型。通过与 Amazon Bedrock 的无缝集成,开发人员可以使用 Amazon Nova 基础模型来构建和扩展生成式人工智能应用程序。要开始使用 Amazon Nova 进行构建,必须使用 Amazon Bedrock 通过 API 访问模型。
在模版创建的过程中,您可以勾选大模型分析功能,本文将采用成本较低的 Nova Lite 进行意见总结,详情见下图:
在模版创建的过程中,可以勾选 Nova 大模型进行路由聚合计算,精准进行路由层面的分析,检查路由信息提供聚合意见:
📊 监控摘要:
VPC ID: vpc-0fdb6792d7643d42e
当前DX传播路由数: 17
最大路由限制: 20
使用百分比: 85.00%
预警级别: HIGH
检查时间: 2025-07-25 09:17:02 UTC
🔍 DX传播路由详情:
目标网段 目标类型 目标值
—————— ————— ————————-
200.1.6.0/24 gateway vgw-0ccfb055a11d6827f
200.1.7.0/24 gateway vgw-0ccfb055a11d6827f
200.1.8.0/24 gateway vgw-0ccfb055a11d6827f
200.1.9.0/24 gateway vgw-0ccfb055a11d6827f
200.1.10.0/24 gateway vgw-0ccfb055a11d6827f
200.1.11.0/24 gateway vgw-0ccfb055a11d6827f
210.1.12.0/24 gateway vgw-0ccfb055a11d6827f
210.1.13.0/24 gateway vgw-0ccfb055a11d6827f
210.1.14.0/24 gateway vgw-0ccfb055a11d6827f
210.1.15.0/24 gateway vgw-0ccfb055a11d6827f
210.1.16.0/24 gateway vgw-0ccfb055a11d6827f
210.1.17.0/24 gateway vgw-0ccfb055a11d6827f
100.1.1.0/24 gateway vgw-0ccfb055a11d6827f
100.1.2.0/24 gateway vgw-0ccfb055a11d6827f
100.1.3.0/24 gateway vgw-0ccfb055a11d6827f
… 还有 2 条路由未显示
🤖 AI路由聚合分析 (Amazon Nova Lite):
============================================================
路由聚合分析与建议
1. 路由聚合机会分析
当前的路由列表中,所有的目的地网段都是 /24 的单独网段,且都通过同一个虚拟网关(vgw-0ccfb055a11d6827f)进行路由。这种情况下,存在显著的路由聚合机会。通过聚合这些 /24 网段,可以减少路由表的大小,提高路由效率。
2. 具体的CIDR聚合建议
根据当前的路由列表,可以将这些 /24 网段进行聚合。以下是具体的聚合建议:
- **200.1.6.0/21**:包含 200.1.6.0/24 到 200.1.11.0/24
- **210.1.12.0/21**:包含 210.1.12.0/24 到 210.1.17.0/24
- **100.1.1.0/21**:包含 100.1.1.0/24 到 100.1.5.0/24
3. 预期的路由数量减少
通过上述聚合,原来的 17 条 /24 路由可以减少为 3 条 /21 路由,从而显著减少路由表的大小。
成本分析
从成本效益的角度来看,这个监控解决方案体现了云计算”按需付费”的优势。整个系统的月度运营成本通常不超过几美元美元,但它能够预防的潜在损失却可能是这个成本的数千倍甚至数万倍。
考虑一个实际的场景:如果因为路由数量超限导致关键业务系统小时级中断,对于一个中型企业来说,直接的业务损失可能就达到数万元。更不用说由此可能引发的客户投诉、声誉损失的风险。相比之下每月几十元钱的监控成本简直微不足道。
更重要的是,这个系统能够帮助运维团队从被动响应转向主动预防,显著提升运维效率和服务质量。运维人员不再需要定期手动检查路由状态,也无需担心在关键时刻遗漏重要的网络问题。
总结
对于正在使用或计划使用 AWS Direct Connect 的企业来说,部署这样一个监控系统应该是网络架构规划中的必选项。它不仅能够保障网络的稳定运行,还能为未来的网络扩展和优化提供有价值的数据支持。
*前述特定亚马逊云科技生成式人工智能相关的服务目前在亚马逊云科技海外区域可用。亚马逊云科技中国区域相关云服务由西云数据和光环新网运营,具体信息以中国区域官网为准。