Last active
January 4, 2016 19:09
-
-
Save pete911/8665037 to your computer and use it in GitHub Desktop.
chef - knife-ec2 setup
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
--- install rvm --- | |
# get and execute rvm and source it | |
curl -sSL https://get.rvm.io | bash -s stable | |
source .rvm/scripts/rvm | |
# install ruby 2.1.0 and use it | |
rvm install ruby-2.1.0 | |
rvm use 2.1.0 | |
--- install chef and knife-ec2 --- | |
# install chef and ec2 knife | |
gem install chef | |
gem install knife-ec2 | |
# add aws access key and secret key to your .profile | |
<~/.profile> | |
... | |
export AWS_ACCESS_KEY_ID="..." | |
export AWS_SECRET_ACCESS_KEY="..." | |
... | |
source ~/.profile | |
# create knife config and add aws credentials | |
mkdir ~/.chef | |
touch ~/.chef/knife.rb | |
<~/.chef/knife.rb> | |
knife[:aws_access_key_id] = ENV['AWS_ACCESS_KEY_ID'] | |
knife[:aws_secret_access_key] = ENV['AWS_SECRET_ACCESS_KEY'] | |
--- using knife ec2 --- | |
'knife ec2 server list -A <access-key-id> -K <secret-access-key> --region <region>' | |
Where access key id and secret access key can be found in aws console. Region is the availability zone where the instance(s) is running. Ex: us-west-2 | |
(https://github.com/opscode/knife-ec2) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment