wawastein / zabbix-cloudwatch

Cloudwatch integration for Zabbix 3.x
GNU General Public License v3.0
33 stars 53 forks source link

S3 discovery: return only those buckets that belong to the active region #17

Closed diegosainz closed 5 years ago

diegosainz commented 5 years ago

Currently S3 discovery returns the buckets in all regions, regardless of the region specified to the discovery script. The problem comes when trying to create metrics for those buckets because the metrics are tied to the region of the bucket, so some of the created items from the prototypes will always return empty datapoints.

This PR filters the discovered buckets to those only in the active region, making all the metrics valid for all the buckets discovered once the items have been created from their protoypes.