I am trying to write a BLUE/GREEN CFT that tears down and rebuilds the EC2 Instances, ELB and Update the Route53 record Alias with this updated DNS name of this ELB.
If the Alias Record DOESNT exist, I'm able to create the Alias Record Set correctly after the EC2 instances are created and the ELB attaches these instances. But If the recordset exists with the old ELB DNS Name, the CFT is failing with "Alias RecordSet exists". Naturally - am looking to UPDATE this record with the updated ELB DNS name on running the full CFT. Any suggestions?
"HostRecord" : {
"Type" : "AWS::Route53::RecordSet",
"Properties" : {
"HostedZoneName" : "REDACTED",
"Comment" : "Updates the ELB DNS name into Route 54 recordset.",
"Name" : "REDACTED",
"Type" : "A",
"AliasTarget" : {
"DNSName" : { "Fn::GetAtt" : [ "ESClusterELB" , "DNSName" ] },
"HostedZoneId" : { "Fn::GetAtt" : [ "ESClusterELB" , "CanonicalHostedZoneNameID" ] }
}
Managing a single resource (such as a RecordSet) from 2 different CloudFormation stacks is not supported.
I have a few recommandations for your use-case:
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