简体   繁体   English

AWS - 使用 aws_s3 扩展(由 RDS 提供)导入 S3 到 RDS(postgres)失败

[英]AWS - S3 to RDS(postgres) import using aws_s3 extension (provided by RDS) is failing

I have successfully created a role with policy attached to that role which allows required actions on the bucket.我已成功创建了一个角色,该角色附加了策略,该角色允许对存储桶执行必要的操作。 Policy document is:政策文件是:

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "s3import",
            "Action": [
                "s3:GetObject",
                "s3:ListBucket"
            ],
            "Effect": "Allow",
            "Resource": [
                "arn:aws:s3:::my-bucket",
                "arn:aws:s3:::my-bucket/*"
            ]
        }
    ]
}

And then i attached this role to my RDS instance with feature s3Import.然后我使用功能 s3Import 将此角色附加到我的 RDS 实例。

This is the command i ran.这是我运行的命令。

SELECT aws_s3.table_import_from_s3(
   'table name',
   '', 
   'DELIMITER ''|''',
   aws_commons.create_s3_uri(
       'bucket-name',
       'file.csv',
       'region')
);

I am getting this error:我收到此错误:

SQL Error [XX000]: ERROR: HTTP 404. Requested file does not exist.

Is anything missing here?这里有什么遗漏吗?

Based on the comments.根据评论。

Based on the error message provided, the issue was not due to access deny to S3, but rather due to wrong file name used in create_s3_uri .根据提供的错误消息,问题不是由于对 S3 的访问被拒绝,而是由于create_s3_uri中使用的文件名错误

The solution was to use the correct file name.解决方案是使用正确的文件名。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM