Amazon AWS SDK Manuel d'utilisateur Page 17

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 29
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 16
Transfer the source to your EC2 instance
Transfer the modified source file to your EC2 instance using scp. Be sure to specify the .pem file you
created earlier, and use the public DNS name of the instance to connect with.The command will look
something like this:
scp -i ruby-iam-ec2-ssh.pem get_object.rb \
Note
If you launched an EC2 machine image other than the Amazon Linux AMI recommended earlier,
you may need to use "root" instead of "ec2-user" when connecting to the instance using ssh or
scp. Additionally, the steps for configuring and running the program in the next section may
differ somewhat.
Run the program within the EC2 instance
To run the program
1. Connect to your EC2 instance with ssh. Use the same public DNS name and .pem file you used to
copy the source code in the preceding section—for example:
ssh -i ruby-iam-ec2-ssh.pem [email protected]
2. The Amazon Linux AMI has Ruby 1.8.7 installed by default. However, we recommend using Ruby
1.9 with the AWS SDK for Ruby. To install Ruby 1.9 on the Amazon Linux AMI, use the following
command:
sudo yum install ruby19 rubygems19
3. Set your AMI to use Ruby 1.9 by default by executing the following command:
sudo alternatives --set ruby /usr/bin/ruby1.9
4. Install additional development packages needed by the AWS SDK for Ruby:
sudo yum install -y gcc ruby-devel19 libxml2 libxml2-devel libxslt libxslt-
devel make
5. Install the AWS SDK for Ruby:
sudo gem install aws-sdk --no-ri --no-rdoc
The --no-ri and --no-rdoc options tell gem to not compile the Ruby documentation for the
aws-sdk gem. This will make the installation considerably faster.
6. Run the program:
Version v1.0.0
14
AWS SDK for Ruby Developer Guide
Walkthrough: Using IAM Roles to Retrieve an Amazon
S3 Object from an EC2 Instance
Vue de la page 16
1 2 ... 12 13 14 15 16 17 18 19 20 21 22 ... 28 29

Commentaires sur ces manuels

Pas de commentaire