Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow Use of EC2 Instance Credentials #6

Open
gblanck opened this issue Jun 3, 2014 · 0 comments
Open

Allow Use of EC2 Instance Credentials #6

gblanck opened this issue Jun 3, 2014 · 0 comments

Comments

@gblanck
Copy link

gblanck commented Jun 3, 2014

The initialization of the awsCredentials relies on configured access_key and secret_key:

String accessKey = settings.get("metrics.cloudwatch.aws.access_key");
String secretKey = settings.get("metrics.cloudwatch.aws.secret_key");
awsCredentials = new BasicAWSCredentials(accessKey, secretKey);

The AmazonCloudWatchClient provides constructors that will leverage a credential provider chain that loads the IAM role of the host EC2 instance. Thus simplifying configuration and taking advantage of key rotation provided by AWS.

Perhaps a solution with backwards compatibility would be to create an extension of AWSCredentialsProviderChain with two chain members:

  1. A credential provider implementation that mimics the current behavior of looking up of values in elasticsearch settings (throwing an exception if none exist causing 2 to execute)
  2. An instance of DefaultAWSCredentialsProviderChain
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant