0 votes
1 view
in AWS by (8.9k points)

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.

1 Answer

+1 vote
by (18.5k points)
selected by
 
Best answer

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

Related questions

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
+1 vote
1 answer
0 votes
1 answer
Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...