Amazon RDS MySQL에서 Amazon S3로 스냅샷을 내보내려고 하는데 오류가 발생합니다. 왜 이런 현상이 발생합니까?

4분 분량
0

Amazon Relational Database Service(RDS) MySQL 인스턴스에서 Amazon Simple Storage Service(S3) 버킷으로 스냅샷을 내보내려고 합니다. 하지만 오류가 발생하거나 옵션을 사용할 수 없습니다.

간략한 설명

Amazon RDS에서 Amazon S3로 DB 스냅샷을 내보내면 다음과 같은 이유로 실패할 수 있습니다.

  • AWS Identity Access Management(IAM) 역할 및 정책 잘못된 구성
  • AWS KMS 키 검사 실패
  • 내보내기 작업이 “STARTING”에서 멈춤
  • 액세스 거부 오류
  • KMSKeyNotAccessibleFault
  • 테이블에 대한 권한 문제
  • IAM 역할이 존재하지 않음

해결 방법

참고: AWS Command Line Interface(AWS CLI) 명령을 실행할 때 오류가 발생할 경우 AWS CLI의 최신 버전을 사용하고 있는지 확인하십시오.

AWS Identity Access Management(IAM) 역할 및 정책 잘못된 구성

IAM 역할에 Amazon RDS MySQL 인스턴스에서 Amazon S3로 스냅샷을 내보낼 수 있는 권한이 없는 경우 다음과 같은 오류가 발생합니다.

An error occurred (IamRoleMissingPermissions) when calling the StartExportTask operation: The IAM Role arn:aws:iam::1234567890:role/service-role/role_name isn't authorized to call s3:GetBucketLocation on the S3 bucket my_bucket_name OR
An error occurred (IamRoleMissingPermissions) when calling the StartExportTask operation: The IAM Role arn:aws:iam::1234567890:role/service-role/role_name isn't authorized to call s3:DeleteObject on the S3 bucket my_bucket_name OR
An error occurred (IamRoleMissingPermissions) when calling the StartExportTask operation: The IAM Role arn:aws:iam::1234567890:role/service-role/role_name isn't authorized to call s3:PutObject on the S3 bucket my_bucket_name OR
An error occurred (IamRoleMissingPermissions) when calling the StartExportTask operation: The IAM Role arn:aws:iam::1234567890:role/service-role/role_name isn't authorized to call s3:ListBucket on the S3 bucket my_bucket_name OR
An error occurred (IamRoleMissingPermissions) when calling the StartExportTask operation: The IAM Role arn:aws:iam::1234567890:role/service-role/role_name isn't authorized to call s3:GetObject on the S3 bucket my_bucket_name.

스냅샷을 Amazon S3로 성공적으로 내보내려면 IAM 역할에 다음 다섯 가지 작업에 대해 적절한 권한이 있어야 합니다.

  • s3:PutObject
  • s3: DeleteObject
  • s3:GetObject
  • s3:ListBucket
  • s3:GetBucketLocation

다음은 이러한 다섯 가지 작업을 허용하는 IAM 정책(JSON 형식)의 예입니다.

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "ExportPolicy",
      "Effect": "Allow",
      "Action": [
        "s3:PutObject*",
        "s3:ListBucket",
        "s3:GetObject*",
        "s3:DeleteObject*",
        "s3:GetBucketLocation"
      ],
      "Resource": [
        "arn:aws:s3:::s3_bucket_name",
        "arn:aws:s3:::s3_bucket_name/export/*"
      ]
    }
  ]
}

AWS KMS 키 검사 실패

스냅샷을 내보내는 동안 AWS KMS 키를 비활성화하거나 삭제한 경우 다음 오류가 발생합니다.

Error: KMS keys check failed. Please check the credentials on your KMS key and try again.

이 문제를 해결하려면 스냅샷 내보내기에 사용되는 AWS KMS 키AWS KMS 콘솔에 있는지 확인합니다. AWS KMS 키 상태는 ‘Enabled’로 표시되어야 합니다.

