My aws credentials are getting rotated for one of the roles. This url:
$ curl http://169.254.169.254/latest/meta-data/iam/security-credentials/newrelicrole
always gives me the latest credentials for newrelicrole role on aws, I want to be able to populate the environment with the updated access key and secret key to fill new relic plugin config
What is the best way to go about it, except running a cron job which fetches the response and repopulates the environment?
If you are scraping the metadata feed for keys and putting it in a static file, you're doing it wrong- those keys rotate every four hours.
If you look at line 26 in the plugin config, you'll see the answer. Enable this and disable the access/secret key configs.
#Use the following line disable the key checks and enable usage of AWS instance metadata for setting keys
use_aws_metadata: true