Created
March 2, 2015 01:31
-
-
Save amosshapira/e043ef116bfdfe92e3cd to your computer and use it in GitHub Desktop.
Reading AWS cli keys into vagrant-aws configuration
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
# NOTE: Uses ~/.aws/config to get the region and ~/.aws/credentials to get | |
# AWS credentials. | |
# TODO: When running on EC2, use the auto-IAM data | |
config.vm.provider :aws do |aws, override| | |
aws_credentials = IniFile.load(File.expand_path('~/.aws/credentials')) | |
aws.access_key_id = aws_credentials['default']['aws_access_key_id'] | |
aws.secret_access_key = aws_credentials['default']['aws_secret_access_key'] | |
aws_config = IniFile.load(File.expand_path('~/.aws/config')) | |
aws.region = aws_config['default']['region'] | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment