

# マルチロケーション Canary のアクセス許可
<a name="CloudWatch_Synthetics_MultiLocation_Permissions"></a>

マルチロケーション Canary を作成および管理するには、IAM プリンシパルに標準の CloudWatch Synthetics アクセス許可 (「[CloudWatch Canary に必要なロールとアクセス許可](CloudWatch_Synthetics_Canaries_Roles.md)」を参照) と以下が必要です。
+ `synthetics:ReplicateCanary` — CloudWatch Synthetics サービスがユーザーに代わってレプリカリージョンのレプリカを作成、更新、削除できるようにします。ポリシーに既に `synthetics:*` が含まれている場合、このアクセス許可は含まれており、追加のアクションは必要ありません。

**マルチロケーション Canary の条件キー**  
IAM ポリシーで条件キーを使用して、レプリカのロケーションとして使用できるリージョンを制御できます。次の条件キーが使用可能です。


| 条件キー | 説明 | タイプ | 使用対象 | 
| --- | --- | --- | --- | 
| synthetics:AddReplicaLocations | リクエストで指定されるレプリカリージョンによってアクセスをフィルタリングします | ArrayOfString | synthetics:CreateCanary, synthetics:UpdateCanary | 
| synthetics:RemoveReplicaLocations | リクエストで削除されるレプリカリージョンによってアクセスをフィルタリングします | ArrayOfString | synthetics:UpdateCanary | 

**例: 特定のリージョンにのみレプリケーションを許可する**  
次のポリシーでは、米国およびカナダリージョンでのみ、レプリカを使用して Canary を作成および更新できます。

```
{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "synthetics:CreateCanary",
                "synthetics:UpdateCanary"
            ],
            "Resource": "*",
            "Condition": {
                "ForAllValues:StringLike": {
                    "synthetics:AddReplicaLocations": [
                        "us-*",
                        "ca-*"
                    ]
                }
            }
        }
    ]
}
```

**例: 特定のリージョンへのレプリケーションを拒否する**  
次のポリシーは、`eu-west-1` または `ap-southeast-1` でのレプリカを使用した Canary の作成または更新を拒否します。

```
{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Deny",
            "Action": [
                "synthetics:CreateCanary",
                "synthetics:UpdateCanary"
            ],
            "Resource": "*",
            "Condition": {
                "ForAnyValue:StringEquals": {
                    "synthetics:AddReplicaLocations": [
                        "eu-west-1",
                        "ap-southeast-1"
                    ]
                }
            }
        }
    ]
}
```

CloudWatch Synthetics のアクセス許可の詳細については、「[CloudWatch Canary に必要なロールとアクセス許可](CloudWatch_Synthetics_Canaries_Roles.md)」を参照してください。