Route53 ARecord ID change causing "resource already exists" error on redeployment #204
-
Hi all. We recently bumped 3:44:34 PM | CREATE_FAILED | AWS::Route53::RecordSet | Nextjs/Domain/AaaaRecordMain
[Tried to create resource record set [name='some.domain.com.', type='AAAA'] but it already exists]
3:44:34 PM | CREATE_FAILED | AWS::Route53::RecordSet | Nextjs/Domain/ARecordMain
[Tried to create resource record set [name='some.domain.com.', type='A'] but it already exists] Digging into the how these records are provisioned I noticed the ID for these resources was renamed, causing the issue. Obviously we could destroy the stack and solve the issue, but that would cause some downtime in prod. Anyone have any neat workaround to getting deployments working again without downtime at our Prod URL? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 11 replies
-
Ahhh just found this I guess we need to set it to |
Beta Was this translation helpful? Give feedback.
-
With latest nextjsDomain: {
aRecordProps: {
weight: 1,
setIdentifier: 'green'
},
aaaaRecordProps: {
weight: 1,
setIdentifier: 'green'
}
} So first in AWS console you set the existing identical A and AAAA records to weighted with weight: 1. Give them record ID whatever you want, I used |
Beta Was this translation helpful? Give feedback.
@bestickley Another approach that might work would be to bump
aws-cdk-lib
version to latest to let us set weighted routing on the DNS records (weighted routing was only added to cdk in v2.122.0). Then set weight of the new ARecord and AAAARecord to1
as well as the existing records so they split traffic evenly. Deployment should work since the identical records can coexist if set to weighted routing.Concept explained way better here: https://stackoverflow.com/questions/48832132/cloudformation-route53-update-an-existing-recordset