Example Python code using Boto3:
import boto3
ec2 = boto3.resource('ec2')
instance = ec2.create_instances(
ImageId='<AMI_ID>',
InstanceType='<INSTANCE_TYPE>',
KeyName='<KEY_PAIR_NAME>',
SecurityGroupIds=['<SECURITY_GROUP_ID>'],
SubnetId='<SUBNET_ID>',
MinCount=1,
MaxCount=1
)