Amazon AWS SDK Manuel d'utilisateur Page 18

  • 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 17
ruby get_object.rb
If everything is set up correctly, the file should be copied to your EC2 instance just as it was to your local
machine when you were using credentials. This time, however, the credentials you used were not stored
in your program or on your EC2 instance. Instead, IAM managed the credentials for you!
Start an Amazon EC2 Instance
Note
This documentation is for the AWS SDK for Ruby version 1, which is a legacy version. For the
most recent version of the SDK for Ruby, see AWS SDK for Ruby - Version 2.
This section demonstrates how to use the AWS SDK for Ruby to start an Amazon Elastic Compute Cloud
(Amazon EC2) instance.
Topics
Create an Amazon EC2 Client (p. 15)
Create a Security Group (p. 16)
Authorize Security Group Ingress (p. 17)
Create a Key Pair (p. 17)
Run an Amazon EC2 Instance (p. 18)
Connect to Your Amazon EC2 Instance (p. 18)
Related Resources (p. 19)
Create an Amazon EC2 Client
Note
This documentation is for the AWS SDK for Ruby version 1, which is a legacy version. For the
most recent version of the SDK for Ruby, see AWS SDK for Ruby - Version 2.
You will need an Amazon EC2 client in order to create security groups and key pairs, and run Amazon
EC2 instances. Before configuring your client, you must create a YAML file to store your AWS Access
Key and your Secret Key. This YAML file must be placed in the same directory as your Ruby program.
The file looks like this:
access_key_id: YOUR_ACCESS_KEY
secret_access_key: YOUR_SECRET_KEY
Specify your AWS credentials as values for the access_key_id and secret_access_key entries.To
learn more about your AWS credentials, including where to find them, go to About AWS Security
Credentials.
After you create this file, you are ready to create and initialize your Amazon EC2 client.
To create and initialize an Amazon EC2 client
1. Pass your configuration file into the AWS.config method, as follows:
Version v1.0.0
15
AWS SDK for Ruby Developer Guide
Start an Amazon EC2 Instance
Vue de la page 17
1 2 ... 13 14 15 16 17 18 19 20 21 22 23 ... 28 29

Commentaires sur ces manuels

Pas de commentaire