Over a million developers have joined DZone.

Amazon EC2 Security Groups

· Cloud Zone

Build fast, scale big with MongoDB Atlas, a hosted service for the leading NoSQL database on AWS. Try it now! Brought to you in partnership with MongoDB.

Many of our customers run their environment on Amazon EC2, and a popular question that comes up is the configuration of security groups in EC2.

For a definition, let’s have a look at the EC2 developer guide:

security group acts as a firewall that controls the traffic allowed into a group of instances. When you launch an Amazon EC2 instance, you can assign it to one or more security groups. For each security group, you add rules that govern the allowed inbound traffic to instances in the group. All other inbound traffic is discarded. You can modify rules for a security group at any time. The new rules are automatically enforced for all existing and future instances in the group.

So, each instance must use a security group. In this post, I’ll detail what values should be given to the different security groups you have.

  1. Database servers
    1. Open ports
      1. TCP: 3306 (unless a different port is used for the database)
    2. Address
      1. IP address for every ScaleBase instance
  2. ScaleBase instances
    1. Open ports
      1. TCP: 9000
    2. Address
      1. Every application server you have.
  3. ScaleBase management
    1. Open ports
      1. TCP: 2701
    2. Address
      1. Your organization’s IP address range (or specific IP for users who use the admin console)


Source: http://www.scalebase.com/amazon-ec2-security-groups/

Now it's easier than ever to get started with MongoDB, the database that allows startups and enterprises alike to rapidly build planet-scale apps. Introducing MongoDB Atlas, the official hosted service for the database on AWS. Try it now! Brought to you in partnership with MongoDB.


Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}