plugin/route53: make refresh frequency adjustable (#3083)

the current update frequency for the refresh loop in the route 53 plugin is hard-coded
to 1 minute. aws rate-limits the number of api requests so less frequent record refreshes
can help when reaching those limits depending upon your individual scenarios. this pull
adds a configuration option to the route53 plugin to adjust the refresh frequency.

thanks for getting my last pull released so quickly. this is the last local change that
i have been running and would love to get it contributed back to the project.

Signed-off-by: Matt Kulka <mkulka@parchment.com>
This commit is contained in:
Matt Kulka
2019-08-03 18:07:28 -07:00
committed by dilyevsky
parent fc1e313ca7
commit 94468c41b0
5 changed files with 65 additions and 6 deletions

View File

@@ -18,6 +18,7 @@ route53 [ZONE:HOSTED_ZONE_ID...] {
aws_access_key [AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY]
credentials PROFILE [FILENAME]
fallthrough [ZONES...]
refresh DURATION
}
~~~
@@ -48,6 +49,14 @@ route53 [ZONE:HOSTED_ZONE_ID...] {
* **ZONES** zones it should be authoritative for. If empty, the zones from the configuration
block.
* `refresh` can be used to control how long between record retrievals from Route 53. It requires
a duration string as a parameter to specify the duration between update cycles. Each update
cycle may result in many AWS API calls depending on how many domains use this plugin and how
many records are in each. Adjusting the update frequency may help reduce the potential of API
rate-limiting imposed by AWS.
* **DURATION** A duration string. Defaults to `1m`. If units are unspecified, seconds are assumed.
## Examples
Enable route53 with implicit AWS credentials and resolve CNAMEs via 10.0.0.1:
@@ -86,3 +95,12 @@ Enable route53 with multiple hosted zones with the same domain:
route53 example.org.:Z1Z2Z3Z4DZ5Z6Z7 example.org.:Z93A52145678156
}
~~~
Enable route53 and refresh records every 3 minutes
~~~ txt
. {
route53 example.org.:Z1Z2Z3Z4DZ5Z6Z7 {
refresh 3m
}
}
~~~