Back
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.
Use the following code line in your script:
ec2.create_instances(ImageId='<ami-image-id>', MinCount=1, MaxCount=5)
You can also refer to the official documentation for more information.
https://boto3.amazonaws.com/v1/documentation/api/latest/guide/migrationec2.html#launching-new-instances
Learn how we helped 50,000+ professionals like you !
31k questions
32.8k answers
501 comments
693 users