sous-chefs / aws

Development repository for the aws cookbook
https://supermarket.chef.io/cookbooks/aws
Apache License 2.0
610 stars 554 forks source link

route53_record resource: change_record method does not rescue Aws::Route53::Types::ThrottlingException #420

Open haidangwa opened 4 years ago

haidangwa commented 4 years ago

We've had chef run failures during a large scale-up event in our autoscaling group. Each instance of the autoscaling group that comes online adds itself to the same DNS CNAME in route53; however, because of the large scale-up event, multiple instances attempt to update the record exceeding the AWS rate limit. #change_record has a rescue to prevent a fail_on_error when this is false, but it only rescues Aws::Route53::Errors::ServiceError. The AWS ruby sdk documents the rate throttling exception as Aws::Route53::Types::ThrottlingException. Thus, the chef run fails even when fail_on_error is set to false (default value) for the route53_record resource.

#change_record should rescue Aws::Route53::Types::ThrottlingException since the last record update will be able to capture all of the records that need to be added.