本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。
建立容量保留群組
您可使用下列範例,藉助以下請求參數來為容量保留建立資源群組。
在您建立群組之後,可新增容量保留至群組。
- AWS CLI
-
為容量保留建立群組
使用 create-group AWS CLI 命令。
aws resource-groups create-group \
--name MyCRGroup \
--configuration \
'{"Type": "AWS::EC2::CapacityReservationPool"}' \
'{"Type": "AWS::ResourceGroups::Generic", "Parameters": [{"Name": "allowed-resource-types", "Values": ["AWS::EC2::CapacityReservation"]}]}'
- PowerShell
-
為容量保留建立群組
使用 New-RGGroup cmdlet。
New-RGGroup `
-Name MyCRGroup `
-Configuration `
@{"Type"="AWS::EC2::CapacityReserationPool"} `
@{"Type"="AWS::ResourceGroups::Generic"; "Parameters"=@{"allowed-resource-types"=@{"Values"="AWS::EC2::CapacityReservations"}}}