gpt4 book ai didi

amazon-web-services - CommaDelimitedList 到 JSONArray 属性

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

我有一个 CommaDelimitedList,需要将其作为 JSONArray 放入策略 JSON 属性中:

  Parameters:
ApiAllowedIps:
Type: CommaDelimitedList

RestApi:
Type: AWS::ApiGateway::RestApi
Properties:
...
Policy: !Sub |
{
...
"Condition": {
"NotIpAddress": {
"aws:SourceIp": [${ApiAllowedIps}]
}
}
}

我尝试了很多组合但没有成功。

最佳答案

通常您会使用 YAML,而不是 JSON。例如:

  Parameters:
ApiAllowedIps:
Type: CommaDelimitedList

RestApi:
Type: AWS::ApiGateway::RestApi
Properties:
...
Policy:
Version: "2012-10-17"
Statement:
- Effect: Allow
Action: '*'
Principal: '*'
Resource: '*'
Condition:
NotIpAddress:
aws:SourceIp: !Ref ApiAllowedIps

关于amazon-web-services - CommaDelimitedList 到 JSONArray 属性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/70524759/

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