Amazon EC2 is a very popular cloud-computing platform, and knife
has support for managing EC2 instances from the command line through the knife-ec2
plugin. In this section, we will demonstrate the following steps for working with EC2:
Installing the EC2
knife
pluginConfiguring
knife
with your AWS credentialsFinding the desired Amazon Machine Image (AMI), a pre-built system image
Provisioning a new host with
knife
Bootstrapping the newly created host
Configuring the new host with a role
As of Chef 0.10, the ec2
subcommands have been moved from being built-in to knife
into an external gem, knife-ec2
. In order to use EC2 commands, you will need to install the gem, which can be done with the help of the following command:
gem install knife-ec2
This will install all of the gem dependencies that the EC2 plugin requires.