gpt4 book ai didi

amazon-web-services - 无法使用 Cloudformation 创建 KMS

转载 作者:行者123 更新时间:2023-12-03 07:26:59 25 4
gpt4 key购买 nike

我有下面的代码来通过 CF 创建 KMS,但是我从本节中收到模板错误。这里有什么遗漏的吗?

KmsKey:
Type: AWS::KMS::Key
Properties:
Description: KMS-Key
KeyPolicy:
Version: "2012-10-17"
Id: encryption-key
EnableKeyRotation: "True"
PendingWindowInDays: 7
Statement:
- Sid: Allow administration of the key
Effect: Allow
Resource: "*"
Principal:
AWS: arn:aws:iam::#{AWS::AccountId}:root
Action:
- kms:Create*
- kms:Describe*
- kms:Enable*
- kms:List*
- kms:Put*
- kms:Update*
- kms:Revoke*
- kms:Disable*
- kms:Get*
- kms:Delete*
- kms:ScheduleKeyDeletion
- kms:CancelKeyDeletion

最佳答案

目前唯一明显的是以下内容:

AWS: arn:aws:iam::#{AWS::AccountId}:root

应该是:

AWS: !Sub "arn:aws:iam::${AWS::AccountId}:root"

关于amazon-web-services - 无法使用 Cloudformation 创建 KMS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67415371/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com