如何在 Route53 中为 elasticache 复制组创建 "alias target" A DNS 记录

How to create an "alias target" A DNS record in Route53 for an elasticache replication group

我正在使用 Cloudformation 为 Redis 创建一个 ElastiCache 复制组,它不允许指定组名称或集群名称(它们是随机生成的乱码)。

所以我的想法是创建一个 DNS 记录作为别名,但我不知道如何获取别名目标的托管区域 ID。

我可以选择 CNAME,但如果可以使用 A 记录别名选项,我宁愿这样做。

目前无法为 ElastiCache 复制组创建别名目标。

根据文档部分“Choosing Between Alias and Non-Alias Resource Record Sets”(emphasis/formatting 我的):

Instead of an IP address or a domain name, an alias resource record set contains a pointer to

  • a CloudFront distribution,
  • an Elastic Beanstalk environment,
  • an ELB classic or application load balancer,
  • an Amazon S3 bucket that is configured as a static website, or
  • another Amazon Route 53 resource record set in the same hosted zone.

ElastiCache 不在此列表中,因此使用指向复制组端点的 CNAME(例如,!GetAtt ReplicationGroup.PrimaryEndPoint.Address 在您的 CloudFormation 模板中)是您唯一的选择。