Security Groups and Ports
A security group acts as a virtual firewall that controls the traffic allowed to reach one or more instances. When you launch an instance, you associate one or more security groups with the instance. You add rules to each security group that allow traffic to or from its associated instances on specified ports. You can modify the rules for a security group at any time; the new rules are automatically applied to all instances that are associated with the security group.
Follow AWS best practices for security group settings. Do not use the default VPC because it is open to the public. See AWS Security Best Practices.