View a markdown version of this page

在 Transit Gateway 中檢視 AWS 傳輸閘道政策表 - Amazon VPC

本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。

在 Transit Gateway 中檢視 AWS 傳輸閘道政策表

您可以檢視傳輸閘道政策表及其項目。

檢視政策資料表

使用主控台檢視傳輸閘道政策表
  1. 在 https://console.aws.amazon.com/vpc/ 開啟 Amazon VPC 主控台。

  2. 在導覽窗格的傳輸閘道下,選擇傳輸閘道政策表。

  3. 若要依傳輸閘道進行篩選,請使用搜尋列並篩選傳輸閘道 ID。

  4. 清單會顯示每個政策資料表的傳輸閘道政策資料表 ID、傳輸閘道 ID 和狀態。

  5. 選取政策資料表,以在詳細資訊頁面上檢視其詳細資訊、關聯和項目。

若要根據每個傳輸閘道限制追蹤您的項目用量,請使用 Service Quotas 主控台。如需詳細資訊,請參閱 配額。

使用 檢視傳輸閘道政策表 AWS CLI

若要列出帳戶上的所有政策資料表,請使用 describe-transit-gateway-policy-tables 命令。

aws ec2 describe-transit-gateway-policy-tables \ --filters "Name=transit-gateway-id,Values=tgw-0bc994abffEXAMPLE"

回應範例:

{ "TransitGatewayPolicyTables": [ { "TransitGatewayPolicyTableId": "tgw-ptb-0ca78a549EXAMPLE", "TransitGatewayId": "tgw-0bc994abffEXAMPLE", "State": "available", "CreationTime": "2026-01-01T00:00:00.000Z", "Tags": [] } ] }

檢視政策資料表項目

使用主控台檢視政策資料表項目
  1. 在傳輸閘道政策資料表中,選取政策資料表。

  2. 選擇項目索引標籤。

  3. 項目索引標籤會顯示具有下列資料欄的所有項目:規則編號、狀態、目標路由表、來源 CIDR 區塊、來源連接埠、目的地 CIDR 區塊、目的地連接埠和通訊協定。系統管理的項目會顯示*為規則號碼。

  4. 若要篩選項目,請使用搜尋列。您可以依規則編號、目標路由表、來源 CIDR、目的地 CIDR、來源連接埠、目的地連接埠或通訊協定進行篩選。

若要檢查每個傳輸閘道限制的總用量,請使用 Service Quotas 主控台。如需詳細資訊,請參閱 配額。

使用 檢視政策資料表項目 AWS CLI

使用 get-transit-gateway-policy-table-entries 命令。

aws ec2 get-transit-gateway-policy-table-entries \ --transit-gateway-policy-table-id tgw-ptb-0ca78a549EXAMPLE

回應範例:

{ "TransitGatewayPolicyTableEntries": [ { "PolicyRuleNumber": "100", "PolicyRule": { "SourceCidrBlock": "10.100.0.0/16", "SourcePortRange": "*", "DestinationCidrBlock": "*", "DestinationPortRange": "443", "Protocol": "6" }, "TargetRouteTableId": "tgw-rtb-0ca78a549EXAMPLE", "State": "active" }, { "PolicyRuleNumber": "*", "PolicyRule": { "SourceCidrBlock": "*", "SourcePortRange": "*", "DestinationCidrBlock": "*", "DestinationPortRange": "*", "Protocol": "*", "MetaData": { "MetaDataKey": "TgwRouteTable", "MetaDataValue": "tgw-rtb-0ca62a892EXAMPLE" } }, "TargetRouteTableId": "tgw-rtb-0ca62a892EXAMPLE", "State": "active" } ] }
支援的篩選條件

支援下列篩選條件GetTransitGatewayPolicyTableEntries。

支援的篩選條件
篩選條件 說明
policy-rule-number 依規則編號篩選
target-route-table-id 依目標路由表 ID 篩選
policy-rule.source-ip 依來源 CIDR 區塊篩選
policy-rule.destination-ip 依目的地 CIDR 區塊篩選
policy-rule.source-port 依來源連接埠範圍篩選
policy-rule.destination-port 依目的地連接埠範圍篩選
policy-rule.protocol 依通訊協定篩選
policy-rule.meta-data.key 依中繼資料金鑰篩選
policy-rule.meta-data.value 依中繼資料值篩選