我试图使用下面的模板使用cloudformation创建一个KMS键,得到的错误为
Error:
MalformedPolicyDocumentExceptionnull (Service: AWSKMS; Status Code: 400; Error Code: MalformedPolicyDocumentException; Request ID: cc99c04e-8423-43a3-9183-313438544abb)我试过很多方法来解决这个问题,但没有找到解决办法。
Template:
PcsKmsCmk1:
Type: AWS::KMS::Key
Properties:
KeyPolicy:
Version: 2012-10-17
Id: default
Statement:
- Sid: Allow root account all permissions except to decrypt the key
Effect: Allow
Principal:
AWS:
- !Sub arn:aws:iam::${AWS::AccountId}:root
Action: kms:*
Resource: '*'
- Sid: Enable AWSAdminRole to have full permissions to KMS key
Effect: Allow
Principal:
AWS:
- !Sub arn:aws:iam::${AWS::AccountId}:/role/AWSAdminRole
Action: kms:*
Resource: '*'
Condition:
Bool:
kms:GrantIsForAWSResource: 'true'发布于 2020-08-04 16:55:31
在ARN中,您使用了/role,这是错误的。
使用- !Sub arn:aws:iam::${AWS::AccountId}:role/AWSAdminRole而不是- !Sub arn:aws:iam::${AWS::AccountId}:/role/AWSAdminRole
https://stackoverflow.com/questions/63250266
复制相似问题