기계 번역으로 제공되는 번역입니다. 제공된 번역과 원본 영어의 내용이 상충하는 경우에는 영어 버전이 우선합니다.
리소스 이름 및 태그를 사용하여 세분화된 액세스 제어
Amazon 리소스 이름(ARNs)을 기반으로 리소스 이름과 리소스 태그를 사용하여 AWS DMS 리소스에 대한 액세스를 관리할 수 있습니다. IAM 정책에 조건문을 포함하거나 허용 작업을 정의하여 이 작업을 수행할 수 있습니다.
리소스 이름을 사용하여 액세스 제어
IAM 사용자 계정을 생성하고 AWS DMS 리소스의 ARN에 따라 정책을 할당할 수 있습니다.
다음 정책은 ARN arn:aws:dms:us-east-1:152683116:rep:DOH67ZTOXGLIXMIHKITV를 사용하여 AWS DMS 복제 인스턴스에 대한 액세스를 거부합니다.
예를 들면, 정책이 적용 중일 때는 다음 명령이 실패합니다.
$ aws dms delete-replication-instance --replication-instance-arn "arn:aws:dms:us-east-1:152683116:rep:DOH67ZTOXGLIXMIHKITV" A client error (AccessDeniedException) occurred when calling the DeleteReplicationInstance operation: User: arn:aws:iam::152683116:user/dmstestusr is not authorized to perform: dms:DeleteReplicationInstance on resource: arn:aws:dms:us-east-1:152683116:rep:DOH67ZTOXGLIXMIHKITV $ aws dms modify-replication-instance --replication-instance-arn "arn:aws:dms:us-east-1:152683116:rep:DOH67ZTOXGLIXMIHKITV" A client error (AccessDeniedException) occurred when calling the ModifyReplicationInstance operation: User: arn:aws:iam::152683116:user/dmstestusr is not authorized to perform: dms:ModifyReplicationInstance on resource: arn:aws:dms:us-east-1:152683116:rep:DOH67ZTOXGLIXMIHKITV
AWS DMS 엔드포인트 및 복제 작업에 대한 액세스를 제한하는 IAM 정책을 지정할 수도 있습니다.
다음 정책은 AWS DMS 엔드포인트의 ARN을 사용하여 엔드포인트에 대한 액세스를 제한합니다.
예를 들면, 엔드포인트의 ARN을 사용하는 정책이 적용 중일 때는 다음 명령이 실패합니다.
$ aws dms delete-endpoint --endpoint-arn "arn:aws:dms:us-east-1:152683116:endpoint:D6E37YBXTNHOA6XRQSZCUGX" A client error (AccessDeniedException) occurred when calling the DeleteEndpoint operation: User: arn:aws:iam::152683116:user/dmstestusr is not authorized to perform: dms:DeleteEndpoint on resource: arn:aws:dms:us-east-1:152683116:endpoint:D6E37YBXTNHOA6XRQSZCUGX $ aws dms modify-endpoint --endpoint-arn "arn:aws:dms:us-east-1:152683116:endpoint:D6E37YBXTNHOA6XRQSZCUGX" A client error (AccessDeniedException) occurred when calling the ModifyEndpoint operation: User: arn:aws:iam::152683116:user/dmstestusr is not authorized to perform: dms:ModifyEndpoint on resource: arn:aws:dms:us-east-1:152683116:endpoint:D6E37YBXTNHOA6XRQSZCUGX
다음 정책은 AWS DMS 작업의 ARN을 사용하여 작업에 대한 액세스를 제한합니다.
예를 들면, 작업의 ARN을 사용하는 정책이 적용 중일 때는 다음 명령이 실패합니다.
$ aws dms delete-replication-task --replication-task-arn "arn:aws:dms:us-east-1:152683116:task:UO3YR4N47DXH3ATT4YMWOIT" A client error (AccessDeniedException) occurred when calling the DeleteReplicationTask operation: User: arn:aws:iam::152683116:user/dmstestusr is not authorized to perform: dms:DeleteReplicationTask on resource: arn:aws:dms:us-east-1:152683116:task:UO3YR4N47DXH3ATT4YMWOIT
태그를 사용하여 액세스 제어
AWS DMS 는 추가 태그 지정 요구 사항 없이 고객 정의 정책에서 사용할 수 있는 공통 키-값 페어 세트를 정의합니다. AWS DMS 리소스 태그 지정에 대한 자세한 내용은 섹션을 참조하세요AWS Database Migration Service에서 리소스 태그 지정.
다음은와 함께 사용할 수 있는 표준 태그 목록입니다 AWS DMS.
-
aws:CurrentTime – 임시 기준에 따라 액세스 제한을 허용하는 요청 날짜 및 시간을 나타냅니다.
-
aws:EpochTime – 이 태그는 위의 aws:CurrentTime 태그와 비슷하지만, 현재 시간이 Unix epoch 이후에 경과된 초 시간으로 표시됩니다.
-
aws:MultiFactorAuthPresent – 요청이 멀티 팩터 인증을 통해 서명되었는지 여부를 나타내는 부울 태그입니다.
-
aws:MultiFactorAuthAge – 멀티 팩터 인증 토큰의 수명(초)에 액세스할 수 있습니다.
-
aws:principaltype - 현재 요청에 대한 보안 주체 유형(사용자, 계정, 연합된 사용자 등)에 액세스할 수 있습니다.
-
aws:SourceIp - 요청을 실행하는 사용자의 원본 IP 주소를 나타냅니다.
-
aws:UserAgent – 리소스를 요청하는 클라이언트 애플리케이션에 대한 정보를 제공합니다.
-
aws:userid – 요청을 실행하는 사용자의 ID에 액세스할 수 있습니다.
-
aws:username – 요청을 실행하는 사용자의 이름에 액세스할 수 있습니다.
-
dms:InstanceClass – 복제 인스턴스 호스트의 컴퓨팅 크기에 액세스할 수 있습니다.
-
dms:StorageSize - 스토리지 볼륨 크기(GB)에 액세스할 수 있습니다.
고유한 태그를 정의할 수도 있습니다. 고객 정의 태그는 AWS 태그 지정 서비스에 유지되는 간단한 키-값 페어입니다. 이러한 키-값 페어를 복제 인스턴스, 엔드포인트 및 작업을 비롯한 AWS DMS 리소스에 추가할 수 있습니다. 이러한 태그는 정책의 IAM "조건"문을 사용하여 일치되며 특정 조건 태그를 사용하여 참조됩니다. 태그 키에는 "dms" 접두사, 리소스 유형 및 "tag" 접두사가 붙습니다. 태그 형식은 다음과 같습니다.
dms:{resource type}-tag/{tag key}={tag value}
예를 들어 "stage=production" 태그를 포함하는 복제 인스턴스에 대해 API 호출 성공만 허용하는 정책을 정의하려 한다고 가정해 보겠습니다. 다음 조건문은 리소스와 지정된 태그를 일치시킵니다.
"Condition": { "streq": { "dms:rep-tag/stage":"production" } }
이 정책 조건과 일치하는 복제 인스턴스에 다음 태그를 추가합니다.
stage production
AWS DMS 리소스에 이미 할당된 태그 외에도 정책을 작성하여 지정된 리소스에 적용할 수 있는 태그 키와 값을 제한할 수도 있습니다. 이 경우 태그 접두사는 "req"입니다.
예를 들면, 다음 정책문은 사용자가 지정된 리소스에 할당할 수 있는 태그를 특정 허용 값 목록으로 제한합니다.
"Condition": { "streq": { "dms:rep-tag/stage": [ "production", "development", "testing" ] } }
다음 정책 예제에서는 AWS DMS 리소스 태그를 기반으로 리소스에 대한 액세스를 제한합니다.
다음 정책은 태그 값이 "Desktop"이고 태그 키가 "Env"인 복제 인스턴스에 대한 액세스를 제한합니다.
다음 명령은 태그 값이 "Desktop"이고 태그 키가 "Env"일 때 액세스를 제한하는 IAM 정책에 따라 성공하거나 실패합니다.
$ aws dms list-tags-for-resource --resource-name arn:aws:dms:us-east-1:152683116:rep:46DHOU7JOJYOJXWDOZNFEN --endpoint-url http://localhost:8000 { "TagList": [ { "Value": "Desktop", "Key": "Env" } ] } $ aws dms delete-replication-instance --replication-instance-arn "arn:aws:dms:us-east-1:152683116:rep:46DHOU7JOJYOJXWDOZNFEN" A client error (AccessDeniedException) occurred when calling the DeleteReplicationInstance operation: User: arn:aws:iam::152683116:user/dmstestusr is not authorized to perform: dms:DeleteReplicationInstance on resource: arn:aws:dms:us-east-1:152683116:rep:46DHOU7JOJYOJXWDOZNFEN $ aws dms modify-replication-instance --replication-instance-arn "arn:aws:dms:us-east-1:152683116:rep:46DHOU7JOJYOJXWDOZNFEN" A client error (AccessDeniedException) occurred when calling the ModifyReplicationInstance operation: User: arn:aws:iam::152683116:user/dmstestusr is not authorized to perform: dms:ModifyReplicationInstance on resource: arn:aws:dms:us-east-1:152683116:rep:46DHOU7JOJYOJXWDOZNFEN $ aws dms add-tags-to-resource --resource-name arn:aws:dms:us-east-1:152683116:rep:46DHOU7JOJYOJXWDOZNFEN --tags Key=CostCenter,Value=1234 A client error (AccessDeniedException) occurred when calling the AddTagsToResource operation: User: arn:aws:iam::152683116:user/dmstestusr is not authorized to perform: dms:AddTagsToResource on resource: arn:aws:dms:us-east-1:152683116:rep:46DHOU7JOJYOJXWDOZNFEN $ aws dms remove-tags-from-resource --resource-name arn:aws:dms:us-east-1:152683116:rep:46DHOU7JOJYOJXWDOZNFEN --tag-keys Env A client error (AccessDeniedException) occurred when calling the RemoveTagsFromResource operation: User: arn:aws:iam::152683116:user/dmstestusr is not authorized to perform: dms:RemoveTagsFromResource on resource: arn:aws:dms:us-east-1:152683116:rep:46DHOU7JOJYOJXWDOZNFEN
다음 정책은 태그 값이 "Desktop"이고 태그 키가 "Env"인 AWS DMS 엔드포인트에 대한 액세스를 제한합니다.
다음 명령은 태그 값이 "Desktop"이고 태그 키가 "Env"일 때 액세스를 제한하는 IAM 정책에 따라 성공하거나 실패합니다.
$ aws dms list-tags-for-resource --resource-name arn:aws:dms:us-east-1:152683116:endpoint:J2YCZPNGOLFY52344IZWA6I { "TagList": [ { "Value": "Desktop", "Key": "Env" } ] } $ aws dms delete-endpoint --endpoint-arn "arn:aws:dms:us-east-1:152683116:endpoint:J2YCZPNGOLFY52344IZWA6I" A client error (AccessDeniedException) occurred when calling the DeleteEndpoint operation: User: arn:aws:iam::152683116:user/dmstestusr is not authorized to perform: dms:DeleteEndpoint on resource: arn:aws:dms:us-east-1:152683116:endpoint:J2YCZPNGOLFY52344IZWA6I $ aws dms modify-endpoint --endpoint-arn "arn:aws:dms:us-east-1:152683116:endpoint:J2YCZPNGOLFY52344IZWA6I" A client error (AccessDeniedException) occurred when calling the ModifyEndpoint operation: User: arn:aws:iam::152683116:user/dmstestusr is not authorized to perform: dms:ModifyEndpoint on resource: arn:aws:dms:us-east-1:152683116:endpoint:J2YCZPNGOLFY52344IZWA6I $ aws dms add-tags-to-resource --resource-name arn:aws:dms:us-east-1:152683116:endpoint:J2YCZPNGOLFY52344IZWA6I --tags Key=CostCenter,Value=1234 A client error (AccessDeniedException) occurred when calling the AddTagsToResource operation: User: arn:aws:iam::152683116:user/dmstestusr is not authorized to perform: dms:AddTagsToResource on resource: arn:aws:dms:us-east-1:152683116:endpoint:J2YCZPNGOLFY52344IZWA6I $ aws dms remove-tags-from-resource --resource-name arn:aws:dms:us-east-1:152683116:endpoint:J2YCZPNGOLFY52344IZWA6I --tag-keys Env A client error (AccessDeniedException) occurred when calling the RemoveTagsFromResource operation: User: arn:aws:iam::152683116:user/dmstestusr is not authorized to perform: dms:RemoveTagsFromResource on resource: arn:aws:dms:us-east-1:152683116:endpoint:J2YCZPNGOLFY52344IZWA6I
다음 정책은 태그 값이 "Desktop"이고 태그 키가 "Env"인 복제 작업에 대한 액세스를 제한합니다.
다음 명령은 태그 값이 "Desktop"이고 태그 키가 "Env"일 때 액세스를 제한하는 IAM 정책에 따라 성공하거나 실패합니다.
$ aws dms list-tags-for-resource --resource-name arn:aws:dms:us-east-1:152683116:task:RB7N24J2XBUPS3RFABZTG3 { "TagList": [ { "Value": "Desktop", "Key": "Env" } ] } $ aws dms delete-replication-task --replication-task-arn "arn:aws:dms:us-east-1:152683116:task:RB7N24J2XBUPS3RFABZTG3" A client error (AccessDeniedException) occurred when calling the DeleteReplicationTask operation: User: arn:aws:iam::152683116:user/dmstestusr is not authorized to perform: dms:DeleteReplicationTask on resource: arn:aws:dms:us-east-1:152683116:task:RB7N24J2XBUPS3RFABZTG3 $ aws dms add-tags-to-resource --resource-name arn:aws:dms:us-east-1:152683116:task:RB7N24J2XBUPS3RFABZTG3 --tags Key=CostCenter,Value=1234 A client error (AccessDeniedException) occurred when calling the AddTagsToResource operation: User: arn:aws:iam::152683116:user/dmstestusr is not authorized to perform: dms:AddTagsToResource on resource: arn:aws:dms:us-east-1:152683116:task:RB7N24J2XBUPS3RFABZTG3 $ aws dms remove-tags-from-resource --resource-name arn:aws:dms:us-east-1:152683116:task:RB7N24J2XBUPS3RFABZTG3 --tag-keys Env A client error (AccessDeniedException) occurred when calling the RemoveTagsFromResource operation: User: arn:aws:iam::152683116:user/dmstestusr is not authorized to perform: dms:RemoveTagsFromResource on resource: arn:aws:dms:us-east-1:152683116:task:RB7N24J2XBUPS3RFABZTG3