

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

# AWS CodeStar Notifications と AWS CodeConnections の Identity and Access Management
<a name="security-iam"></a>

AWS Identity and Access Management (IAM) は、管理者が AWS リソースへのアクセスを安全に制御 AWS のサービス するのに役立つ です。IAM 管理者は、誰を*認証* (サインイン) し、誰に AWS CodeStar Notifications および AWS CodeConnections リソースの使用*を許可する* (アクセス許可を付与する) かを制御します。IAM は、追加料金なしで使用できる AWS のサービス です。

**注記**  
新しいサービスプレフィックスで作成されたリソースのアクション`codeconnections`を使用できます。新しいサービスプレフィックスでリソースを作成すると、リソース ARN `codeconnections`で が使用されます。`codestar-connections` サービスプレフィックスのアクションとリソースは引き続き使用できます。IAM ポリシーでリソースを指定する場合、サービスプレフィックスはリソースのプレフィックスと一致する必要があります。

**Topics**
+ [オーディエンス](#security_iam_audience)
+ [アイデンティティを使用した認証](#security_iam_authentication)
+ [ポリシーを使用したアクセスの管理](#security_iam_access-manage)
+ [デベロッパーツールコンソールの機能と IAM との連携方法](security_iam_service-with-iam.md)
+ [AWS CodeConnections アクセス許可リファレンス](#permissions-reference-connections)
+ [アイデンティティベースのポリシーの例](security_iam_id-based-policy-examples.md)
+ [タグを使用して AWS CodeConnections リソースへのアクセスを制御する](connections-tag-based-access-control.md)
+ [コンソールでの通知と接続の使用](#security_iam_id-based-policy-examples-console)
+ [ユーザーが自分の許可を表示できるようにする](#security_iam_id-based-policy-examples-view-own-permissions)
+ [AWS CodeStar Notifications と AWS CodeConnections のアイデンティティとアクセスのトラブルシューティング](security_iam_troubleshoot.md)
+ [AWS CodeStar Notifications のサービスにリンクされたロールの使用](using-service-linked-roles.md)
+ [のサービスにリンクされたロールの使用 AWS CodeConnections](service-linked-role-connections.md)
+ [AWS の 管理ポリシー AWS CodeConnections](security-iam-awsmanpol.md)

## オーディエンス
<a name="security_iam_audience"></a>

 AWS Identity and Access Management (IAM) の使用方法は、ロールによって異なります。
+ **サービスユーザー** - 機能にアクセスできない場合は、管理者にアクセス許可をリクエストします (「[AWS CodeStar Notifications と AWS CodeConnections のアイデンティティとアクセスのトラブルシューティング](security_iam_troubleshoot.md)」を参照)。
+ **サービス管理者** - ユーザーアクセスを決定し、アクセス許可リクエストを送信します (「[デベロッパーツールコンソールの機能と IAM との連携方法](security_iam_service-with-iam.md)」を参照)
+ **IAM 管理者** - アクセスを管理するためのポリシーを作成します (「[アイデンティティベースのポリシーの例](security_iam_id-based-policy-examples.md)」を参照)

## アイデンティティを使用した認証
<a name="security_iam_authentication"></a>

認証は、ID 認証情報 AWS を使用して にサインインする方法です。、IAM ユーザー AWS アカウントのルートユーザー、または IAM ロールを引き受けることで認証される必要があります。

 AWS IAM アイデンティティセンター (IAM Identity Center)、シングルサインオン認証、Google/Facebook 認証情報などの ID ソースからの認証情報を使用して、フェデレーティッド ID としてサインインできます。サインインの詳細については、「*AWS サインイン ユーザーガイド*」の「[AWS アカウントにサインインする方法](https://docs.aws.amazon.com/signin/latest/userguide/how-to-sign-in.html)」を参照してください。

プログラムによるアクセスの場合、 は SDK と CLI AWS を提供してリクエストを暗号化して署名します。詳細については、「*IAM ユーザーガイド*」の「[API リクエストに対するAWS 署名バージョン 4](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_sigv.html)」を参照してください。

### AWS アカウントのルートユーザー
<a name="security_iam_authentication-rootuser"></a>

 を作成するときは AWS アカウント、すべての AWS のサービス および リソースへの完全なアクセス権を持つ AWS アカウント *ルートユーザー*と呼ばれる 1 つのサインインアイデンティティから始めます。日常的なタスクには、ルートユーザーを使用しないことを強くお勧めします。ルートユーザー認証情報を必要とするタスクについては、「*IAM ユーザーガイド*」の「[ルートユーザー認証情報が必要なタスク](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_root-user.html#root-user-tasks)」を参照してください。

### IAM ユーザーとグループ
<a name="security_iam_authentication-iamuser"></a>

*[IAM ユーザー](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_users.html)*は、特定の個人やアプリケーションに対する特定のアクセス許可を持つアイデンティティです。長期認証情報を持つ IAM ユーザーの代わりに一時的な認証情報を使用することをお勧めします。詳細については、*IAM ユーザーガイド*の[「ID プロバイダーとのフェデレーションを使用して にアクセスする必要がある AWS](https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html#bp-users-federation-idp)」を参照してください。

[https://docs.aws.amazon.com/IAM/latest/UserGuide/id_groups.html](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_groups.html)は、IAM ユーザーの集合を指定し、大量のユーザーに対するアクセス許可の管理を容易にします。詳細については、「*IAM ユーザーガイド*」の「[IAM ユーザーに関するユースケース](https://docs.aws.amazon.com/IAM/latest/UserGuide/gs-identities-iam-users.html)」を参照してください。

### IAM ロール
<a name="security_iam_authentication-iamrole"></a>

*[IAM ロール](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles.html)*は、特定のアクセス許可を持つアイデンティであり、一時的な認証情報を提供します。ユーザー[から IAM ロール (コンソール) に切り替えるか、 または API オペレーションを呼び出すことで、ロール](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_switch-role-console.html)を引き受けることができます。 AWS CLI AWS 詳細については、「*IAM ユーザーガイド*」の「[ロールを引き受けるための各種方法](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_manage-assume.html)」を参照してください。

IAM ロールは、フェデレーションユーザーアクセス、一時的な IAM ユーザーのアクセス許可、クロスアカウントアクセス、クロスサービスアクセス、および Amazon EC2 で実行するアプリケーションに役立ちます。詳細については、*IAM ユーザーガイド* の [IAM でのクロスアカウントリソースアクセス](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies-cross-account-resource-access.html) を参照してください。

## ポリシーを使用したアクセスの管理
<a name="security_iam_access-manage"></a>

でアクセスを制御する AWS には、ポリシーを作成し、ID AWS またはリソースにアタッチします。ポリシーは、アイデンティティまたはリソースに関連付けられている場合のアクセス許可を定義します。 は、プリンシパルがリクエストを行うときにこれらのポリシー AWS を評価します。ほとんどのポリシーは JSON ドキュメント AWS として に保存されます。JSON ポリシードキュメントの詳細については、「*IAM ユーザーガイド*」の「[JSON ポリシー概要](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#access_policies-json)」を参照してください。

管理者は、ポリシーを使用して、どの**プリンシパル**がどの**リソース**に対して、どのような**条件**で**アクション**を実行できるかを定義することで、誰が何にアクセスできるかを指定します。

デフォルトでは、ユーザーやロールにアクセス許可はありません。IAM 管理者は IAM ポリシーを作成してロールに追加し、このロールをユーザーが引き受けられるようにします。IAM ポリシーは、オペレーションの実行方法を問わず、アクセス許可を定義します。

### アイデンティティベースのポリシー
<a name="security_iam_access-manage-id-based-policies"></a>

アイデンティティベースのポリシーは、アイデンティティ (ユーザー、グループ、またはロール) にアタッチできる JSON アクセス許可ポリシードキュメントです。これらのポリシーは、アイデンティティがどのリソースに対してどのような条件下でどのようなアクションを実行できるかを制御します。アイデンティティベースポリシーの作成方法については、*IAM ユーザーガイド* の [カスタマー管理ポリシーでカスタム IAM アクセス許可を定義する](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_create.html) を参照してください。

アイデンティティベースのポリシーは、*インラインポリシー* (単一の ID に直接埋め込む) または*管理ポリシー* (複数の ID にアタッチされたスタンドアロンポリシー) にすることができます。管理ポリシーとインラインポリシーのいずれかを選択する方法については、「*IAM ユーザーガイド*」の「[管理ポリシーとインラインポリシーのいずれかを選択する](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies-choosing-managed-or-inline.html)」を参照してください。

## AWS CodeConnections アクセス許可リファレンス
<a name="permissions-reference-connections"></a>

次の表に、各 AWS CodeConnections API オペレーション、アクセス許可を付与できる対応するアクション、およびアクセス許可を付与するために使用するリソース ARN の形式を示します。 AWS CodeConnections APIsは、その API で許可されるアクションの範囲に基づいてテーブルにグループ化されます。IAM アイデンティティ (アイデンティティベースのポリシー) にアタッチできるアクセス許可ポリシーを作成する際、参照してください。

アクセス許可ポリシーを作成するときに、ポリシーの `Action` フィールドでアクションを指定します。ポリシーの `Resource` フィールドで、ワイルドカード文字 (\$1) を使用して、または使用せずに、ARN としてリソース値を指定します。

接続ポリシーで条件を示すには、ここで説明され、[条件キー](security_iam_service-with-iam.md#security_iam_service-with-iam-id-based-policies-conditionkeys) に一覧表示されている条件キーを使用します。 AWS全体の条件キーを使用することもできます。 AWS全体のキーの完全なリストについては、*IAM ユーザーガイド*の[「使用可能なキー](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements.html#AvailableKeys)」を参照してください。

アクションを指定するには、API オペレーション名 (例えば、`codeconnections` や `codeconnections:ListConnections`) の前に `codeconnections:CreateConnection` プレフィックスを使用します。

**ワイルドカードの使用**

複数のアクションまたはリソースを指定するには、ARN でワイルドカード文字 (\$1) を使用します。たとえば、 `codeconnections:*`は all AWS CodeConnections アクションを指定し、 という単語で始まる all AWS CodeConnections アクション`codeconnections:Get*`を指定します`Get`。次の例では、`MyConnection` で始まる名前のすべてのリソースへのアクセスを許可します。

```
arn:aws:codeconnections:us-west-2:account-ID:connection/*
```

次のテーブルに示されている *接続*リソースでのみワイルドカードを使用できます。ワイルドカードを *region* または *account-id* リソースで使用することはできません。ワイルドカードの詳細については、*IAM ユーザーガイド*の [IAM ID](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html) を参照してください。

**Topics**
+ [接続を管理するアクセス許可](#permissions-reference-connections-managing)
+ [ホストを管理するためのアクセス許可](#permissions-reference-connections-hosts)
+ [接続を完了するためのアクセス許可](#permissions-reference-connections-handshake)
+ [ホスト設定のアクセス許可](#connections-permissions-actions-host-registration)
+ [サービスに接続を渡す](#permissions-reference-connections-passconnection)
+ [接続の使用](#permissions-reference-connections-use)
+ [`ProviderAction` でサポートされるアクセスタイプ](#permissions-reference-connections-access)
+ [接続リソースにタグ付けするためにサポートされているアクセス許可](#permissions-reference-connections-tagging)
+ [リポジトリリンクに接続を渡す](#permissions-reference-connections-passrepository)
+ [リポジトリリンクでサポートされる条件キー](#permissions-reference-connections-branch)
+ [接続共有でサポートされているアクセス許可](#permissions-reference-connections-sharing)

### 接続を管理するアクセス許可
<a name="permissions-reference-connections-managing"></a>

 AWS CLI または SDK を使用して接続を表示、作成、または削除するように指定されたロールまたはユーザーには、以下に制限されたアクセス許可が必要です。

**注記**  
次のアクセス許可のみでは、コンソールでの接続を完了または使用することはできません。[接続を完了するためのアクセス許可](#permissions-reference-connections-handshake) でアクセス許可を追加する必要があります。

```
codeconnections:CreateConnection
codeconnections:DeleteConnection
codeconnections:GetConnection
codeconnections:ListConnections
```

スクロールバーを使用して、テーブルの残りの部分を確認します。


**AWS CodeConnections が接続を管理するために必要なアクセス許可**  

| AWS CodeConnections アクション | 必要な許可  | リソース | 
| --- | --- | --- | 
|  CreateConnection  |  `codeconnections:CreateConnection` CLI またはコンソールを使用して接続を作成するために必要です。  |  arn:aws:codeconnections:*region*:*account-id*:connection/*connection-id*  | 
|  DeleteConnection  |  `codeconnections:DeleteConnection` CLI またはコンソールを使用して接続を削除するために必要です。  |  arn:aws:codeconnections:*region*:*account-id*:connection/*connection-id*  | 
|  GetConnection  |  `codeconnections:GetConnection` CLI またはコンソールを使用して接続の詳細を表示するために必要です。  |  arn:aws:codeconnections:*region*:*account-id*:connection/*connection-id*  | 
|  ListConnections  |  `codeconnections:ListConnections` CLI またはコンソールを使用してアカウント内のすべての接続を一覧表示するために必要です。  |  arn:aws:codeconnections:*region*:*account-id*:connection/*connection-id*  | 

これらのオペレーションでは、次の条件キーがサポートされます。


| Action | 条件キー | 
| --- | --- | 
|  `codeconnections:CreateConnection`  |  `codeconnections:ProviderType`  | 
|  codeconnections:DeleteConnection | 該当なし | 
| codeconnections:GetConnection | 該当なし | 
| codeconnections:ListConnections | codeconnections:ProviderTypeFilter | 

### ホストを管理するためのアクセス許可
<a name="permissions-reference-connections-hosts"></a>

 AWS CLI または SDK を使用してホストを表示、作成、または削除するように指定されたロールまたはユーザーには、以下に制限されたアクセス許可が必要です。

**注記**  
次のアクセス許可のみでは、ホストでの接続を完了または使用することはできません。[ホスト設定のアクセス許可](#connections-permissions-actions-host-registration) でアクセス許可を追加する必要があります。

```
codeconnections:CreateHost
codeconnections:DeleteHost
codeconnections:GetHost
codeconnections:ListHosts
```

スクロールバーを使用して、テーブルの残りの部分を確認します。


**AWS CodeConnections がホストを管理するために必要なアクセス許可**  

| AWS CodeConnections アクション | 必要な許可  | リソース | 
| --- | --- | --- | 
|  CreateHost  |  `codeconnections:CreateHost` CLI またはコンソールを使用してホストを作成するために必要です。  |  arn:aws:codeconnections:*region*:*account-id*:host/*host-id*  | 
|  DeleteHost  |  `codeconnections:DeleteHost` CLI またはコンソールを使用してホストを削除するために必要です。  |  codeconnections:*region*:*account-id*:host/*host-id*  | 
|  GetHost  |  `codeconnections:GetHost` CLI またはコンソールを使用してホストの詳細を表示するために必要です。  |  arn:aws:codeconnections:*region*:*account-id*:host/*host-id*  | 
|  ListHosts  |  `codeconnections:ListHosts` CLI またはコンソールを使用してアカウント内のすべてのホストを一覧表示するために必要です。  |  arn:aws:codeconnections:*region*:*account-id*:host/*host-id*  | 

これらのオペレーションでは、次の条件キーがサポートされます。


| Action | 条件キー | 
| --- | --- | 
|  `codeconnections:CreateHost`  |  `codeconnections:ProviderType` `codeconnections:VpcId`  | 
|  codeconnections:DeleteHost | 該当なし | 
| codeconnections:GetHost | 該当なし | 
| codeconnections:ListHosts | codeconnections:ProviderTypeFilter | 

**VpcId** 条件キーを使用するポリシーの例については、「」を参照してください[例: **VpcId** コンテキストキーを使用してホスト VPC アクセス許可を制限する](security_iam_id-based-policy-examples-connections.md#security_iam_id-based-policy-examples-connections-vpc)。

### 接続を完了するためのアクセス許可
<a name="permissions-reference-connections-handshake"></a>

コンソールで接続を管理するように指定されたロールまたはユーザーは、コンソールで接続を完了し、インストールを作成するために必要なアクセス許可を持っている必要があります。これには、プロバイダーへのハンドシェイクの許可と、使用する接続用のインストールの作成が含まれます。上記のアクセス許可に加えて、次のアクセス許可を使用します。

ブラウザベースのハンドシェイクを実行する際に、コンソールは、次の IAM オペレーションを使用します。`ListInstallationTargets`、`GetInstallationUrl`、`StartOAuthHandshake`、`UpdateConnectionInstallation`、`GetIndividualAccessToken` は IAM ポリシーアクセス許可です。API アクションではありません。

```
codeconnections:GetIndividualAccessToken
codeconnections:GetInstallationUrl
codeconnections:ListInstallationTargets
codeconnections:StartOAuthHandshake
codeconnections:UpdateConnectionInstallation
```

これに基づいて、コンソールで接続を使用、作成、更新、または削除するには、次のアクセス許可が必要です。

```
codeconnections:CreateConnection
codeconnections:DeleteConnection
codeconnections:GetConnection
codeconnections:ListConnections
codeconnections:UseConnection
codeconnections:ListInstallationTargets
codeconnections:GetInstallationUrl
codeconnections:StartOAuthHandshake
codeconnections:UpdateConnectionInstallation
codeconnections:GetIndividualAccessToken
```

スクロールバーを使用して、テーブルの残りの部分を確認します。


**AWS CodeConnections が接続を完了するために必要なアクセス許可**  

| AWS CodeConnections アクション | 必要な許可  | リソース | 
| --- | --- | --- | 
|  `GetIndividualAccessToken`  |  `codeconnections:GetIndividualAccessToken` コンソールを使用接続を完了するために必要です。これは単なる IAM ポリシーのアクセス許可であり、API アクションではありません。  |  arn:aws:codeconnections:*region*:*account-id*:connection/*connection-id*  | 
|  `GetInstallationUrl`  |  `codeconnections:GetInstallationUrl` コンソールを使用して接続を完了するために必要です。これは単なる IAM ポリシーのアクセス許可であり、API アクションではありません。  |  arn:aws:codeconnections:*region*:*account-id*:connection/*connection-id*  | 
|  `ListInstallationTargets`  |  `codeconnections:ListInstallationTargets` コンソールを使用して接続を完了するために必要です。これは単なる IAM ポリシーのアクセス許可であり、API アクションではありません。  |  arn:aws:codeconnections:*region*:*account-id*:connection/*connection-id*  | 
|  `StartOAuthHandshake`  |  `codeconnections:StartOAuthHandshake` コンソールを使用して接続を完了するために必要です。これは単なる IAM ポリシーのアクセス許可であり、API アクションではありません。  |  arn:aws:codeconnections:*region*:*account-id*:connection/*connection-id*  | 
|  `UpdateConnectionInstallation`  |  `codeconnections:UpdateConnectionInstallation` コンソールを使用して接続を完了するために必要です。これは単なる IAM ポリシーのアクセス許可であり、API アクションではありません。  |  arn:aws:codeconnections:*region*:*account-id*:connection/*connection-id*  | 

これらのオペレーションでは、次の条件キーがサポートされます。


| Action | 条件キー | 
| --- | --- | 
| codeconnections:GetIndividualAccessToken | codeconnections:ProviderType | 
|  codeconnections:GetInstallationUrl | codeconnections:ProviderType | 
|  `codeconnections:ListInstallationTargets`  |  該当なし  | 
| codeconnections:StartOAuthHandshake | codeconnections:ProviderType | 
| codeconnections:UpdateConnectionInstallation | codeconnections:InstallationId | 

### ホスト設定のアクセス許可
<a name="connections-permissions-actions-host-registration"></a>

コンソールで接続を管理するように指定されたロールまたはユーザーは、コンソールでホストをセットアップするために必要なアクセス許可が必要です。これには、プロバイダーへのハンドシェイクの許可とホストアプリのインストールが含まれます。上記のホストのアクセス許可に加えて、次のアクセス許可を使用します。

ブラウザベースのホスト登録を実行するときに、次の IAM オペレーションがコンソールで使用されます。`RegisterAppCode` および `StartAppRegistrationHandshake` は IAM ポリシーのアクセス許可です。API アクションではありません。

```
codeconnections:RegisterAppCode
codeconnections:StartAppRegistrationHandshake
```

これに基づき、以下のアクセス許可を使用して、コンソールでホストを必要とする接続 (インストール済プロバイダータイプなど) を使用、作成、更新、または削除します。

```
codeconnections:CreateConnection
codeconnections:DeleteConnection
codeconnections:GetConnection
codeconnections:ListConnections
codeconnections:UseConnection
codeconnections:ListInstallationTargets
codeconnections:GetInstallationUrl
codeconnections:StartOAuthHandshake
codeconnections:UpdateConnectionInstallation
codeconnections:GetIndividualAccessToken
codeconnections:RegisterAppCode
codeconnections:StartAppRegistrationHandshake
```

スクロールバーを使用して、テーブルの残りの部分を確認します。


**AWS CodeConnections がホスト設定を完了するために必要なアクセス許可**  

| 接続アクション | 必要な許可  | リソース | 
| --- | --- | --- | 
|  `RegisterAppCode`  |  `codeconnections:RegisterAppCode` コンソールを使用してホストのセットアップを完了するために必要です。これは単なる IAM ポリシーのアクセス許可であり、API アクションではありません。  |  arn:aws:codeconnections:*region*:*account-id*:host/*host-id*  | 
|  `StartAppRegistrationHandshake`  |  `codeconnections:StartAppRegistrationHandshake` コンソールを使用してホストのセットアップを完了するために必要です。これは単なる IAM ポリシーのアクセス許可であり、API アクションではありません。  |  arn:aws:codeconnections:*region*:*account-id*:host/*host-id*  | 

これらのオペレーションでは、次の条件キーがサポートされます。

### サービスに接続を渡す
<a name="permissions-reference-connections-passconnection"></a>

サービスに接続を渡す際 (例えば、パイプラインを作成または更新するためにパイプライン定義で接続 ARN が提供されるなど)、ユーザーには `codeconnections:PassConnection` のアクセス許可が必要です。

スクロールバーを使用して、テーブルの残りの部分を確認します。


**AWS CodeConnections が接続を渡すために必要なアクセス許可**  

| AWS CodeConnections アクション | 必要な許可  | リソース | 
| --- | --- | --- | 
|  `PassConnection`  |  `codeconnections:PassConnection` サービスに接続を渡すために必要です。  |  arn:aws:codeconnections:*region*:*account-id*:connection/*connection-id*  | 

このオペレーションでは、次の条件キーもサポートされます。
+ `codeconnections:PassedToService`


**条件キーでサポートされる値**  

| Key | 有効なアクションプロバイダー | 
| --- | --- | 
|  `codeconnections:PassedToService`  |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ja_jp/dtconsole/latest/userguide/security-iam.html)  | 

### 接続の使用
<a name="permissions-reference-connections-use"></a>

CodePipeline のようなサービスが接続を使用する場合、サービスロールは特定の接続に対する `codeconnections:UseConnection` のアクセス許可を持っている必要があります。

コンソールで接続を管理するには、ユーザーポリシーに `codeconnections:UseConnection` アクセス許可が必要です。

スクロールバーを使用して、テーブルの残りの部分を確認します。


**接続を使用するために必要なAWS CodeConnections アクション**  

| AWS CodeConnections アクション | 必要な許可  | リソース | 
| --- | --- | --- | 
|  `UseConnection`  |  `codeconnections:UseConnection` 接続を使用するために必要です。  |  arn:aws:codeconnections:*region*:*account-id*:connection/*connection-id*  | 

このオペレーションでは、次の条件キーもサポートされます。
+ `codeconnections:BranchName`
+ `codeconnections:FullRepositoryId`
+ `codeconnections:OwnerId`
+ `codeconnections:ProviderAction`
+ `codeconnections:ProviderPermissionsRequired`
+ `codeconnections:RepositoryName`


**条件キーでサポートされる値**  

| Key | 有効なアクションプロバイダー | 
| --- | --- | 
|  `codeconnections:FullRepositoryId`  |  ユーザー名とリポジトリ名 (`my-owner/my-repository` など)。接続を使用して特定のリポジトリにアクセスする場合のみサポートされます。  | 
|  `codeconnections:ProviderPermissionsRequired`  |  read\$1only または read\$1write  | 
|  `codeconnections:ProviderAction`  |  `GetBranch`, `ListRepositories`, `ListOwners`, `ListBranches`, `StartUploadArchiveToS3`, `GitPush`, `GitPull`, `GetUploadArchiveToS3Status`, `CreatePullRequestDiffComment`, `GetPullRequest`, `ListBranchCommits`, `ListCommitFiles`, `ListPullRequestComments`, `ListPullRequestCommits`. 詳細については、次のセクションをご覧ください。  | 

一部の機能に必要な条件キーは、時間の経過とともに変化する可能性があります。アクセスコントロールの要件で、異なるアクセス許可が必要でない限り、`codeconnections:UseConnection` を使用して接続へのアクセスを制御することをお勧めします。

### `ProviderAction` でサポートされるアクセスタイプ
<a name="permissions-reference-connections-access"></a>

 AWS サービスで接続を使用すると、ソースコードプロバイダーに対して API コールが行われます。例えば、`https://api.bitbucket.org/2.0/repositories/username` API をコールすることによって、サービスは、Bitbucket 接続のリポジトリを一覧表示できます。

`ProviderAction` 条件キーを使用すると、プロバイダのどの API をコールすることができるかを制限できます。API パスは動的に生成される場合があり、パスはプロバイダーによって異なるため、`ProviderAction` 値は API の URL ではなく抽象アクション名にマッピングされます。これにより、接続のプロバイダーの種類に関係なく、同じ効果を持つポリシーを書くことができます。

サポートされている各 `ProviderAction` 値に対して許可されるアクセスタイプは次のとおりです。以下は IAM ポリシーアクセス許可です。API アクションではありません。

スクロールバーを使用して、テーブルの残りの部分を確認します。


**でAWS CodeConnections がサポートするアクセスタイプ `ProviderAction`**  

| AWS CodeConnections アクセス許可 | 必要な許可  | リソース | 
| --- | --- | --- | 
|  `GetBranch`  |  ` codeconnections:GetBranch` ブランチの最新のコミットなど、ブランチに関する情報にアクセスするために必要です。  |  arn:aws:codeconnections:*region*:*account-id*:connection/*connection-id*  | 
|  `ListRepositories`  |  ` codeconnections:ListRepositories` 所有者に属する公開および非公開リポジトリーのリストにアクセスするために必要です。  |  arn:aws:codeconnections:*region*:*account-id*:connection/*connection-id*  | 
|  `ListOwners`  |  `codeconnections:ListOwners` 接続がアクセスできる所有者のリストにアクセスするために必要です。　　　  |  arn:aws:codeconnections:*region*:*account-id*:connection/*connection-id*  | 
|  `ListBranches`  |  ` codeconnections:ListBranches` 指定したリポジトリに存在するブランチのリストにアクセスするために必要です。  |  arn:aws:codeconnections:*region*:*account-id*:connection/*connection-id*  | 
|  `StartUploadArchiveToS3`  |  ` codeconnections:StartUploadArchiveToS3` ソースコードを読み取り、Amazon S3 にアップロードするために必要です。  |  arn:aws:codeconnections:*region*:*account-id*:connection/*connection-id*  | 
|  `GitPush`  |  ` codeconnections:GitPush` Git を使用してリポジトリに書き込むために必要です。  |  arn:aws:codeconnections:*region*:*account-id*:connection/*connection-id*  | 
|  `GitPull`  |  ` codeconnections:GitPull` Git を使用してリポジトリから読み込むために必要です。  |  arn:aws:codeconnections:*region*:*account-id*:connection/*connection-id*  | 
| GetUploadArchiveToS3Status |  ` codeconnections:GetUploadArchiveToS3Status` `StartUploadArchiveToS3` で始まるエラーメッセージを含む、アップロードのステータスにアクセスするために必要です。  |  arn:aws:codeconnections:*region*:*account-id*:connection/*connection-id*  | 
| CreatePullRequestDiffComment |  ` codeconnections:CreatePullRequestDiffComment` プルリクエストのコメントにアクセスするために必要です。  |  arn:aws:codeconnections:*region*:*account-id*:connection/*connection-id*  | 
| GetPullRequest |  ` codeconnections:GetPullRequest` リポジトリのプルリクエストを表示するために必要です。  |  arn:aws:codeconnections:*region*:*account-id*:connection/*connection-id*  | 
|  `ListBranchCommits`  |  ` codeconnections:ListBranchCommits` リポジトリブランチのコミットのリストを表示するために必要です。  |  arn:aws:codeconnections:*region*:*account-id*:connection/*connection-id*  | 
|  `ListCommitFiles`  |  ` codeconnections:ListCommitFiles` コミットのファイルのリストを表示するために必要です。  |  arn:aws:codeconnections:*region*:*account-id*:connection/*connection-id*  | 
|  `ListPullRequestComments`  |  ` codeconnections:ListPullRequestComments` プルリクエストのコメントのリストを表示するために必要です。  |  arn:aws:codeconnections:*region*:*account-id*:connection/*connection-id*  | 
|  `ListPullRequestCommits`  |  ` codeconnections:ListPullRequestCommits` プルリクエストのコミットのリストを表示するために必要です。  |  arn:aws:codeconnections:*region*:*account-id*:connection/*connection-id*  | 

### 接続リソースにタグ付けするためにサポートされているアクセス許可
<a name="permissions-reference-connections-tagging"></a>

次の IAM オペレーションは、接続リソースをタグ付けするときに使用されます。

```
codeconnections:ListTagsForResource
codeconnections:TagResource
codeconnections:UntagResource
```

スクロールバーを使用して、テーブルの残りの部分を確認します。


**AWS CodeConnections で接続リソースのタグ付けに必要なアクション**  

| AWS CodeConnections アクション | 必要な許可  | リソース | 
| --- | --- | --- | 
|  `ListTagsForResource`  |  `codeconnections:ListTagsForResource` 接続リソースに関連付けられているタグのリストを表示するために必要です。  | arn:aws:codeconnections:*region*:*account-id*:connection/*connection-id*,arn:aws:codeconnections:*region*:*account-id*:host/*host-id* | 
|  `TagResource`  |  `codeconnections:TagResource` 接続リソースにタグを付けるために必要です。  | arn:aws:codeconnections:*region*:*account-id*:connection/*connection-id*,arn:aws:codeconnections:*region*:*account-id*:host/*host-id* | 
|  `UntagResource`  |  `codeconnections:UntagResource` 接続リソースからタグを解除するために必要です。  | arn:aws:codeconnections:*region*:*account-id*:connection/*connection-id*,arn:aws:codeconnections:*region*:*account-id*:host/*host-id* | 

### リポジトリリンクに接続を渡す
<a name="permissions-reference-connections-passrepository"></a>

同期設定でリポジトリリンクを提供する場合、ユーザーにはリポジトリリンク ARN/リソースに対する `codeconnections:PassRepository` アクセス許可が必要です。

スクロールバーを使用して、テーブルの残りの部分を確認します。


**AWS CodeConnections が接続を渡すために必要なアクセス許可**  

| AWS CodeConnections アクション | 必要な許可  | リソース | 
| --- | --- | --- | 
|  `PassRepository`  |  `codeconnections:PassRepository` リポジトリリンクを同期設定に渡すために必要です。  |  arn:aws:codeconnections:*region*:*account-id*:repository-link/*repository-link-id*  | 

このオペレーションでは、次の条件キーもサポートされます。
+ `codeconnections:PassedToService`


**条件キーでサポートされる値**  

| Key | 有効なアクションプロバイダー | 
| --- | --- | 
|  `codeconnections:PassedToService`  |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ja_jp/dtconsole/latest/userguide/security-iam.html)  | 

### リポジトリリンクでサポートされる条件キー
<a name="permissions-reference-connections-branch"></a>

リポジトリリンクと同期設定リソースの操作は、以下の条件キーでサポートされています。
+ `codeconnections:Branch`

  リクエストで渡されたブランチ名でアクセスをフィルタリングします


**条件キーでサポートされるアクション**  

| Key | 有効値 | 
| --- | --- | 
|  `codeconnections:Branch`  | 以下のアクションが、この条件キーに対してサポートされています。[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ja_jp/dtconsole/latest/userguide/security-iam.html) | 

### 接続共有でサポートされているアクセス許可
<a name="permissions-reference-connections-sharing"></a>

接続を共有するときは、次の IAM オペレーションが使用されます。

```
codeconnections:GetResourcePolicy
```

スクロールバーを使用して、テーブルの残りの部分を確認します。


**AWS CodeConnections で接続を共有するために必要なアクション**  

| AWS CodeConnections アクション | 必要な許可  | リソース | 
| --- | --- | --- | 
|  `GetResourcePolicy`  |  `codeconnections:GetResourcePolicy` リソースポリシーに関する情報にアクセスするために必要です。  | arn:aws:codeconnections:*region*:*account-id*:connection/*connection-id* | 

接続共有の詳細については、「」を参照してください[と接続を共有する AWS アカウント](connections-share.md)。

## コンソールでの通知と接続の使用
<a name="security_iam_id-based-policy-examples-console"></a>

この通知エクスペリエンスは、CodeBuild、CodeCommit、CodeDeploy、CodePipeline の各コンソールの他、[**設定**] ナビゲーションバー自体のデベロッパーツールコンソールにも組み込まれています。コンソールで通知にアクセスするには、それらのサービスにいずれかの管理ポリシーを適用するか、最小限のアクセス許可のセットが必要です。これらのアクセス許可により、 AWS アカウントの AWS CodeStar Notifications および AWS CodeConnections リソースの詳細を一覧表示および表示できます。最小限必要な許可よりも厳しく制限されたアイデンティティベースポリシーを作成すると、そのポリシーを添付したエンティティ (IAM ユーザーまたはロール) に対してコンソールが意図したとおりに機能しません。これらのコンソールへのアクセスの許可 AWS CodeBuild AWS CodeCommit AWS CodeDeploy、およびそれらのコンソールへのアクセスの許可の詳細については AWS CodePipeline、以下のトピックを参照してください。
+ CodeBuild: [CodeBuild のアイデンティティベースのポリシーの使用](https://docs.aws.amazon.com/codebuild/latest/userguide/security_iam_id-based-policy-examples.html#managed-policies)
+ CodeCommit: [CodeCommit のアイデンティティベースのポリシーの使用](https://docs.aws.amazon.com/codecommit/latest/userguide/auth-and-access-control-iam-identity-based-access-control.html)
+ AWS CodeDeploy: [の ID とアクセスの管理 AWS CodeDeploy](https://docs.aws.amazon.com/codedeploy/latest/userguide/security-iam.html)
+ CodePipeline: [IAM ポリシーを使用したアクセスコントロール](https://docs.aws.amazon.com/codepipeline/latest/userguide/access-control.html)

AWS CodeStar Notifications には AWS 管理ポリシーはありません。通知機能へのアクセスを提供するには、上記のいずれかのサービスに対する管理ポリシーの 1 つを適用するか、ユーザーまたはエンティティに付与するアクセス許可のレベルでポリシーを作成してから、これらのアクセス許可が必要なユーザー、グループ、またはロールにそれらのポリシーをアタッチする必要があります。詳細については、次の例を参照してください。
+ [例: AWS CodeStar Notifications を管理するための管理者レベルのポリシー](security_iam_id-based-policy-examples-notifications.md#security_iam_id-based-policy-examples-notifications-full-access)
+ [例: AWS CodeStar Notifications を使用するためのコントリビューターレベルのポリシー](security_iam_id-based-policy-examples-notifications.md#security_iam_id-based-policy-examples-notifications-contributor)
+ [例: AWS CodeStar Notifications を使用するためのread-only-levelポリシー](security_iam_id-based-policy-examples-notifications.md#security_iam_id-based-policy-examples-notifications-read-only).



AWS CodeConnections には AWS 管理ポリシーはありません。[接続を完了するためのアクセス許可](#permissions-reference-connections-handshake) で詳しく説明している許可など、アクセスの許可や許可の組み合わせを使用します。

詳細については次を参照してください:
+ [例: を管理するための管理者レベルのポリシー AWS CodeConnections](security_iam_id-based-policy-examples-connections.md#security_iam_id-based-policy-examples-connections-fullaccess)
+ [例: を使用するための寄稿者レベルのポリシー AWS CodeConnections](security_iam_id-based-policy-examples-connections.md#security_iam_id-based-policy-examples-connections-contributor)
+ [例: を使用するためのread-only-levelポリシー AWS CodeConnections](security_iam_id-based-policy-examples-connections.md#security_iam_id-based-policy-examples-connections-readonly)

 AWS CLI または AWS API のみを呼び出すユーザーには、コンソールのアクセス許可を付与する必要はありません。代わりに、実行しようとしている API オペレーションに一致するアクションのみへのアクセスが許可されます。

## ユーザーが自分の許可を表示できるようにする
<a name="security_iam_id-based-policy-examples-view-own-permissions"></a>

この例では、ユーザーアイデンティティにアタッチされたインラインおよびマネージドポリシーの表示を IAM ユーザーに許可するポリシーの作成方法を示します。このポリシーには、コンソールで、または AWS CLI または AWS API を使用してプログラムでこのアクションを実行するアクセス許可が含まれています。

```
{
    "Version": "2012-10-17",		 	 	 
    "Statement": [
        {
            "Sid": "ViewOwnUserInfo",
            "Effect": "Allow",
            "Action": [
                "iam:GetUserPolicy",
                "iam:ListGroupsForUser",
                "iam:ListAttachedUserPolicies",
                "iam:ListUserPolicies",
                "iam:GetUser"
            ],
            "Resource": ["arn:aws:iam::*:user/${aws:username}"]
        },
        {
            "Sid": "NavigateInConsole",
            "Effect": "Allow",
            "Action": [
                "iam:GetGroupPolicy",
                "iam:GetPolicyVersion",
                "iam:GetPolicy",
                "iam:ListAttachedGroupPolicies",
                "iam:ListGroupPolicies",
                "iam:ListPolicyVersions",
                "iam:ListPolicies",
                "iam:ListUsers"
            ],
            "Resource": "*"
        }
    ]
}
```