Search code examples
pythonamazon-web-servicesamazon-ec2botoboto3

How to create an ec2 instance using boto3


Is it possible to create an ec2 instance using boto3 in python? Boto3 document is not helping here, and I couldn't find any helping documents online. please provide some sample codes/links.


Solution

  • The API has changed but it's right there in the documentation

    # Boto 3
    ec2.create_instances(ImageId='<ami-image-id>', MinCount=1, MaxCount=5)
    

    Link to the documentation: