gpt4 book ai didi

aws-cloudformation - 有没有办法解析 Amazon Cloudformation 中的 EMR MasterPublicDNS?

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

有没有办法解析Cloudformation中的EMR MasterPublicDNS?我在 Cloudformation 中没有看到替换功能。

ip-100-112-10-21.aws.internal

100.112.10.21

Outputs:
IPAddress:
Description: IP address of the EMR clusters
Value: !GetAtt
- EMRCluster
- MasterPublicDNS
can I reference the output value in same script?
I need to use the formatted IP to set resourcerecords- or do I have to use
Type: AWS::Route53::RecordSetGroup
ResourceRecords: !Join [".",
[
!Select [1, !Split ['-', !GetAtt EMRCluster.MasterPublicDNS]],
!Select [2, !Split ['-', !GetAtt EMRCluster.MasterPublicDNS]],
!Select [3, !Split ['-', !GetAtt EMRCluster.MasterPublicDNS]],
!Select [0,
!Split ['.', !Select [4, !Split ['-', !GetAtt EMRCluster.MasterPublicDNS]]]]
]
]

gives error - Value of property ResourceRecords must be of type List of String
or
ResourceRecords: !ref IPAddress.value

最佳答案

如果格式始终是这样,您可以组合 SplitSelectJoin Cloudformation intrinsic functions实现它:

Outputs:
IPAddress:
Description: IP address of the EMR clusters
Value: !Join ['.',
[
!Select: [1, !Split: ['-', !GetAtt EMRCluster.MasterPublicDNS]],
!Select: [2, !Split: ['-', !GetAtt EMRCluster.MasterPublicDNS]],
!Select: [3, !Split: ['-', !GetAtt EMRCluster.MasterPublicDNS]],
!Select: [0,
!Split: ['.', !Select: [4, !Split: ['-', !GetAtt EMRCluster.MasterPublicDNS]]]]
]
]

我知道这会让您感到畏缩,但这就是 Cloudformation 的发展方向。

或者,您可以写 Cloudformation macro为您做这件事。

关于aws-cloudformation - 有没有办法解析 Amazon Cloudformation 中的 EMR MasterPublicDNS?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54317971/

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