AWS CodeStar 通知のアクセス許可と例 - デベロッパーツールコンソール

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

AWS CodeStar 通知のアクセス許可と例

以下のポリシーステートメントと例は、 AWS CodeStar 通知の管理に役立ちます。

フルアクセスマネージドポリシーの通知に関連するアクセス許可

AWSCodeCommitFullAccessAWSCodeBuildAdminAccessAWSCodeDeployFullAccessAWSCodePipeline_FullAccess管理ポリシーには、デベロッパーツールコンソールの通知へのフルアクセスを許可する以下のステートメントが含まれています。これらの管理ポリシーのいずれかが適用されたユーザーは、通知の Amazon SNS トピックの作成と管理、トピックに対するユーザーのサブスクライブとサブスクライブ解除、通知ルールのターゲットとして選択するトピックの一覧表示を行うこともできます。

注記

管理ポリシーでは、条件キー codestar-notifications:NotificationsForResource はサービスのリソースタイプに固有の値を持ちます。例えば、 のフルアクセスポリシーでは CodeCommit、値は ですarn:aws:codecommit:*

{ "Sid": "CodeStarNotificationsReadWriteAccess", "Effect": "Allow", "Action": [ "codestar-notifications:CreateNotificationRule", "codestar-notifications:DescribeNotificationRule", "codestar-notifications:UpdateNotificationRule", "codestar-notifications:DeleteNotificationRule", "codestar-notifications:Subscribe", "codestar-notifications:Unsubscribe" ], "Resource": "*", "Condition" : { "StringLike" : {"codestar-notifications:NotificationsForResource" : "arn:aws:<vendor-code>:*"} } }, { "Sid": "CodeStarNotificationsListAccess", "Effect": "Allow", "Action": [ "codestar-notifications:ListNotificationRules", "codestar-notifications:ListTargets", "codestar-notifications:ListTagsforResource", "codestar-notifications:ListEventTypes" ], "Resource": "*" }, { "Sid": "CodeStarNotificationsSNSTopicCreateAccess", "Effect": "Allow", "Action": [ "sns:CreateTopic", "sns:SetTopicAttributes" ], "Resource": "arn:aws:sns:*:*:codestar-notifications*" }, { "Sid": "SNSTopicListAccess", "Effect": "Allow", "Action": [ "sns:ListTopics" ], "Resource": "*" }, { "Sid": "CodeStarNotificationsChatbotAccess", "Effect": "Allow", "Action": [ "chatbot:DescribeSlackChannelConfigurations", "chatbot:ListMicrosoftTeamsChannelConfigurations" ], "Resource": "*" }

読み取り専用マネージドポリシーの通知に関連するアクセス許可

AWSCodeCommitReadOnlyAccessAWSCodeBuildReadOnlyAccessAWSCodeDeployReadOnlyAccessAWSCodePipeline_ReadOnlyAccess管理ポリシーには、通知への読み取り専用アクセスを許可する以下のステートメントが含まれています。例えば、デベロッパーツールコンソールでリソースの通知を表示することはできますが、リソースを作成、管理、サブスクライブすることはできません。

注記

管理ポリシーでは、条件キー codestar-notifications:NotificationsForResource はサービスのリソースタイプに固有の値を持ちます。例えば、 のフルアクセスポリシーでは CodeCommit、値は ですarn:aws:codecommit:*

{ "Sid": "CodeStarNotificationsPowerUserAccess", "Effect": "Allow", "Action": [ "codestar-notifications:DescribeNotificationRule" ], "Resource": "*", "Condition" : { "StringLike" : {"codestar-notifications:NotificationsForResource" : "arn:aws:<vendor-code>:*"} } }, { "Sid": "CodeStarNotificationsListAccess", "Effect": "Allow", "Action": [ "codestar-notifications:ListNotificationRules", "codestar-notifications:ListEventTypes", "codestar-notifications:ListTargets" ], "Resource": "*" }

その他の管理ポリシーの通知に関連するアクセス許可

AWSCodeCommitPowerUserAWSCodeBuildDeveloperAccessAWSCodeBuildDeveloperAccess管理ポリシーには、これらの管理ポリシーのいずれかが適用されたデベロッパーが通知を作成、編集、サブスクライブできるようにする以下のステートメントが含まれています。通知ルールを削除したり、リソースのタグを管理したりすることはできません。

注記

管理ポリシーでは、条件キー codestar-notifications:NotificationsForResource はサービスのリソースタイプに固有の値を持ちます。例えば、 のフルアクセスポリシーでは CodeCommit、値は ですarn:aws:codecommit:*

