我正在编写一个AWS cloudformation模板,以从Kinesis Firehose接收s3存储桶中的文件。我已经授予了对存储桶的公共读取访问权限(存储桶是公共的),但是当我使用对象URL访问存储桶中的文件时,出现“ XML文件似乎没有与之关联的任何样式”错误,并说拒绝访问。但是,对象(JSON文件)是可下载的。
我已完全访问s3存储桶
Resources:
# Create s3 bucket
MyS3Bucket:
Type: AWS::S3::Bucket
Properties:
BucketName: health-app-buckett
AccessControl: PublicRead
# Create Role
S3BucketRole:
Type: 'AWS::IAM::Role'
Properties:
AssumeRolePolicyDocument:
Statement:
- Effect: Allow
Principal:
Service:
- s3.amazonaws.com
Action:
- 'sts:AssumeRole'
#Create policy for bucket
S3BucketPolicies:
Type: 'AWS::IAM::Policy'
Properties:
PolicyName: S3BucketPolicy
PolicyDocument:
Statement:
- Sid: PublicReadForGetBucketObjects
Effect: Allow
Action: 's3:GetObject'
Resource: !Join
- ''
- - 'arn:aws:s3:::'
- !Ref MyS3Bucket
- /*
Roles:
- !Ref S3BucketRole
我希望能够使用对象URL查看文件