Skip to content

Instantly share code, notes, and snippets.

@KinzP
Created July 7, 2022 21:17
Show Gist options
  • Save KinzP/b29f44ef903582afa6a68c5f16982ef0 to your computer and use it in GitHub Desktop.
Save KinzP/b29f44ef903582afa6a68c5f16982ef0 to your computer and use it in GitHub Desktop.
import boto3
ec2 = boto3.resource('ec2')
no_of_instances = int(input("How many instances:" ))
instance = ec2.create_instances(
ImageId="ami-0cff7528ff583bf9a", #input AMI here
InstanceType='t2.micro',
KeyName='LUIT_Project14', #input keypair name here
MaxCount= 3,
MinCount= 3
)
print(instance)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment