내용으로 건너뛰기

Amazon RDS for MySQL에서 Amazon S3로 스냅샷을 내보내려고 할 때 오류가 발생하는 이유는 무엇입니까?

4분 분량
0

Amazon Relational Database Service(Amazon RDS) for MySQL에서 Amazon Simple Storage Service(Amazon S3) 버킷으로 스냅샷을 내보낼 때 오류가 표시되거나 옵션을 사용할 수 없습니다.

간략한 설명

Amazon S3 for Amazon RDS로 DB 스냅샷 데이터를 내보내는 작업이 다음과 같은 이유로 실패할 수 있습니다.

  • AWS Identity and Access Management(IAM) 역할 및 정책의 잘못된 구성
  • AWS Key Management Service(AWS KMS) 키 확인 실패
  • 내보내기 작업이 “STARTING”(시작) 상태에서 중지
  • 액세스 거부 오류
  • KMSKeyNotAccessibleFault
  • 테이블의 권한 문제
  • IAM 역할이 존재하지 않음

해결 방법

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

IAM 역할 및 정책의 잘못된 구성

IAM 역할에 Amazon RDS for 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 정책 예시입니다.

{
  "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 키가 비활성화되거나 삭제된 경우 다음과 같은 오류가 발생합니다. "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"

이 문제를 해결하려면 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의 테이블에 액세스할 권한이 없는 경우 다음과 같은 오류가 발생합니다.

"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 역할의 신뢰 정책에 적절한 신뢰 관계가 지정되지 않은 경우 다음과 같은 오류가 발생합니다.

"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": {}
    }
  ]
}
AWS 공식업데이트됨 2년 전