AWS codedeploy

I am trying to deploy my application to two different ec2 servers using aws codedeploy approach, can we use the same yml file to do this? if yes how i can define two different deployment group in yam file?