How to check which Apache group I can use for the web server to write?

I don't know anything about Amazon EC2, but you should be able to:

  1. Retrieve the name of the user running Apache with a command similar to this:

    ps aux | grep apache # The username should be in the first column.
    
  2. Retrieve the groups this user is part of with the groups(1) command:

    groups [USERNAME]
    

You may try to use the following command-line method to find out your Apache group names:

WWW_GROUP=`ps axo user,group,comm | egrep '(apache|httpd)' | grep -v ^root | cut -d\  -f 2| uniq`
echo Apache group is: $WWW_GROUP

To get the user, check: How to determine Apache user from the command-line?