I'm creating an ElastiCache replication group for Redis with Cloudformation, which does not allow to specify the group name or clusters name (they are randomly generated gibberish).
So my idea is to create a DNS record to alias it, but I don't know how to get the hosted zone id for the alias target.
I could go for a CNAME, but if the A record alias option is possible I would rather do that.
It's not currently possible to create an Alias Target to an ElastiCache Replication Group.
According to the documentation section "Choosing Between Alias and Non-Alias Resource Record Sets" (emphasis/formatting mine):
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 is not in this list, so using a CNAME pointing to the replication group's endpoint (e.g., !GetAtt ReplicationGroup.PrimaryEndPoint.Address
in your CloudFormation template) is your only option.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With