

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

# 更新 AWS Transit Gateway 安全群組傳入規則
<a name="tgw-sg-updates-update"></a>

您可以更新與傳輸閘道相關聯的任何傳入安全群組規則。您可以使用 Amazon VPC 主控台或使用命令列或 API 來更新安全群組規則。如需參考安全群組的詳細資訊，請參閱 [安全群組參考](tgw-vpc-attachments.md#vpc-attachment-security)。

**使用主控台更新您的安全群組規則**

1. 在 [https://console.aws.amazon.com/vpc/](https://console.aws.amazon.com/vpc/) 開啟 Amazon VPC 主控台。

1. 在導覽窗格中，選擇**安全群組**。

1. 選取安全群組，然後選擇**動作**、**編輯傳入規則**以修改傳入規則。

1. 若要新增規則，請選擇**新增規則**，然後指定類型、通訊協定和連接埠範圍。對於**來源** （傳入規則），在連接到傳輸閘道的 VPC 中輸入安全群組的 ID。
**注意**  
連接到傳輸閘道的 VPC 中的安全群組不會自動顯示。

1. 若要編輯現有規則，請變更其值 (例如來源或描述)。

1. 若要刪除規則，請選擇規則旁邊的**刪除**。

1. 選擇**儲存規則**。

**使用命令列更新傳入規則**
+ [authorize-security-group-ingress](https://docs.aws.amazon.com/cli/latest/reference/ec2/authorize-security-group-ingress.html) (AWS CLI)
+ [Grant-EC2SecurityGroupIngress](https://docs.aws.amazon.com/powershell/latest/reference/items/Grant-EC2SecurityGroupIngress.html) (AWS Tools for Windows PowerShell)
+ [Revoke-EC2SecurityGroupIngress](https://docs.aws.amazon.com/powershell/latest/reference/items/Revoke-EC2SecurityGroupIngress.html) (AWS Tools for Windows PowerShell)
+ [revoke-security-group-ingress](https://docs.aws.amazon.com/cli/latest/reference/ec2/revoke-security-group-ingress.html) (AWS CLI)