[英]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.