amazon-web-services - S3 存储桶策略中的 AWS 多个 CloudFront 分配

标签 amazon-web-services amazon-s3 aws-cloudformation amazon-cloudfront

我正在尝试将多个 CloudFront 分配添加到安全存储桶

我看到另一篇 StackOverflow 帖子,其中您像这样添加了多个用户,但我收到了 Invalidprincipalinpolicy 错误

"Version": "2008-10-17",
"Id": "PolicyForCloudFrontPrivateContent",
"Statement": [
    {
        "Sid": "1",
        "Effect": "Allow",
        "Principal": {
            "AWS": [
                "arn:aws:iam::cloudfront:user/CloudFront Origin Access Identity **************",
                "arn:aws:iam::cloudfront:user/CloudFront Origin Access Identity **************"
            ]
        },
        "Action": "s3:GetObject",
        "Resource": "arn:aws:s3:::bucket-name/*"
    }
]

如何添加多个原则?

最佳答案

您的政策是正确的。但是,错误策略中的主体无效通常表明这些原则根本不存在。确保您已经创建两个 OAI 用户,并且您在政策中正确使用了他们的 ID。

关于amazon-web-services - S3 存储桶策略中的 AWS 多个 CloudFront 分配,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65175701/

相关文章:

amazon-web-services - aws elasticache redis 设置和获取

java - 如何解决加载 Mirth Connect Administrator 时弹出的 java 错误

apache-spark - Parquet with Athena VS Redshift

amazon-web-services - 使用 CreateChangeSet API 创建 CloudFormation 堆栈时如何上传 Assets ?

laravel - EC2 : Laravel migrations run as many times as the instances

amazon-web-services - 托管在 AWS EC2 实例中的 Power BI 本地数据网关

jquery - 如何使用jRecorder和Ruby on Rails将录制的音频文件上传到Amazon S3

amazon-s3 - 如何将文件从 AWS EFS 复制到 AWS S3?

amazon-web-services - 如何将我的用户、组和策略迁移到 AWS CloudFormation?

amazon-web-services - 无法对 CloudFormation CommaDelimitedList 参数使用AllowedPattern