Skip to content

Instantly share code, notes, and snippets.

@cwjohnston
Created May 15, 2015 22:18
Show Gist options
  • Select an option

  • Save cwjohnston/f0954687d369405a00b3 to your computer and use it in GitHub Desktop.

Select an option

Save cwjohnston/f0954687d369405a00b3 to your computer and use it in GitHub Desktop.
[1] pry(main)> e.response
=> #<HTTP::Response/1.1 400 Bad Request {"Transfer-Encoding"=>"chunked", "Date"=>"Fri, 15 May 2015 22:17:08 GMT", "Connection"=>"close", "Server"=>"AmazonEC2"}>
require 'miasma'
provider_config = {
:provider => 'aws',
:aws_access_key_id => ENV['AWS_ACCESS_KEY_ID'],
:aws_secret_access_key => ENV['AWS_SECRET_ACCESS_KEY'],
:aws_region => ENV['AWS_DEFAULT_REGION']
}
instance_config = {
:name => 'test instance',
:image_id => 'ami-65211255',
:flavor_id => 't2.medium',
:key_name => 'cameron-hw'
}
compute = Miasma.api(:provider => provider_config[:provider], :credentials => provider_config, :type => 'compute')
node = compute.servers.build(instance_config)
begin
node.save
rescue => e
binding.pry
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment