

# キャパシティ予約グループを作成する
<a name="create-group"></a>

次の例を使用すると、次のリクエストパラメータを使用してキャパシティ予約のリソースグループを作成できます。
+ `AWS::EC2::CapacityReservationPool` – リソースグループがインスタンス起動の対象となるようにします。
+ `AWS::ResourceGroups::Generic` で `allowed-resource-types` を `AWS::EC2::CapacityReservation` に設定 – リソースグループがキャパシティ予約のみを受け入れるようにします。

グループを作成した後に、そのグループに[キャパシティ予約を追加](add-to-group.md)できます。

------
#### [ AWS CLI ]

**キャパシティ予約のグループを作成するには**  
[create-group](https://docs.aws.amazon.com/cli/latest/reference/resource-groups/create-group.html) 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](https://docs.aws.amazon.com/powershell/latest/reference/items/New-RGGroup.html) コマンドレットを使用します。

```
New-RGGroup `
    -Name MyCRGroup `
    -Configuration `
        @{"Type"="AWS::EC2::CapacityReserationPool"} `
        @{"Type"="AWS::ResourceGroups::Generic"; "Parameters"=@{"allowed-resource-types"=@{"Values"="AWS::EC2::CapacityReservations"}}}
```

------