【发布时间】:2021-03-04 07:04:09
【问题描述】:
在 CloudFormation 模板中,我们可以从 DNS 名称中获取 HostedZoneId 吗?一种方法是我们检查资源并查找 HostedZoneId 并将其插入。我们是否也可以使用 GetAtt 或任何其他函数来获取 id。
我想在 HostedZoneId 上做这样的事情,但这是不正确的。有没有其他方法可以做到这一点?
Parameter:
VPCEDNS:
Description: VPCe DNS target
Type: String
Resources:
PrimaryRecord:
Type: AWS::Route53::RecordSet
Properties:
AliasTarget:
HostedZoneId: !GetAtt (!Ref "VPCEDNS").HostedZoneId
DNSName: !Ref "VPCEDNS"
EvaluateTargetHealth: true
Failover: PRIMARY
HostedZoneName: example.com
Name: service.example.com
Type: A
【问题讨论】:
标签: amazon-web-services yaml amazon-cloudformation amazon-route53