presslabs / zinc

Route 53 zone manager.
https://www.presslabs.com/code/zinc/
Other
42 stars 2 forks source link

Return error if `CNAME` exists and we try to create a `POLICY_ROUTED` record #178

Closed calind closed 7 years ago

calind commented 7 years ago

It is impossible to reconcile in this case so we should throw an error.

https://sentry.presslabs.net/presslabs/zinc/issues/463/

InvalidChangeBatch: An error occurred (InvalidChangeBatch) when calling the ChangeResourceRecordSets operation: RRSet of type A with DNS name www.calindon.com. is not permitted because a conflicting RRSet of type  CNAME with the same DNS name already exists in zone calindon.com.
(2 additional frame(s) were not displayed)
...
  File "zinc/tasks.py", line 42, in reconcile_policy_records
    zone.build_tree()
  File "zinc/models.py", line 325, in build_tree
    self.commit()
  File "zinc/models.py", line 211, in commit
    self.route53_zone.commit()
  File "zinc/route53.py", line 103, in commit
    ChangeBatch={'Changes': self._change_batch}

apply_record failed for Zone calindon.com. (Z1WD3QT33BXKPW).calindon.com.