AWS CodeStar 알림에 대한 권한 및 예제 - 개발자 도구 콘솔

기계 번역으로 제공되는 번역입니다. 제공된 번역과 원본 영어의 내용이 상충하는 경우에는 영어 버전이 우선합니다.

AWS CodeStar 알림에 대한 권한 및 예제

다음 정책 설명 및 예는 AWS CodeStar 알림을 관리하는 데 도움이 될 수 있습니다.

전체 액세스 관리형 정책의 알림과 관련된 권한

AWSCodeCommitFullAccess, AWSCodeBuildAdminAccessAWSCodeDeployFullAccess, 및 AWSCodePipeline_ 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": "*" }

읽기 전용 관리형 정책의 알림과 관련된 권한

AWSCodeCommitReadOnlyAccess, AWSCodeBuildReadOnlyAccessAWSCodeDeployReadOnlyAccess, 및 AWSCodePipeline_ ReadOnlyAccess 관리형 정책에는 알림에 대한 읽기 전용 액세스를 허용하는 다음 명령문이 포함됩니다. 예를 들어 개발자 도구 콘솔에서 리소스에 대한 알림을 볼 수 있지만 리소스를 생성, 관리 또는 구독할 수는 없습니다.

참고

관리형 정책에서 조건 키 codestar-notifications:NotificationsForResource는 서비스의 리소스 유형에 특정한 값을 갖습니다. 예를 들어, 의 전체 액세스 정책에서 값은 입니다arn:aws:codecommit:*. 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": "*" }

다른 관리형 정책의 알림과 관련된 권한

AWSCodeCommitPowerUser, AWSCodeBuildDeveloperAccess, 및 AWSCodeBuildDeveloperAccess관리형 정책에는 이러한 관리형 정책 중 하나를 적용한 개발자가 알림을 생성, 편집 및 구독할 수 있도록 하는 다음 명령문이 포함됩니다. 알림 규칙을 삭제하거나 리소스에 대한 태그를 관리할 수는 없습니다.

참고

관리형 정책에서 조건 키 codestar-notifications:NotificationsForResource는 서비스의 리소스 유형에 특정한 값을 갖습니다. 예를 들어, 의 전체 액세스 정책에서 값은 다음과 같습니다arn:aws:codecommit:*. 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 계정의 사용자에게 알림에 대한 모든 액세스 권한을 부여하여 IAM 사용자가 AWS CodeStar 알림 규칙의 세부 정보를 검토하고 알림 규칙, 대상 및 이벤트 유형을 나열할 수 있도록 하려고 합니다. 또한 사용자가 알림 규칙을 추가, 업데이트 및 삭제하도록 허용하려고 합니다. 이는 전체 액세스 정책으로,,, AWSCodePipeline_ FullAccess 관리형 정책의 일부로 포함된 알림 권한과 동일합니다. AWSCodeBuildAdminAccessAWSCodeCommitFullAccessAWSCodeDeployFullAccess 이러한 관리형 정책과 마찬가지로 AWS 계정 전체의 알림 및 알림 규칙에 대한 전체 관리 액세스 권한이 필요한 IAM 사용자, 그룹 또는 역할에만 이러한 종류의 정책 설명을 추가해야 합니다.

참고

이 정책에는 CreateNotificationRule 허용이 포함되어 있습니다. 이 정책을 IAM 사용자 또는 역할에 적용한 모든 사용자는 해당 사용자가 해당 리소스에 직접 액세스할 수 없더라도 AWS 계정의 알림이 지원하는 모든 리소스 유형에 대한 AWS CodeStar 알림 규칙을 만들 수 있습니다. 예를 들어 이 정책을 사용하는 사용자는 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 사용에 대한 액세스 권한을 부여하고 알림 규칙 또는 대상 삭제와 같은 더 파괴적인 작업에는 액세스하지 않으려고 합니다. 이는 AWSCodeBuildDeveloperAccess, AWSCodeDeployDeveloperAccess, 관리형 정책에서 제공하는 액세스와 AWSCodeCommitPowerUser동일합니다.

참고

이 정책에는 CreateNotificationRule 허용이 포함되어 있습니다. IAM사용자 또는 역할에 이 정책을 적용한 모든 사용자는 해당 리소스에 대한 액세스 권한이 없더라도 AWS 계정의 알림이 지원하는 모든 리소스 유형에 대한 AWS CodeStar 알림 규칙을 만들 수 있습니다. 예를 들어 이 정책을 사용하는 사용자는 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 . 이 예제에서는 이러한 항목의 보기를 허용하는 정책을 생성할 수 있는 방법을 보여줍니다. 이는 AWSCodeBuildReadOnlyAccess, AWSCodeCommitReadOnly, AWSCodePipeline_ 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": "*" } ] }