我正在尝试恢复存储在S3中的parquet格式的快照。但我知道这个错误
“在调用RestoreDBInstanceFromS3操作时发生错误:无法下载指定的Amazon桶中的文件。请确保您已经创建了一个AWS标识和访问管理角色,该角色允许Amazon为您访问亚马逊S3。”。
以下是我创建的IAM政策:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "ImportPolict",
"Effect": "Allow",
"Action": [
"s3:PutObject*",
"s3:ListBucket",
"s3:GetObject*",
"s3:DeleteObject*",
"s3:GetBucketLocation"
],
"Resource": [
"arn:aws:s3:::bucket-name",
"arn:aws:s3:::bucket-name/*"
]
}
]
}角色上配置的可信关系:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"Service": "rds.amazonaws.com"
},
"Action": "sts:AssumeRole"
}
]
}这是我使用的命令:aws rds restore-db-instance-from-s3 --allocated-storage 150 --db-instance-identifier instanceName --db-instance-class db.t2.medium --engine mysql --master-username user --master-user-password password --s3-bucket-name bucket-name --s3-ingestion-role-arn arnToRole --source-engine mysql --source-engine-version 5.6.44
此用户可以访问S3桶,并且没有在桶策略上配置任何内容。
发布于 2021-02-09 07:53:01
如果您使用KMS加密桶或对象,则需要授予对KMS的访问权限。我制定了这个政策:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "kms:*",
"Resource": "*"
}
]
}并将其添加到还原DB时使用的角色中。注意:这一政策可能比要求的要广泛得多。
https://stackoverflow.com/questions/63266585
复制相似问题