Last active
April 16, 2017 00:23
-
-
Save j3tm0t0/6496327 to your computer and use it in GitHub Desktop.
ec2 run instance with public ip in vpc
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)> require 'aws-sdk' | |
=> true | |
[2] pry(main)> ec2 = AWS.ec2 | |
=> <AWS::EC2> | |
[3] pry(main)> ec2.client.run_instances(:image_id => 'ami-39b23d38' , :network_interfaces => [{:device_index => 0 , :subnet_id => 'subnet-6fa0f706', :associate_public_ip_address => true }], :min_count => 1, :max_count => 1 ); | |
[4] pry(main)> ec2.instances.create(:image_id => 'ami-39b23d38' , :network_interfaces => [{:device_index => 0 , :subnet_id => 'subnet-6fa0f706', :associate_public_ip_address => true }]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment