Created
May 15, 2015 22:18
-
-
Save cwjohnston/f0954687d369405a00b3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [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"}> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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