Last active
July 15, 2016 07:14
-
-
Save rayway30419/dd34a499ccabce6ebf0307d4776bf5a7 to your computer and use it in GitHub Desktop.
Dynamic configure AWS credentials on Rails (while you using IAM role for your instance)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# config/initializers/aws-sdk.rb | |
# configure your credential at ~/.aws/credential | |
# [kdan] | |
# aws_access_key_id=your_access_key_id | |
# aws_secret_access_key=your_secret_access_key | |
if File.exist? File.expand_path('~/.aws/credentials') | |
Aws.config.update( | |
credentials: Aws::SharedCredentials.new(profile_name: 'kdan'), | |
) | |
end | |
Aws.config.update( | |
region: 'us-east-1' | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment