Nic*_*las 10 amazon-web-services aws-cloudformation amazon-iam amazon-kms
使用 Cloudformation 创建新的 KMS 密钥时,我在“状态原因”列中看到此消息:
没有 IAM 权限来处理 AWS::KMS::Key 资源上的标签
cloudformation 堆栈似乎已正确创建,但我想知道如何防止显示此消息?
我正在使用以下 Cloudformation 模板来创建 KMS 密钥:
AWSTemplateFormatVersion: "2010-09-09"
Description: "KMS key"
Outputs:
KeyArn:
Value: !Sub "${KmsKey.Arn}"
Resources:
KmsKey:
Properties:
Description: "KMS key"
Enabled: true
EnableKeyRotation: false
KeyPolicy:
Version: "2012-10-17"
Statement:
- Sid: "Enable IAM User Permissions"
Effect: "Allow"
Principal:
AWS: !Sub "arn:aws:iam::${AWS::AccountId}:root"
Action: "kms:*"
Resource: "*"
Type: "AWS::KMS::Key"
KmsKeyAlias:
Properties:
AliasName: "alias/KmsKey"
TargetKeyId: !Ref "KmsKey"
Type: "AWS::KMS::Alias"
Run Code Online (Sandbox Code Playgroud)
我用来创建资源的角色允许以下操作:
- Action:
- kms:Create*
- kms:List*
Effect: "Allow"
Resource: "*"
- Action:
- kms:Describe*
- kms:Enable*
- kms:Put*
- kms:Update*
- kms:Get*
- kms:Decrypt
- kms:Encrypt
Effect: "Allow"
Resource:
- "arn:aws:kms:*:*:key/*"
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
11047 次 |
| 最近记录: |