

翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。

# Amazon Connect のリソースレベルのポリシー例
<a name="security_iam_resource-level-policy-examples"></a>

Amazon Connect はユーザーに対するリソースレベルのアクセス許可をサポートしており、以下のポリシーに示すように、インスタンスに対してユーザーのアクションを指定することができます。

**Topics**
+ [Amazon Connect インスタンスのすべてのアクションを拒否する](#connect-access-control-resources-example-all)
+ [「削除」および「更新」アクションを拒否する](#connect-access-control-resources-example2)
+ [特定の名前の統合においてアクションを許可する](#connect-access-control-resources-integration-example)
+ [「ユーザーの作成」を許可するが、特定のセキュリティプロファイルに割り当てられている場合は拒否する](#connect-access-control-resources-example3)
+ [通話の記録アクションを許可する](#connect-access-control-resources-example4)
+ [レプリカリージョンの電話番号に対するキュー API アクションを許可または拒否します。](#allow-deny-queue-actions-replica-region)
+ [特定の Amazon AppIntegrations のリソースを表示する](#view-specific-appintegrations-resources)
+ [Amazon Connect Customer Profiles にアクセス許可を付与する](#grant-access-to-customer-profiles)
+ [Customer Profiles のデータの読み取り専用アクセス許可を付与する](#grant-read-only-access-to-customer-profiles)
+ [特定の Assistant に対してのみ AI エージェントをクエリ接続する](#query-wisdom-assistant)
+ [Amazon Connect Voice ID への完全なアクセス権を付与する](#grant-read-only-access-to-voiceid)
+ [Amazon Connect アウトバウンドキャンペーンのリソースへのアクセスを付与する](#grant-read-only-access-to-outboundcommunications)
+ [Amazon Connect Contact Lens によって分析されたトランスクリプトを検索する機能を制限する](#restrict-ability-to-search-transcripts-contact-lens)

## Amazon Connect インスタンスのすべてのアクションを拒否する
<a name="connect-access-control-resources-example-all"></a>

Amazon Connect インスタンスは、Amazon Connect の最上位リソースです。他のすべてのサブリソースは、そのスコープ内で作成されます。Amazon Connect インスタンス内のすべてのリソースに対するすべてのアクションを拒否するには、次のいずれかの方法を使用できます。
+ `connect:instanceId` コンテキストキーを使用します。
+ インスタンス ARN の後にワイルドカード (\*) を使用します。

次のサンプルポリシーは、instanceId 00fbeee1-123e-111e-93e3-11111bfbfcc1 を持つインスタンスのすべての接続アクションを拒否します。

------
#### [ JSON ]

****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [
        {
            "Effect": "Deny",
            "Action": "connect:*",
            "Resource": "*",
            "Condition": {
                "StringEquals": {
                    "connect:instanceId": "00fbeee1-123e-111e-93e3-11111bfbfcc1"
                }
            }
        }
    ]
}
```

------

または、インスタンス ARN の後にワイルドカード (\*) を指定して、すべてのアクションを拒否することもできます。次のサンプルポリシーは、インスタンス ARN `arn:aws:connect:us-east-1:123456789012:instance/00fbeee1-123e-111e-93e3-11111bfbfcc1` を持つインスタンスのすべての接続アクションを拒否します。

------
#### [ JSON ]

****  

```
{
"Version":"2012-10-17",		 	 	 
    "Statement": [
        {
            "Effect": "Deny",
            "Action": [
                "connect:*"
            ],
            "Resource": "arn:aws:connect:us-east-1:123456789012:instance/00fbeee1-123e-111e-93e3-11111bfbfcc1*"
        }
    ]
}
```

------

## 「削除」および「更新」アクションを拒否する
<a name="connect-access-control-resources-example2"></a>

次のポリシー例は、1 つの Amazon Connect インスタンス内のユーザーに対し、「削除」および「更新」のアクションを拒否しています。この例では、Amazon Connect ユーザー ARN の末尾にワイルドカードを使用して、完全なユーザー ARN (これは、指定されたインスタンス内のすべての Amazon Connect ユーザーを表すもので、例えば、arn:aws:connect:us-east-1:123456789012:instance/00fbeee1-123e-111e-93e3-11111bfbfcc1/agent/00dtcddd1-123e-111e-93e3-11111bfbfcc1) に対して、「ユーザーの削除」と「ユーザーの更新」が拒否されるようにします。

------
#### [ JSON ]

****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [
        {
            "Effect": "Deny",
            "Action": [
                "connect:DeleteUser",
                "connect:UpdateUser*"
            ],
            "Resource": "arn:aws:connect:us-east-1:123456789012:instance/00fbeee1-123e-111e-93e3-11111bfbfcc1/agent/*"
        }
    ]
}
```

------

## 特定の名前の統合においてアクションを許可する
<a name="connect-access-control-resources-integration-example"></a>

------
#### [ JSON ]

****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [
        {
            "Sid": "AllowAllAppIntegrationsActions",
            "Effect": "Allow",
            "Action": [
                "app-integrations:ListEventIntegrations",
                "app-integrations:CreateEventIntegration",
                "app-integrations:GetEventIntegration",
                "app-integrations:UpdateEventIntegration",
                "app-integrations:DeleteEventIntegration"
            ],
            "Resource":"arn:aws:app-integrations:*:*:event-integration/MyNamePrefix-*"
	}
    ]
}
```

------

## 「ユーザーの作成」を許可するが、特定のセキュリティプロファイルに割り当てられている場合は拒否する
<a name="connect-access-control-resources-example3"></a>

次のサンプルポリシーは、「ユーザーの作成」を許可しますが、[CreateUser](https://docs.aws.amazon.com/connect/latest/APIReference/API_CreateUser.html#API_CreateUser_RequestBody) リクエストのセキュリティプロファイルのパラメータとして arn:aws:connect:us-west-2:123456789012:instance/00fbeee1-123e-111e-93e3-11111bfbfcc1/security-profile/11dtcggg1-123e-111e-93e3-11111bfbfcc17 を使用した場合は明示的に拒否します。

------
#### [ JSON ]

****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "connect:CreateUser"
            ],
            "Resource": "*"
        },
        {
            "Effect": "Deny",
            "Action": [
                "connect:CreateUser"
            ],
            "Resource": "arn:aws:connect:us-west-2:123456789012:instance/00fbeee1-123e-111e-93e3-11111bfbfcc17/security-profile/11dtcggg1-123e-111e-93e3-11111bfbfcc17"
        }
    ]
}
```

------

## 通話の記録アクションを許可する
<a name="connect-access-control-resources-example4"></a>

次のサンプルポリシーでは、特定のインスタンスでの問い合わせに対し「通話の記録を開始する」ことが許可されています。contactID は動的であるため、\* が使用されています。

------
#### [ JSON ]

****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [
        {
            "Action": [
                "connect:StartContactRecording"
            ],
            "Resource": "arn:aws:connect:us-west-2:111122223333:instance/instanceId/contact/*",
            "Effect": "Allow"
        }
    ]
}
```

------

*accountID* を使用した信頼関係の設定。

記録 API には、以下のアクションが定義されています。
+ "connect:StartContactRecording"
+ "connect:StopContactRecording"
+ "connect:SuspendContactRecording"
+ "connect:ResumeContactRecording"

### 複数の問い合わせアクションを同じロールで許可する
<a name="example4-allow-more-actions"></a>

複数の問い合わせ API の呼び出しで同じロールが使用されている場合には、以下の問い合わせアクションをリストします。
+ GetContactAttributes
+ ListContactFlows
+ StartChatContact
+ StartOutboundVoiceContact
+ StopContact
+ UpdateContactAttributes

または、ワイルドカード (例えば、connect:\*) を使用して、すべての問い合わせアクションを許可します。

### その他のリソースを許可する
<a name="example4-allow-more-resources"></a>

ワイルドカードを使用して、より多くのリソースを許可することもできます。例えば、すべての問い合わせリソースに対するすべての接続アクションを許可する方法は次のとおりです。

------
#### [ JSON ]

****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [
        {
            "Action": [
                "connect:*"
            ],
            "Resource": "arn:aws:connect:us-west-2:111122223333:instance/*/contact/*",
            "Effect": "Allow"
        }
    ]
}
```

------

## レプリカリージョンの電話番号に対するキュー API アクションを許可または拒否します。
<a name="allow-deny-queue-actions-replica-region"></a>

[CreateQueue](https://docs.aws.amazon.com/connect/latest/APIReference/API_CreateQueue.html) と [UpdateQueueOutboundCallerConfig](https://docs.aws.amazon.com/connect/latest/APIReference/API_UpdateQueueOutboundCallerConfig.html) API には、`OutboundCallerIdNumberId` という名前の入力フィールドが含まれます。このフィールドは、トラフィック分散グループに請求できる電話番号リソースを表します。[ListPhoneNumbers](https://docs.aws.amazon.com/connect/latest/APIReference/API_ListPhoneNumbers.html) によって返される電話番号 V1 ARN フォーマットと、[ListPhoneNumbersV2](https://docs.aws.amazon.com/connect/latest/APIReference/API_ListPhoneNumbersV2.html) によって返される V2 ARN フォーマットの両方がサポートされます。

`OutboundCallerIdNumberId` がサポートする V1 と V2 の ARN フォーマットは次のとおりです。
+ **V1 ARN フォーマット**:`arn:aws:connect:{{your-region}}:{{your-account_id}}:instance/{{instance_id}}/phone-number/{{resource_id}}`
+ **V2 ARN フォーマット**:`arn:aws:connect:{{your-region}}:{{your-account_id}}:phone-number/{{resource_id}}`

**注記**  
V2 ARN フォーマットの使用をお勧めします。V1 ARN フォーマットは将来廃止される予定です。

### レプリカリージョンの電話番号リソースには、両方の ARN フォーマットを提供してください。
<a name="provide-both-arn-formats"></a>

電話番号がトラフィック分散グループに対して要求されている場合、レプリカリージョンでの操作中に電話番号リソースのキュー API アクションへのアクセスを正しく許可/拒否するには、**電話番号リソースは V1 と V2 の両方の ARN フォーマットで提供する必要があります**。電話番号リソースを 1 つの ARN フォーマットでのみ指定すると、レプリカリージョンでの操作中に許可/拒否が正しく動作しません。

### 例 1: CreateQueue へのアクセスを拒否する
<a name="deny-access-createqueue"></a>

たとえば、レプリカリージョン us-west-2 を ` 123456789012` とインスタンス `aaaaaaaa-bbbb-cccc-dddd-0123456789012` で運営しています。`OutboundCallerIdNumberId` 値がリソース ID `aaaaaaaa-eeee-ffff-gggg-0123456789012` を持つトラフィック分散グループに申請された電話番号の場合、[CreateQueue](https://docs.aws.amazon.com/connect/latest/APIReference/API_CreateQueue.html) API へのアクセスを拒否することをお勧めします。ただし、このシナリオでは、次のポリシーを使用する必要があります。

------
#### [ JSON ]

****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [
        {
            "Sid": "DenyCreateQueueForSpecificNumber",
            "Effect": "Deny",
            "Action": "connect:CreateQueue",
            "Resource": [
                "arn:aws:connect:us-east-1:123456789012:phone-number/aaaaaaaa-eeee-ffff-gggg-0123456789012",
                "arn:aws:connect:us-west-2:123456789012:instance/aaaaaaaa-bbbb-cccc-dddd-0123456789012/phone-number/aaaaaaaa-eeee-ffff-gggg-0123456789012"
            ]
        }
    ]
}
```

------

ここで、us-west-2 はリクエストが行われているリージョンです。

### 例 2: UpdateQueueOutboundCallerConfig へのアクセスのみを許可する
<a name="deny-access-createqueue"></a>

たとえば、レプリカリージョン us-west-2 を `123456789012` とインスタンス `aaaaaaaa-bbbb-cccc-dddd-0123456789012` で運営しています。`OutboundCallerIdNumberId` 値がリソース ID `aaaaaaaa-eeee-ffff-gggg-0123456789012` を持つトラフィック分散グループに申請された電話番号の場合、[UpdateQueueOutboundCallerConfig](https://docs.aws.amazon.com/connect/latest/APIReference/API_UpdateQueueOutboundCallerConfig.html) API へのアクセスのみ許可することをお勧めします。ただし、このシナリオでは、次のポリシーを使用する必要があります。

------
#### [ JSON ]

****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [
        {
            "Sid": "OnlyAllowUpdateQueueOutboundCallerConfigForSpecificNumber",
            "Effect": "Allow",
            "Action": "connect:UpdateQueueOutboundCallerConfig",
            "Resource": [
                "arn:aws:connect:us-east-1:123456789012:phone-number/aaaaaaaa-eeee-ffff-gggg-0123456789012",
                "arn:aws:connect:us-west-2:123456789012:instance/aaaaaaaa-bbbb-cccc-dddd-0123456789012/phone-number/aaaaaaaa-eeee-ffff-gggg-0123456789012"
            ]
        }
    ]
}
```

------

## 特定の Amazon AppIntegrations のリソースを表示する
<a name="view-specific-appintegrations-resources"></a>

次のポリシー例では、特定のイベント統合の取得を許可します。

------
#### [ JSON ]

****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "app-integrations:GetEventIntegration"
            ],
            "Resource": "arn:aws:app-integrations:us-west-2:{{111122223333}}:event-integration/Name"
        }
    ]
}
```

------

## Amazon Connect Customer Profiles にアクセス許可を付与する
<a name="grant-access-to-customer-profiles"></a>

Amazon Connect Customer Profiles では、アクションのプレフィックスとして、`connect` の代わりに `profile` を使用します。以下のポリシーでは、Amazon Connect Customer Profiles 内の特定のドメインへの完全なアクセス許可が付与されます。

------
#### [ JSON ]

****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [
        {
            "Action": [
                "profile:*"
            ],
            "Resource": "arn:aws:profile:us-west-2:{{111122223333}}:domains/domainName",
            "Effect": "Allow"
        }
    ]
}
```

------

accountID と domainName ドメインの間での信頼関係をセットアップします。

## Customer Profiles のデータの読み取り専用アクセス許可を付与する
<a name="grant-read-only-access-to-customer-profiles"></a>

以下は、Amazon Connect Customer Profiles にあるデータに対する読み取りアクセスを許可する例です。

------
#### [ JSON ]

****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [
        {
            "Action": [
                "profile:SearchProfiles"
            ],
            "Resource": "arn:aws:profile:{{us-east-1}}:{{111122223333}}:domains/domainName",
            "Effect": "Allow"
        }
    ]
}
```

------

## 特定の Assistant に対してのみ AI エージェントをクエリ接続する
<a name="query-wisdom-assistant"></a>

次のポリシー例では、特定のアシスタントのみにクエリを許可します。

------
#### [ JSON ]

****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "wisdom:QueryAssistant"
            ],
            "Resource": "arn:aws:wisdom:{{us-east-1}}:{{111122223333}}:assistant/{{assistantID}}"
        }
    ]
}
```

------

## Amazon Connect Voice ID への完全なアクセス権を付与する
<a name="grant-read-only-access-to-voiceid"></a>

Amazon Connect Voice ID は、アクションのプレフィックスとして、connect の代わりに `voiceid` を指定します。次のポリシーでは、Amazon Connect Voice ID 内の特定のドメインへの完全なアクセス権を付与します。

------
#### [ JSON ]

****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [
        {
            "Action": [
                "voiceid:*"
            ],
            "Resource": "arn:aws:voiceid:us-west-2:{{111122223333}}:domain/domainName",
            "Effect": "Allow"
        }
    ]
}
```

------

accountID と domainName ドメインの間での信頼関係をセットアップします。

## Amazon Connect アウトバウンドキャンペーンのリソースへのアクセスを付与する
<a name="grant-read-only-access-to-outboundcommunications"></a>

アウトバウンドキャンペーンでは、`connect` の代わりに `connect-campaign` がアクションのプレフィックスとして使用されます。次のポリシーは、特定のアウトバウンドキャンペーンへのフルアクセスを付与します。

```
{
    "Sid": "AllowConnectCampaignsOperations",
    "Effect": "Allow",
    "Action": [
        "connect-campaigns:DeleteCampaign",
        "connect-campaigns:DescribeCampaign",
        "connect-campaigns:UpdateCampaignName",
        "connect-campaigns:GetCampaignState"
        "connect-campaigns:UpdateOutboundCallConfig",
        "connect-campaigns:UpdateDialerConfig",
        "connect-campaigns:PauseCampaign",
        "connect-campaigns:ResumeCampaign",
        "connect-campaigns:StopCampaign"
    ],
    "Resource": "arn:aws:connect-campaigns:us-west-2:accountID:campaign/campaignId",
    }
```

## Amazon Connect Contact Lens によって分析されたトランスクリプトを検索する機能を制限する
<a name="restrict-ability-to-search-transcripts-contact-lens"></a>

次のポリシーでは、コンタクトを検索して説明することはできますが、Amazon Connect Contact Lens によって分析されたトランスクリプトを使用したコンタクトの検索は拒否されます。

------
#### [ JSON ]

****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [
        {
            "Sid": "VisualEditor0",
            "Effect": "Allow",
            "Action": [
                "connect:DescribeContact"
            ],
            "Resource": "arn:aws:connect:{{us-east-1}}:{{111122223333}}:instance/{{instance-id}}/contact/*"
        },
        {
            "Sid": "VisualEditor1",
            "Effect": "Allow",
            "Action": [
                "connect:SearchContacts"
            ],
            "Resource": "arn:aws:connect:{{us-east-1}}:{{111122223333}}:instance/{{instance-id}}"
        },
        {
            "Sid": "VisualEditor2",
            "Effect": "Deny",
            "Action": [
                "connect:SearchContacts"
            ],
            "Resource": "arn:aws:connect:{{us-east-1}}:{{111122223333}}:instance/{{instance-id}}",
            "Condition": {
                "ForAnyValue:StringEquals": {
                    "connect:SearchContactsByContactAnalysis": [
                        "Transcript"
                    ]
                }
            }
        }
    ]
}
```

------