gpt4 book ai didi

amazon-web-services - 云形成 : How to add multiple ARN for condition in a policy

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

我有一个现有的事件规则,并且我正在尝试向现有总线添加新的事件规则,

有一个 sqs 策略允许条件允许现有规则的 ARN,我正在努力添加新规则的 arn

这是 Cfn 代码

注意:我尝试添加“[]”,但没有成功,而且新的事件规则不存在意味着必须将其添加为新规则。

EventBus Code....
//

ExistingEventRule:
Type: AWS::Events::Rule
...

NewEventRule:
Type: AWS::Events::Rule
....

DlqSqsQueuePolicy:
Type: AWS::SQS::QueuePolicy
Properties:
PolicyDocument:
Statement:
- Action: sqs:SendMessage
Condition:
ArnEquals:
aws:SourceArn:
Fn::GetAtt:
- [
ExistingEventRule,
NewEventRule,
]
- Arn
Effect: Allow

错误:调用 CreateChangeSet 操作时发生错误 (ValidationError):模板错误:每个 Fn::GetAtt 对象都需要两个非空参数,即资源名称和资源属性

原始语法

Condition:
ArnEquals:
aws:SourceArn:
Fn::GetAtt:
- NewEventRule
- Arn

最佳答案

您必须单独进行:

            Condition:
ArnEquals:
aws:SourceArn:
- !GetAtt ExistingEventRule.Arn
- !GetAtt NewEventRule.Arn

关于amazon-web-services - 云形成 : How to add multiple ARN for condition in a policy,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/75408844/

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