

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

# AWS CodeStar Notifications에 대한 권한 및 예제
<a name="security_iam_id-based-policy-examples-notifications"></a>

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

## 전체 액세스 관리형 정책의 알림과 관련된 권한
<a name="notifications-fullaccess"></a>

**AWSCodeCommitFullAccess**, **AWSCodeBuildAdminAccess**, **AWSCodeDeployFullAccess**, **AWSCodePipeline\$1FullAccess** 관리형 정책에는 개발자 도구 콘솔의 알림에 대한 전체 액세스를 허용하는 다음 문이 포함되어 있습니다. 이러한 관리형 정책 중 하나가 적용된 사용자는 알림에 대한 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": "*"
    }
```

## 읽기 전용 관리형 정책의 알림과 관련된 권한
<a name="notifications-readonly"></a>

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

**참고**  
관리형 정책에서 조건 키 `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": "*"
    }
```

## 다른 관리형 정책의 알림과 관련된 권한
<a name="notifications-otheraccess"></a>

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

**참고**  
관리형 정책에서 조건 키 `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 알림을 관리하기 위한 관리자 수준 정책
<a name="security_iam_id-based-policy-examples-notifications-full-access"></a>

이 예제에서는 AWS 계정의 IAM 사용자에게 AWS CodeStar Notifications에 대한 전체 액세스 권한을 부여하여 사용자가 알림 규칙의 세부 정보를 검토하고 알림 규칙, 대상 및 이벤트 유형을 나열할 수 있도록 하려고 합니다. 또한 사용자가 알림 규칙을 추가, 업데이트 및 삭제하도록 허용하려고 합니다. 이는 **AWSCodeBuildAdminAccess**, **AWSCodeCommitFullAccess**, **AWSCodeDeployFullAccess**, **AWSCodePipeline\$1FullAccess** 관리형 정책의 일부로 포함된 알림 권한과 동등한 전체 액세스 정책입니다. 이러한 관리형 정책과 마찬가지로 계정 전체에서 알림 및 알림 규칙에 대한 전체 관리 액세스 권한이 필요한 IAM 사용자, 그룹 또는 역할에만 이러한 종류의 정책 설명을 연결해야 합니다 AWS .

**참고**  
이 정책에는 `CreateNotificationRule` 허용이 포함되어 있습니다. IAM 사용자 또는 역할에이 정책이 적용된 모든 사용자는 해당 사용자가 해당 리소스 자체에 액세스할 수 없는 경우에도 AWS 계정에서 AWS CodeStar Notifications에서 지원하는 모든 리소스 유형에 대한 알림 규칙을 생성할 수 있습니다. 예를 들어 이 정책을 보유한 사용자는 CodeCommit 자체에 대한 액세스 권한 없이도 CodeCommit 리포지토리에 대한 알림 규칙을 생성할 수 있습니다.

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

****  

```
{
    "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 Notifications 사용에 대한 기여자 수준 정책
<a name="security_iam_id-based-policy-examples-notifications-contributor"></a>

이 예제에서는 알림 생성 및 구독과 같은 AWS CodeStar Notifications의 day-to-day 사용에 대한 액세스 권한을 부여하지만 알림 규칙 또는 대상 삭제와 같은 더 파괴적인 작업은 부여하지 않으려고 합니다. 이는 **AWSCodeBuildDeveloperAccess**, **AWSCodeDeployDeveloperAccess** 및 **AWSCodeCommitPowerUser** 관리형 정책에서 제공되는 액세스와 동일합니다.

**참고**  
이 정책에는 `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 정책
<a name="security_iam_id-based-policy-examples-notifications-read-only"></a>

이 예에서는 계정의 IAM 사용자에게 AWS 계정의 알림 규칙, 대상, 이벤트 유형에 대한 읽기 전용 액세스 권한을 부여하려고 합니다. 이 예제에서는 이러한 항목의 보기를 허용하는 정책을 생성할 수 있는 방법을 보여줍니다. 이는 **AWSCodeBuildReadOnlyAccess**, **AWSCodeCommitReadOnly**, **AWSCodePipeline\$1ReadOnlyAccess** 관리형 정책의 일부로 포함된 권한과 동일합니다.

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

****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Id": "CodeNotificationforReadOnly",
    "Statement": [
        {
            "Sid": "ReadsAccess",
            "Effect": "Allow",
            "Action": [
                "codestar-notifications:DescribeNotificationRule",
                "codestar-notifications:ListNotificationRules",
                "codestar-notifications:ListTargets",
                "codestar-notifications:ListEventTypes"
            ],
            "Resource": "*"
        }
    ]
}
```

------