You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Amazon S3 Bucket Policy报MalformedPolicy错误,请求排查解决

S3 Bucket Policy配置报错:Unknown field Resources 解决方法

你的MalformedPolicy错误根源是IAM策略Statement中的字段名错误:必须使用单数形式的Resource,而非复数Resources。AWS IAM策略语法规定,Statement里定义目标资源的字段为单数Resource,复数写法属于非法字段,会被识别为格式错误。

修正后的完整配置代码如下:

BucketPolicy:
    Type: AWS::S3::BucketPolicy
    Properties:
      PolicyDocument:
        Id: MyPolicy
        Version: 2012-10-17
        Statement:
          - Sid: PublicReadForGetBucketObjects
            Effect: Allow  
            Principal: "*"
            Action: "s3:GetObject"
            Resource: !Join
              - ""
              - - "arn:aws:s3:::"
                - !Ref MyWebsite
                - /*
      Bucket: !Ref MyWebsite

内容的提问来源于stack exchange,提问作者Larry V. Doss

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.30 02:03:12