The command to create EMR cluster using AWS CLI is as follows:-
aws emr create-cluster --name "Demo Cluster" --ami-version 5.2 --applications Name=Hive Name=Pig --use-default-roles --ec2-attributes KeyName=YourKey --instance-groups InstanceGroupType=MASTER,InstanceCount=1,InstanceType=m4.large InstanceGroupType=CORE,InstanceCount=2,InstanceType=m4.large --steps Type=PIG,Name="Pig Program",ActionOnFailure=CONTINUE,Args=[-f,s3://mybucket,-p,INPUT=s3://mybucket,-p,OUTPUT=s3://mybucket,$INPUT=s3://mybucket,$OUTPUT=s3://mybucket]
This will create a 2 node cluster 1 master and 1 slave.
Hope this helps.