本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。
安全群組 | 建立 (需要檢閱)
建立安全群組,並選擇性地將其與 AWS 資源建立關聯。
完整分類:部署 | 進階堆疊元件 | 安全群組 | 建立 (需要檢閱)
變更類型詳細資訊
變更類型 ID |
ct-1oxx2g2d7hc90 |
目前版本 |
2.0 |
預期的執行持續時間 |
240 分鐘 |
AWS 核准 |
必要 |
客戶核准 |
如果提交者則不需要 |
執行模式 |
手動 |
其他資訊
建立安全群組 (需要檢閱)
AMS 主控台中此變更類型的螢幕擷取畫面:
運作方式:
導覽至建立 RFC 頁面:在 AMS 主控台的左側導覽窗格中,按一下 RFCs以開啟 RFCs清單頁面,然後按一下建立 RFC。
在預設瀏覽變更類型檢視中選擇熱門的變更類型 (CT),或在依類別選擇檢視中選擇 CT。
依變更類型瀏覽:您可以在快速建立區域中按一下熱門的 CT,以立即開啟執行 RFC 頁面。請注意,您無法透過快速建立選擇較舊的 CT 版本。
若要排序 CTs,請使用卡片或資料表檢視中的所有變更類型區域。在任一檢視中,選取 CT,然後按一下建立 RFC 以開啟執行 RFC 頁面。如果適用,建立較舊版本選項會顯示在建立 RFC 按鈕旁。
依類別選擇:選取類別、子類別、項目和操作,如果適用,CT 詳細資訊方塊會開啟,其中包含使用較舊版本建立的選項。按一下建立 RFC 以開啟執行 RFC 頁面。
在執行 RFC 頁面上,開啟 CT 名稱區域以查看 CT 詳細資訊方塊。需要主旨 (如果您在瀏覽變更類型檢視中選擇 CT,則會為您填入)。開啟其他組態區域以新增 RFC 的相關資訊。
在執行組態區域中,使用可用的下拉式清單或輸入必要參數的值。若要設定選用的執行參數,請開啟其他組態區域。
完成後,請按一下執行。如果沒有錯誤,RFC 成功建立的頁面會顯示已提交的 RFC 詳細資訊,以及初始的執行輸出。
開啟執行參數區域以查看您提交的組態。重新整理頁面以更新 RFC 執行狀態。或者,取消 RFC 或使用頁面頂端的選項建立 RFC 的副本。
運作方式:
使用內嵌建立 (您發出包含所有 RFC 和執行參數的
create-rfc命令) 或範本建立 (您建立兩個 JSON 檔案,一個用於 RFC 參數,另一個用於執行參數),並使用兩個檔案作為輸入發出create-rfc命令。此處說明這兩種方法。使用傳回的 RFC ID 提交 RFC:
aws amscm submit-rfc --rfc-id命令。ID監控 RFC:
aws amscm get-rfc --rfc-id命令。ID
若要檢查變更類型版本,請使用下列命令:
aws amscm list-change-type-version-summaries --filter Attribute=ChangeTypeId,Value=CT_ID
注意
您可以將任何CreateRfc參數與任何 RFC 搭配使用,無論它們是否為變更類型結構描述的一部分。例如,若要在 RFC 狀態變更時取得通知,請將此行新增至請求的 --notification "{\"Email\": {\"EmailRecipients\" : [\"email@example.com\"]}}" RFC 參數部分 (而非執行參數)。如需所有 CreateRfc 參數的清單,請參閱 AMS 變更管理 API 參考。
內嵌建立:
使用內嵌提供的執行參數發出建立 RFC 命令 (在內嵌提供執行參數時逸出引號),然後提交傳回的 RFC ID。例如,您可以將內容取代為類似以下內容:
aws --profile saml amscm create-rfc --change-type-id "ct-1oxx2g2d7hc90" --change-type-version "2.0" --title "Test-SG-RR" --execution-parameters "{\"Description\":\"Test-SG-RR\", \"Name\":\"Test-SG-IC\", \"InboundRules\":{\"Protocol\":\"TCP\", \"PortRange\":\"49152-65535\, \"Source\":\"203.0.113.5/32\"}, \"OutboundRules\":{\"Protocol\":\"TCP\", \"PortRange\":\"49152-65535\, \"Destination\":\"203.0.113.5/32\"}}"
範本建立:
將此變更類型的執行參數 JSON 結構描述輸出至檔案;此範例會將其命名為 CreateSgRrParams.json.
aws amscm get-change-type-version --change-type-id "ct-1oxx2g2d7hc90" --query "ChangeTypeVersion.ExecutionInputSchema" --output text > CreateSgRrParams.json修改並儲存 CreateSgRrParams 檔案。例如,您可以將內容取代為類似以下內容:
{ "Description": "SG-Create-With-Review", "Name": "My-SG", "VpcId": "vpc-12345abc", "InboundRules": { "Protocol": "TRAFFIC_PROTOCOL", "PortRange": "PORT_RANGE", "Source": "TRAFFIC_SOURCE" }, "OutboundRules": { "Protocol": "TRAFFIC_PROTOCOL", "PortRange": "PORT_RANGE", "Destination": "TRAFFIC_DESTINATION" } }將 RFC 範本 JSON 檔案輸出至名為 CreateSgRrRfc.json:
aws amscm create-rfc --generate-cli-skeleton > CreateSgRrRfc.json修改並儲存 CreateSgRrRfc.json 檔案。例如,您可以將內容取代為類似以下內容:
{ "ChangeTypeVersion": "2.0", "ChangeTypeId": "ct-1oxx2g2d7hc90", "Title": "SG-Create-RR-RFC" }建立 RFC,指定 CreateSgRrRfc 檔案和 CreateSgRrParams 檔案:
aws amscm create-rfc --cli-input-json file://CreateSgRrRfc.json --execution-parameters file://CreateSgRrParams.json您會在回應中收到新 RFC 的 ID,並且可以使用它來提交和監控 RFC。在您提交之前,RFC 會保持在編輯狀態,不會啟動。
注意
建立安全群組的自動變更類型是部署 | 進階堆疊元件 | 安全群組 | 建立 (不需要檢閱) (ct-3pc215bnwb6p7),可提供 TCP 和 ICMP 輸入和輸出規則的選項。如果這些規則足夠,則建立 (自動) 變更類型會比此變更類型更快地執行。如需詳細資訊,請參閱安全群組 | 建立。
注意
建立安全群組後,請使用安全群組 | 關聯將安全群組與您的 AMS 資源建立關聯。若要刪除安全群組,它必須具有相關聯的資源。
注意
不需要傳出規則;不過,如果未指定,則會使用「127.0.0.1/32 Blackhole 規則」,這表示資源只能與本身通訊,不能與其他資源通訊。您可以在使用 AMS 主控台時看到此預設傳出規則,但不會在使用 AMS API/CLI 時看到。
這是「需要檢閱」變更類型 (AMS 運算子必須檢閱並執行 CT),這表示 RFC 可能需要更長的時間才能執行,而且您可能需要透過 RFC 詳細資訊頁面對應選項與 AMS 通訊。此外,如果您排定「需要檢閱」變更類型 RFC,請務必至少允許 24 小時,如果未在排定的開始時間之前進行核准,RFC 會自動被拒絕。
若要進一步了解 AWS 安全群組和建立安全群組,請參閱安全群組規則參考;此頁面可協助您判斷所需的規則,更重要的是,如何為您的安全群組命名,以便在建立其他資源時選擇它。另請參閱適用於 Linux 執行個體的 Amazon EC2 安全群組和/或適用於 VPC 的安全群組。
若要進一步了解一般 AWS 安全性,請參閱安全性、身分和合規的最佳實務
建立安全群組後,請使用安全群組 | 關聯將安全群組與您的 AMS 資源建立關聯。若要刪除安全群組,它必須具有相關聯的資源。
執行輸入參數
如需執行輸入參數的詳細資訊,請參閱 變更類型的結構描述 ct-1oxx2g2d7hc90。
範例:必要參數
{ "VpcId": "vpc-12345abc", "Name": "app1-webserver", "Description": "App1 group", "InboundRules": [], "OutboundRules": [] }
範例:所有參數
{ "VpcId": "vpc-1234abcd", "Name": "app1-webserver", "Description": "App1 group", "AssociatedResources": [ "i-1234abcd", "i-234abcd1", "i-34abcd12", "i-4abcd123", "i-abcd1234", "i-1234567890abcdefg", "i-234567890abcdefg1", "i-34567890abcdefg12", "i-4567890abcdefg123", "i-567890abcdefg1234" ], "InboundRules": [ { "Protocol": "TCP", "PortRange":"80", "Source": "192.168.0.0/16", "Description": "Client1" }, { "Protocol": "TCP", "PortRange":"80", "Source": "192.168.0.0/16", "Description": "Client1" }, { "Protocol": "TCP", "PortRange":"80", "Source": "192.168.0.0/16", "Description": "Client1" }, { "Protocol": "TCP", "PortRange":"80", "Source": "192.168.0.0/16", "Description": "Client1" }, { "Protocol": "TCP", "PortRange":"80", "Source": "192.168.0.0/16", "Description": "Client1" }, { "Protocol": "TCP", "PortRange":"80", "Source": "192.168.0.0/16", "Description": "Client1" }, { "Protocol": "TCP", "PortRange":"80", "Source": "192.168.0.0/16", "Description": "Client1" }, { "Protocol": "TCP", "PortRange":"80", "Source": "192.168.0.0/16", "Description": "Client1" }, { "Protocol": "TCP", "PortRange":"80", "Source": "192.168.0.0/16", "Description": "Client1" }, { "Protocol": "TCP", "PortRange":"80", "Source": "192.168.0.0/16", "Description": "Client1" }, { "Protocol": "TCP", "PortRange":"80", "Source": "192.168.0.0/16", "Description": "Client1" }, { "Protocol": "TCP", "PortRange":"80", "Source": "192.168.0.0/16", "Description": "Client1" }, { "Protocol": "TCP", "PortRange":"80", "Source": "192.168.0.0/16", "Description": "Client1" }, { "Protocol": "TCP", "PortRange":"80", "Source": "192.168.0.0/16", "Description": "Client1" }, { "Protocol": "TCP", "PortRange":"80", "Source": "192.168.0.0/16", "Description": "Client1" }, { "Protocol": "TCP", "PortRange":"80", "Source": "192.168.0.0/16", "Description": "Client1" }, { "Protocol": "TCP", "PortRange":"80", "Source": "192.168.0.0/16", "Description": "Client1" }, { "Protocol": "TCP", "PortRange":"80", "Source": "192.168.0.0/16", "Description": "Client1" }, { "Protocol": "TCP", "PortRange":"80", "Source": "192.168.0.0/16", "Description": "Client1" }, { "Protocol": "TCP", "PortRange":"80", "Source": "192.168.0.0/16", "Description": "Client1" }, { "Protocol": "TCP", "PortRange":"80", "Source": "192.168.0.0/16", "Description": "Client1" }, { "Protocol": "TCP", "PortRange":"80", "Source": "192.168.0.0/16", "Description": "Client1" }, { "Protocol": "TCP", "PortRange":"80", "Source": "192.168.0.0/16", "Description": "Client1" }, { "Protocol": "TCP", "PortRange":"80", "Source": "192.168.0.0/16", "Description": "Client1" }, { "Protocol": "TCP", "PortRange":"80", "Source": "192.168.0.0/16", "Description": "Client1" }, { "Protocol": "TCP", "PortRange":"80", "Source": "192.168.0.0/16", "Description": "Client1" }, { "Protocol": "TCP", "PortRange":"80", "Source": "192.168.0.0/16", "Description": "Client1" }, { "Protocol": "TCP", "PortRange":"80", "Source": "192.168.0.0/16", "Description": "Client1" }, { "Protocol": "TCP", "PortRange":"80", "Source": "192.168.0.0/16", "Description": "Client1" }, { "Protocol": "TCP", "PortRange":"80", "Source": "192.168.0.0/16", "Description": "Client1" }, { "Protocol": "TCP", "PortRange":"80", "Source": "192.168.0.0/16", "Description": "Client1" }, { "Protocol": "TCP", "PortRange":"80", "Source": "192.168.0.0/16", "Description": "Client1" }, { "Protocol": "TCP", "PortRange":"80", "Source": "192.168.0.0/16", "Description": "Client1" }, { "Protocol": "TCP", "PortRange":"80", "Source": "192.168.0.0/16", "Description": "Client1" }, { "Protocol": "TCP", "PortRange":"80", "Source": "192.168.0.0/16", "Description": "Client1" }, { "Protocol": "TCP", "PortRange":"80", "Source": "192.168.0.0/16", "Description": "Client1" }, { "Protocol": "TCP", "PortRange":"80", "Source": "192.168.0.0/16", "Description": "Client1" }, { "Protocol": "TCP", "PortRange":"80", "Source": "192.168.0.0/16", "Description": "Client1" }, { "Protocol": "TCP", "PortRange":"80", "Source": "192.168.0.0/16", "Description": "Client1" }, { "Protocol": "TCP", "PortRange":"80", "Source": "192.168.0.0/16", "Description": "Client1" }, { "Protocol": "TCP", "PortRange":"80", "Source": "192.168.0.0/16", "Description": "Client1" }, { "Protocol": "TCP", "PortRange":"80", "Source": "192.168.0.0/16", "Description": "Client1" }, { "Protocol": "TCP", "PortRange":"80", "Source": "192.168.0.0/16", "Description": "Client1" }, { "Protocol": "TCP", "PortRange":"80", "Source": "192.168.0.0/16", "Description": "Client1" }, { "Protocol": "TCP", "PortRange":"80", "Source": "192.168.0.0/16", "Description": "Client1" }, { "Protocol": "TCP", "PortRange":"80", "Source": "192.168.0.0/16", "Description": "Client1" }, { "Protocol": "TCP", "PortRange":"80", "Source": "192.168.0.0/16", "Description": "Client1" }, { "Protocol": "TCP", "PortRange":"80", "Source": "192.168.0.0/16", "Description": "Client1" }, { "Protocol": "TCP", "PortRange":"80", "Source": "192.168.0.0/16", "Description": "Client1" }, { "Protocol": "TCP", "PortRange":"80", "Source": "192.168.0.0/16", "Description": "Client1" } ], "OutboundRules": [ { "Protocol": "ALL", "PortRange": "ALL", "Destination": "192.168.0.0/16", "Description": "Client1" }, { "Protocol": "ALL", "PortRange": "ALL", "Destination": "192.168.0.0/16", "Description": "Client1" }, { "Protocol": "ALL", "PortRange": "ALL", "Destination": "192.168.0.0/16", "Description": "Client1" }, { "Protocol": "ALL", "PortRange": "ALL", "Destination": "192.168.0.0/16", "Description": "Client1" }, { "Protocol": "ALL", "PortRange": "ALL", "Destination": "192.168.0.0/16", "Description": "Client1" }, { "Protocol": "ALL", "PortRange": "ALL", "Destination": "192.168.0.0/16", "Description": "Client1" }, { "Protocol": "ALL", "PortRange": "ALL", "Destination": "192.168.0.0/16", "Description": "Client1" }, { "Protocol": "ALL", "PortRange": "ALL", "Destination": "192.168.0.0/16", "Description": "Client1" }, { "Protocol": "ALL", "PortRange": "ALL", "Destination": "192.168.0.0/16", "Description": "Client1" }, { "Protocol": "ALL", "PortRange": "ALL", "Destination": "192.168.0.0/16", "Description": "Client1" }, { "Protocol": "ALL", "PortRange": "ALL", "Destination": "192.168.0.0/16", "Description": "Client1" }, { "Protocol": "ALL", "PortRange": "ALL", "Destination": "192.168.0.0/16", "Description": "Client1" }, { "Protocol": "ALL", "PortRange": "ALL", "Destination": "192.168.0.0/16", "Description": "Client1" }, { "Protocol": "ALL", "PortRange": "ALL", "Destination": "192.168.0.0/16", "Description": "Client1" }, { "Protocol": "ALL", "PortRange": "ALL", "Destination": "192.168.0.0/16", "Description": "Client1" }, { "Protocol": "ALL", "PortRange": "ALL", "Destination": "192.168.0.0/16", "Description": "Client1" }, { "Protocol": "ALL", "PortRange": "ALL", "Destination": "192.168.0.0/16", "Description": "Client1" }, { "Protocol": "ALL", "PortRange": "ALL", "Destination": "192.168.0.0/16", "Description": "Client1" }, { "Protocol": "ALL", "PortRange": "ALL", "Destination": "192.168.0.0/16", "Description": "Client1" }, { "Protocol": "ALL", "PortRange": "ALL", "Destination": "192.168.0.0/16", "Description": "Client1" }, { "Protocol": "ALL", "PortRange": "ALL", "Destination": "192.168.0.0/16", "Description": "Client1" }, { "Protocol": "ALL", "PortRange": "ALL", "Destination": "192.168.0.0/16", "Description": "Client1" }, { "Protocol": "ALL", "PortRange": "ALL", "Destination": "192.168.0.0/16", "Description": "Client1" }, { "Protocol": "ALL", "PortRange": "ALL", "Destination": "192.168.0.0/16", "Description": "Client1" }, { "Protocol": "ALL", "PortRange": "ALL", "Destination": "192.168.0.0/16", "Description": "Client1" }, { "Protocol": "ALL", "PortRange": "ALL", "Destination": "192.168.0.0/16", "Description": "Client1" }, { "Protocol": "ALL", "PortRange": "ALL", "Destination": "192.168.0.0/16", "Description": "Client1" }, { "Protocol": "ALL", "PortRange": "ALL", "Destination": "192.168.0.0/16", "Description": "Client1" }, { "Protocol": "ALL", "PortRange": "ALL", "Destination": "192.168.0.0/16", "Description": "Client1" }, { "Protocol": "ALL", "PortRange": "ALL", "Destination": "192.168.0.0/16", "Description": "Client1" }, { "Protocol": "ALL", "PortRange": "ALL", "Destination": "192.168.0.0/16", "Description": "Client1" }, { "Protocol": "ALL", "PortRange": "ALL", "Destination": "192.168.0.0/16", "Description": "Client1" }, { "Protocol": "ALL", "PortRange": "ALL", "Destination": "192.168.0.0/16", "Description": "Client1" }, { "Protocol": "ALL", "PortRange": "ALL", "Destination": "192.168.0.0/16", "Description": "Client1" }, { "Protocol": "ALL", "PortRange": "ALL", "Destination": "192.168.0.0/16", "Description": "Client1" }, { "Protocol": "ALL", "PortRange": "ALL", "Destination": "192.168.0.0/16", "Description": "Client1" }, { "Protocol": "ALL", "PortRange": "ALL", "Destination": "192.168.0.0/16", "Description": "Client1" }, { "Protocol": "ALL", "PortRange": "ALL", "Destination": "192.168.0.0/16", "Description": "Client1" }, { "Protocol": "ALL", "PortRange": "ALL", "Destination": "192.168.0.0/16", "Description": "Client1" }, { "Protocol": "ALL", "PortRange": "ALL", "Destination": "192.168.0.0/16", "Description": "Client1" }, { "Protocol": "ALL", "PortRange": "ALL", "Destination": "192.168.0.0/16", "Description": "Client1" }, { "Protocol": "ALL", "PortRange": "ALL", "Destination": "192.168.0.0/16", "Description": "Client1" }, { "Protocol": "ALL", "PortRange": "ALL", "Destination": "192.168.0.0/16", "Description": "Client1" }, { "Protocol": "ALL", "PortRange": "ALL", "Destination": "192.168.0.0/16", "Description": "Client1" }, { "Protocol": "ALL", "PortRange": "ALL", "Destination": "192.168.0.0/16", "Description": "Client1" }, { "Protocol": "ALL", "PortRange": "ALL", "Destination": "192.168.0.0/16", "Description": "Client1" }, { "Protocol": "ALL", "PortRange": "ALL", "Destination": "192.168.0.0/16", "Description": "Client1" }, { "Protocol": "ALL", "PortRange": "ALL", "Destination": "192.168.0.0/16", "Description": "Client1" }, { "Protocol": "ALL", "PortRange": "ALL", "Destination": "192.168.0.0/16", "Description": "Client1" }, { "Protocol": "ALL", "PortRange": "ALL", "Destination": "192.168.0.0/16", "Description": "Client1" } ], "Priority": "Medium", "Tags": [ { "Key": "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUV", "Value": "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrst" }, { "Key": "B", "Value": "bb" }, { "Key": "C", "Value": "cc" }, { "Key": "D", "Value": "dd" }, { "Key": "E", "Value": "ee" }, { "Key": "F", "Value": "ff" }, { "Key": "G", "Value": "gg" }, { "Key": "H", "Value": "hh" }, { "Key": "I", "Value": "ii" }, { "Key": "J", "Value": "jj" }, { "Key": "K", "Value": "kk" }, { "Key": "L", "Value": "ll" }, { "Key": "M", "Value": "mm" }, { "Key": "N", "Value": "nn" }, { "Key": "O", "Value": "oo" }, { "Key": "P", "Value": "pp" }, { "Key": "Q", "Value": "qq" }, { "Key": "R", "Value": "rr" }, { "Key": "S", "Value": "ss" }, { "Key": "T", "Value": "tt" }, { "Key": "U", "Value": "uu" }, { "Key": "V", "Value": "vv" }, { "Key": "W", "Value": "ww" }, { "Key": "X", "Value": "xx" }, { "Key": "Y", "Value": "yy" }, { "Key": "Z", "Value": "zz" }, { "Key": "a", "Value": "aa" }, { "Key": "b", "Value": "bb" }, { "Key": "c", "Value": "cc" }, { "Key": "d", "Value": "dd" }, { "Key": "e", "Value": "ee" }, { "Key": "f", "Value": "ff" }, { "Key": "g", "Value": "gg" }, { "Key": "h", "Value": "hh" }, { "Key": "i", "Value": "ii" }, { "Key": "j", "Value": "jj" }, { "Key": "k", "Value": "kk" }, { "Key": "l", "Value": "ll" }, { "Key": "m", "Value": "mm" }, { "Key": "n", "Value": "nn" }, { "Key": "o", "Value": "oo" }, { "Key": "p", "Value": "pp" }, { "Key": "q", "Value": "qq" }, { "Key": "r", "Value": "rr" }, { "Key": "s", "Value": "ss" }, { "Key": "t", "Value": "tt" }, { "Key": "u", "Value": "uu" }, { "Key": "v", "Value": "vv" }, { "Key": "w", "Value": "ww" }, { "Key": "x", "Value": "xx" } ] }