Is it possible to setup an AWS EC2 security group to allow web traffic from only one country? If so, how?

  • Please read the FAQ if you haven't already.
    – user62491
    Apr 16, 2013 at 21:33
  • @kce - how is this against the FAQ?
    – EEAA
    Apr 16, 2013 at 21:47
  • @EEAA Well, posting exact duplicates of your own question is, for one.
    – ceejayoz
    Apr 16, 2013 at 22:22
  • @EEAA - In my opinion it's not (although the question is missing a lot of detail). His other question was closed (erroneously in my opinion) and this one already has another vote against it. I was just suggesting it seeing as he's a new user.
    – user62491
    Apr 16, 2013 at 22:22
  • Ahh, dupe. Good catch.
    – EEAA
    Apr 16, 2013 at 23:31

1 Answer 1


Do you know all of that country's netblocks?

If so, then yes, it's possible, though it may take multiple groups, as there's a 100-rule limit per SG for classic EC2 and a 50-rule limit for VPC SGs.

Whether or not this is a good thing to do, though, is another question altogether.

Not the answer you're looking for? Browse other questions tagged or ask your own question.