내보내기 작업이 ‘STARTING’ 상태에서 멈춤

Amazon RDS for MySQL의 DB 스냅샷을 Amazon S3로 내보내는 데 소요되는 시간은 데이터베이스 크기와 유형에 따라 달라집니다. 내보내기 작업은 Amazon S3로 데이터를 추출하기 전에 전체 데이터베이스를 복원하고 확장합니다. 이 단계에서 내보내기 작업에 ‘STARTING’ 상태가 표시됩니다. 작업이 Amazon S3로 데이터를 내보내기 시작하면 상태가 ‘In progress’로 변경됩니다. 내보내기 작업이 성공하면 상태가 작업이 완료되었음을 나타냅니다. 내보내기 작업 프로세스에 문제가 있는 경우, 상태가 작업 실패를 나타냅니다.

IAM 역할에 필요한 권한이 누락되어 있고 Amazon API Gateway와 함께 AWS Lambda를 사용하는 경우 다음 오류가 발생합니다.

An error occurred (AccessDenied) when calling the StartExportTask operation: User: arn:aws:sts::1234567890:assumed-role/user/rds_lambda is not authorized to perform: rds:StartExportTask

이 문제를 해결하려면 Write 액세스를rds:StartExportTask에 허용하십시오. 하지만 StartExportTask 작업에 액세스할 수 있어야 합니다.

"Effect": "Allow",
"Action": "rds:StartExportTask",
"Resource": "*"

IAM 역할에 StartExportTask 작업을 호출할 수 있는 권한이 없으면, 다음 오류가 발생합니다.

An error occurred (AccessDenied) when calling the StartExportTask operation: User: arn:aws:sts::1234567890:assumed-role/user/rds_lambda is not authorized to perform: iam:PassRole on Resource ,iam role arn.

이 오류를 해결하려면 AWS 서비스에 역할을 전달할 권한을 사용자에게 부여해야 합니다.

{
    "Effect": "Allow",
    "Action": [
      "iam:GetRole",
      "iam:PassRole"
    ],
    "Resource": "arn:aws:iam::1234567890:role/role_name"
}

KMSKeyNotAccessibleFault

스냅샷 내보내기 메커니즘에서 AWS KMS 키 또는 IAM 역할에 액세스할 수 없는 경우 다음 오류가 발생합니다.

An error occurred (KMSKeyNotAccessibleFault) when calling the StartExportTask operation: The specified KMS key <key_id> does not exist, is not enabled or you do not have permissions to access it.

Amazon RDS에서 KMSKeyNotAccessibleFault 오류를 해결하려면 Amazon S3 버킷에 대한 액세스 설정을 참조하십시오.

Amazon Aurora의 KMSKeyNotAccessibleFault 오류를 해결하려면 교차 계정 AWS KMS 키 사용을 참조하십시오.

테이블에 대한 권한 문제

Amazon RDS의 테이블에 액세스할 수 있는 적절한 권한이 없는 경우 다음 오류가 발생합니다.

Error: PERMISSIONS_DO_NOT_EXIST error stating that (n) tables were skipped

이 문제를 해결하려면 PostgreSQL 데이터베이스에 연결한 후 다음 명령을 실행합니다.

GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA schema_name TO superuser_name;

IAM 역할이 존재하지 않음

IAM 역할의 신뢰 정책에 적절한 신뢰 관계가 지정되지 않은 경우, 다음 오류가 발생합니다.

Error: The Principal export.rds.amazonaws.com isn't allowed to assume the IAM role arn:aws:iam::1234567890:role/iam_role or the IAM role arn:aws:iam::1234567890:role/iam_role doesn't exist.

이 문제를 해결하려면 신뢰 관계가 IAM 정책에서 "rds.amazonaws.com" 대신 "export.rds.amazonaws.com"를 지정해야 합니다.

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Principal": {
        "Service": "export.rds.amazonaws.com"
      },
      "Action": "sts:AssumeRole",
      "Condition": {}
    }
  ]
}

댓글 없음

관련 콘텐츠