amazon ec2 - How to create EC2 instance through boto python code -
requests = [conn.request_spot_instances(price=0.0034, image_id='ami-6989a659', count=1,type='one-time', instance_type='m1.micro')]
i used following code..but not working..
use following code create instance python command line.
import boto.ec2 conn = boto.ec2.connect_to_region("us-west-2", aws_access_key_id='<aws access key>', aws_secret_access_key='<aws secret key>') conn = boto.ec2.connect_to_region("us-west-2") conn.run_instances('<ami-image-id>',key_name='mykey', instance_type='t2.micro', security_groups=['your-security-group-here'])
Comments
Post a Comment