Module Rudy::AWS::EC2::Instances
In: lib/rudy/aws/ec2/instance.rb

Methods

Included Modules

Rudy::AWS::EC2

Constants

KNOWN_STATES = [:running, :pending, :shutting_down, :terminated, :degraded].freeze

Public Class methods

h is a hash of instance properties in the format returned by EC2::Base#describe_instances:

      kernelId: aki-9b00e5f2
      amiLaunchIndex: "0"
      keyName: solutious-default
      launchTime: "2009-03-14T12:48:15.000Z"
      instanceType: m1.small
      imageId: ami-0734d36e
      privateDnsName:
      reason:
      placement:
        availabilityZone: us-east-1b
      dnsName:
      instanceId: i-cdaa34a4
      instanceState:
        name: pending
        code: "0"

Returns an Instance object.

Is state a known EC2 machine instance state? See: KNOWN_STATES

Public Instance methods

System console output.

  • inst_id instance ID (String) or Instance object.

NOTE: Amazon sends the console outputs as a Base64 encoded string. This method DOES NOT decode in order to remain compliant with the data formats returned by Amazon.

You can decode it like this:

     require 'base64'
     Base64.decode64(output)

Return an Array of Instance objects. Note: These objects will not have DNS data because they will still be in pending state. The DNS info becomes available once the instance enters the running state.

opts supports the following parameters:

  • +:zone+
  • +:ami+
  • +:group+
  • +:size+
  • +:keypair+
  • +:private+ true or false (default)
  • +:machine_data+
  • +:min+ count
  • +:max+ count

inst_id is an instance ID Returns an Instance object

  • state is an optional instance state. If specified, must be one of: running (default), pending, terminated.
  • inst_ids is an Array of instance IDs.

Returns an Array of Rudy::AWS::EC2::Instance objects.

  • state is an optional instance state. If specified, must be

one of: running (default), pending, terminated, any

Returns a Hash of Rudy::AWS::EC2::Instance objects. The key is the instance ID.

  • each_inst a block to execute for every instance in the list.
  • group is a security group name.
  • state is an optional instance state. If specified, must be one of: running (default), pending, terminated.
  • inst_ids is an Array of instance IDs.
  • group is a security group name.
  • state is an optional instance state. If specified, must be one of: running (default), pending, terminated.
  • inst_ids is an Array of instance IDs.

[Validate]