简体   繁体   English

Cloudformation 模板中的组合 Fn::Select + Fn::Split + Fn:GetAtt

[英]Combination Fn::Select + Fn::Split + Fn:GetAtt in Cloudformation template

I'm trying to use the following cloudformation stack but i keep failing with the following error:我正在尝试使用以下 cloudformation 堆栈,但我一直失败并出现以下错误:

Template error: every Fn::Split object requires two parameters, (1) a string delimiter and (2) a string to be split or a function that returns a string to be split.模板错误:每个 Fn::Split 对象都需要两个参数,(1) 字符串分隔符和 (2) 要拆分的字符串或返回要拆分的字符串的函数。

  {
      "Type": "AWS::Route53Resolver::ResolverRule",
      "Properties": {
        "DomainName": {"Fn::Sub": "ad.${EnvName}.yyy.xxx.com"},
        "Name": {"Fn::Sub": "${EnvName}"},
        "ResolverEndpointId": "1",
        "RuleType": "FORWARD",
        "Tags" : [
          {
            "Key": "Name",
            "Value": {
              "Fn::Sub": "${EnvName}-ADResolverRule"
            }
          }
        ],
        "TargetIps": [
            {
                "Ip": {
                    "Fn::Select": [
                        0,
                        {
                            "Fn::Split": [
                                ",",
                                {
                                  "Fn::GetAtt": [
                                      "MicrosoftAD",
                                      "DnsIpAddresses"
                                  ]
                                }
                            ]
                        }
                    ]
                },
                "Port": "53"
            }
        ]
      }
    }

not really sure why as i have values for the Fn::Split function, any help would be appreciated.不确定为什么我有 Fn::Split 函数的值,任何帮助将不胜感激。

Thanks.谢谢。

The issue looks to be that you do not need to call split at here.问题似乎是您不需要在这里调用 split 。 When you call Fn::GetAtt, it is not creating a string in this case.当您调用 Fn::GetAtt 时,在这种情况下它不会创建字符串。 If you look at the documentation , it generating a list object.如果您查看文档,它会生成一个列表对象。 Looking at various examples you'll see the split is not necessary.查看各种示例,您会发现拆分是不必要的。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Cloudformation 模板中的组合 Fn::Join 和 Fn::Select - Combination Fn::Join and Fn::Select in Cloudformation template CommaDelimitedList、fn:if 和 fn:select 的 AWS Cloudformation 组合 - AWS Cloudformation combination of CommaDelimitedList, fn:if and fn:select Fn :: GetAtt中的AWS Cloudformation Fn :: ImportValue - AWS Cloudformation Fn::ImportValue inside Fn::GetAtt Cloudformation:一起使用 Fn::Join 和 Fn:GetAtt - Cloudformation: Using Fn::Join and Fn:GetAtt together 在cloudformation模板之间创建Fn :: GetAtt引用 - Create Fn::GetAtt references between cloudformation templates Cloudformation 模板错误:每个 Fn::GetAtt object 需要两个非空参数 - Cloudformation Template error: every Fn::GetAtt object requires two non-empty parameters CloudFormation YAML 结合 FN::GETAtt 和 !Ref 以列出 id - CloudFormation YAML combining FN::GEtAtt and !Ref to list ids CloudFormation:Fn::GetAtt:不适用于 AWS::RDS::DBInstance 上的 Endpoint.Address - CloudFormation: Fn::GetAtt: not working for Endpoint.Address on AWS::RDS::DBInstance AWS cloudformation 错误:模板验证错误:模板错误:资源 NotificationsTopic 不支持 Fn::GetAtt 中的属性类型 Arn - AWS cloudformation error: Template validation error: Template error: resource NotificationsTopic does not support attribute type Arn in Fn::GetAtt 具有参考或顶级Fn :: FindInMap的CloudFormation模板 - CloudFormation Template with Reference or TopLevel Fn::FindInMap
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM