vendredi 28 août 2015

How do I replicate these shell commands in Ruby aws-sdk for switching elastic IPs?

I've got elastic IP switching set up on my AWS Linux box. I know the shell commands to switch IP addresses. But I don't know how to do this in Ruby.

Here's the shell commands...

  1. Get Instance ID:

    wget -O - 'http://ift.tt/1IpSH7i' 2>/dev/null

  2. Allocate an elastic IP:

    aws ec2 allocate-address

  3. Associate elastic IP with this instance. Use instance and allocation IDs returned from steps 1 and 2.

    aws ec2 associate-address --instance-id INSTANCE_ID_HERE --allocation-id ALLOCATION_ID_HERE

How do I do these with Ruby's aws-sdk gem?




Aucun commentaire:

Enregistrer un commentaire