Amazon AWS SDK Manuel d'utilisateur Page 21

  • 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 20
Calling create is the only way to obtain the private key programmatically.You can always access
your private key through the AWS Management Console.
Before logging onto an Amazon EC2 instance, you must create the instance and ensure that it is running.
For information about how to run an Amazon EC2 instance, see Run an Amazon EC2 Instance (p. 18).
For information about how to use your key pair to connect to your Amazon EC2 instance, see Connect
to Your Amazon EC2 Instance (p. 18).
Run 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.
Before running an Amazon EC2 instance, ensure that you have created a security group and a key pair
for your instance. For information about creating a key pair, see Create a Key Pair (p. 17). For information
about creating a security group, see Create an Amazon EC2 Security Group (p. 16).
Use the InstanceCollection.create method to run an Amazon EC2 instance. Specify the Amazon Machine
Image (AMI), the instance type, the maximum number of instance to run, the names of a security group
and key pair you created, as follows:
instance = ec2.instances.create(
:image_id => 'ami-11d68a54',
:instance_type => 'm1.small',
:count => 1,
:security_groups => 'YOUR_SECURITY_GROUP_NAME',
:key_pair => ec2.key_pairs['YOUR_KEY_PAIR_NAME'])
You must specify a public or privately-provided AMI. A large selection of Amazon-provided public AMIs
is available for you to use. For a list of public AMIs provided by Amazon, go to Amazon Machine Images.
Ensure that the specified image ID exists in the region in which your client was created.
The instance type must match the AMI you want to run. For 64-bit architecture, you cannot specify an
instance type of m1.small. For more information on instance types, go to Instance Families and Types.
You must specify a maximum number of instances to launch. If the specified number of instances is
greater than the number of instances you are authorized to launch, no instances are launched. The
specified number of maximum instances must be no greater than the maximum number allowed for your
account; by default, this is 20. If fewer instances are available than the maximum number specified, the
largest possible number of images are launched.
Ensure that the specified key name and security group exists for the region in which your client was
created.
After you have created your Amazon EC2 instance, you can log onto the AWS Management Console to
check the status of the instance.
Once your Amazon EC2 instance is running, you can remotely connect to it using your key pair. For
information about connecting to your instance, see Connect to Your Amazon EC2 Instance (p. 18).
Connect to Your 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.
Version v1.0.0
18
AWS SDK for Ruby Developer Guide
Run an Amazon EC2 Instance
Vue de la page 20
1 2 ... 16 17 18 19 20 21 22 23 24 25 26 27 28 29

Commentaires sur ces manuels

Pas de commentaire