Last active
August 29, 2015 14:09
-
-
Save ryo0301/071a49e7645afcbeadf6 to your computer and use it in GitHub Desktop.
aws-sdk-coreでcredentialsのプロファイルを切り替える ref: http://qiita.com/ryo0301/items/39308a5dc457b5df59ee
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
[default] | |
aws_access_key_id = DEFAULT_ACCESS_KEY_ID | |
aws_secret_access_key = DEFAULT_SECRET_ACCESS_KEY | |
aws_session_token = DEFAULT_SESSION_TOKEN | |
[dev] | |
aws_access_key_id = DEV_ACCESS_KEY_ID | |
aws_secret_access_key = DEV_SECRET_ACCESS_KEY |
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
require 'aws-sdk-core' | |
ec2 = Aws::EC2::Client.new region: 'ap-northeast-1', profile: 'dev' |
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
require 'aws-sdk-core' | |
creds = Aws::SharedCredentials.new path: '/path/to/creds', profile_name: 'dev' | |
ec2 = Aws::EC2::Client.new region: 'ap-northeast-1', credentials: creds |
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
require 'aws-sdk-core' | |
Aws.config[:profile] = 'dev' | |
Aws.config[:region] = 'ap-northeast-1' | |
ec2 = Aws::EC2::Client.new |
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
require 'aws-sdk-core' | |
creds = Aws::SharedCredentials.new path: '/path/to/creds', profile_name: 'dev' | |
Aws.config[:credentials] = creds | |
Aws.config[:region] = 'ap-northeast-1' | |
ec2 = Aws::EC2::Client.new |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment