Guest User

Untitled

a guest
Oct 18th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. # ~/awesomeapp/lib/awesomeapp/infrastructure.rb
  2. module Awesomeapp
  3. module Infrastructure
  4.  
  5. def self.spawn
  6. credentials = Aws::Credentials.new('SECRETKEY', 'PASSWORD')
  7. ec2_client = Aws::EC2::Client.new(region: 'us-east-1', credentials: credentials)
  8. resp = ec2_client.run_instances(
  9. image_id: 'ami-cd0f5cb6',
  10. min_count: 1,
  11. max_count: 1,
  12. key_name: 'awesomeapp.id_rsa',
  13. instance_type: 't2.micro',
  14. )
  15. resp.instances.first
  16. end
  17.  
  18. end
  19. end
Add Comment
Please, Sign In to add comment