【发布时间】:2021-09-05 04:36:03
【问题描述】:
我正在尝试将 IAM 角色添加到已经存在的模板中,该模板允许从外部源(雪花)对存储桶进行特定访问
RoleNameForAccess:
Type: AWS::IAM::Role
Properties:
RoleName: RoleNameForAccess
Description: A role that allows snowflake to access the bucket
Policies:
- PolicyName: 'SnowflakePolicyRole'
- PolicyDocument:
- Version: '2012-10-17'
Statement:
- Effect: Allow
Action:
- s3:PutObject
- s3:GetObject
- s3:GetObjectVersion
- s3:DeleteObject
- s3:DeleteObjectVersion
Resource: arn:aws:s3:::bucket-name/*
- Effect: Allow
Action: s3:ListBucket
Resource: arn:aws:s3:::bucket-name
Condition:
StringLike:
s3:prefix:
- "*"
但它不断抛出错误:
Property PolicyDocument cannot be empty.
如果我在政策文档中使用破折号,我会收到以下错误:
Value of property PolicyDocument must be an object
也许我遗漏了一些语法,但找不到它是什么。
谢谢
【问题讨论】:
标签: amazon-s3 amazon-cloudformation amazon-iam aws-sam-cli