{ "Sid": "CodeStarNotificationsReadWriteAccess", "Effect": "Allow", "Action": [ "codestar-notifications:CreateNotificationRule", "codestar-notifications:DescribeNotificationRule", "codestar-notifications:UpdateNotificationRule", "codestar-notifications:Subscribe", "codestar-notifications:Unsubscribe" ], "Resource": "*", "Condition" : { "StringLike" : {"codestar-notifications:NotificationsForResource" : "arn:aws:<vendor-code>:*"} } }, { "Sid": "CodeStarNotificationsListAccess", "Effect": "Allow", "Action": [ "codestar-notifications:ListNotificationRules", "codestar-notifications:ListTargets", "codestar-notifications:ListTagsforResource", "codestar-notifications:ListEventTypes" ], "Resource": "*" }, { "Sid": "SNSTopicListAccess", "Effect": "Allow", "Action": [ "sns:ListTopics" ], "Resource": "*" }, { "Sid": "CodeStarNotificationsChatbotAccess", "Effect": "Allow", "Action": [ "chatbot:DescribeSlackChannelConfigurations", "chatbot:ListMicrosoftTeamsChannelConfigurations" ], "Resource": "*" }

例: AWS CodeStar 通知を管理するための管理者レベルのポリシー

この例では、 AWS CodeStar ユーザーが通知ルールの詳細を確認し、通知ルール、ターゲット、イベントタイプを一覧表示できるように、 AWS アカウントの IAM ユーザーに通知へのフルアクセスを付与します。また、通知ルールの追加、更新、および削除をユーザーに許可します。これはフルアクセスポリシーであり、、AWSCodeBuildAdminAccess、、 AWSCodeCommitFullAccess AWSCodeDeployFullAccessAWSCodePipeline_FullAccess管理ポリシーの一部として含まれる通知アクセス許可に相当します。これらの管理ポリシーと同様に、この種のポリシーステートメントは、 AWS アカウント全体の通知および通知ルールへの完全な管理アクセスを必要とする IAM ユーザー、グループ、またはロールにのみアタッチする必要があります。

注記

このポリシーには、許可として CreateNotificationRule が含まれています。このポリシーが IAM ユーザーまたはロールに適用されているユーザーは、そのユーザーがそれらのリソース自体にアクセスできない場合でも、 AWS アカウントの AWS CodeStar Notifications でサポートされているすべてのリソースタイプの通知ルールを作成できます。例えば、このポリシーを持つユーザーは、それ自体にアクセスする CodeCommitアクセス許可を持たない CodeCommit リポジトリの通知ルールを作成できます。

{ "Version": "2012-10-17", "Statement": [ { "Sid": "AWSCodeStarNotificationsFullAccess", "Effect": "Allow", "Action": [ "codestar-notifications:CreateNotificationRule", "codestar-notifications:DeleteNotificationRule", "codestar-notifications:DescribeNotificationRule", "codestar-notifications:ListNotificationRules", "codestar-notifications:UpdateNotificationRule", "codestar-notifications:Subscribe", "codestar-notifications:Unsubscribe", "codestar-notifications:DeleteTarget", "codestar-notifications:ListTargets", "codestar-notifications:ListTagsforResource", "codestar-notifications:TagResource", "codestar-notifications:UntagResource" ], "Resource": "*" } ] }

例: AWS CodeStar 通知を使用するための寄稿者レベルのポリシー

この例では、 AWS CodeStar 通知の作成やサブスクライブなど、通知 day-to-day の使用に対するアクセス権を付与しますが、通知ルールやターゲットの削除など、より破壊的なアクションに対するアクセス権は付与しません。これは、、AWSCodeBuildDeveloperAccessAWSCodeDeployDeveloperAccessAWSCodeCommitPowerUserマネージドポリシーで提供されるアクセスと同等です。

注記

このポリシーには、許可として CreateNotificationRule が含まれています。このポリシーが IAM ユーザーまたはロールに適用されているユーザーは、そのユーザーがそれらのリソース自体にアクセスできない場合でも、 AWS アカウントの AWS CodeStar Notifications でサポートされているすべてのリソースタイプの通知ルールを作成できます。例えば、このポリシーを持つユーザーは、それ自体にアクセスする CodeCommitアクセス許可を持たない CodeCommit リポジトリの通知ルールを作成できます。

{ "Version": "2012-10-17", "Sid": "AWSCodeStarNotificationsPowerUserAccess", "Effect": "Allow", "Action": [ "codestar-notifications:CreateNotificationRule", "codestar-notifications:DescribeNotificationRule", "codestar-notifications:ListNotificationRules", "codestar-notifications:UpdateNotificationRule", "codestar-notifications:Subscribe", "codestar-notifications:Unsubscribe", "codestar-notifications:ListTargets", "codestar-notifications:ListTagsforResource" ], "Resource": "*" } ] }

例: AWS CodeStar 通知を使用するための read-only-level ポリシー

次の例では、アカウントの IAM ユーザーに対して、 AWS アカウントで通知ルール、ターゲット、およびイベントタイプへの読み取り専用アクセスを付与します。この例は、これらの項目の表示を許可するポリシーの作成方法を示しています。これは、、AWSCodeBuildReadOnlyAccessAWSCodeCommitReadOnlyAWSCodePipeline_ReadOnlyAccessマネージドポリシーの一部として含まれるアクセス許可と同等です。

{ "Version": "2012-10-17", "Id": "CodeNotification__ReadOnly", "Statement": [ { "Sid": "Reads_API_Access", "Effect": "Allow", "Action": [ "CodeNotification:DescribeNotificationRule", "CodeNotification:ListNotificationRules", "CodeNotification:ListTargets", "CodeNotification:ListEventTypes" ], "Resource": "*" } ] }