Skip to content
This repository was archived by the owner on Jan 4, 2024. It is now read-only.
This repository was archived by the owner on Jan 4, 2024. It is now read-only.

"Private Subnets + NAT Gateways" versus "Security Groups" #102

@bs-thomas

Description

@bs-thomas

Hello there,

First of all I would like to express a big thank you to you guys for making such a beautiful CF template example for us all to reference on. This example has explained to me how I pass resources beautifully without spaghetti links and loopback issues.

If you don't mind I would like to ask a quick question related to the choice of approach for VPC on the CF template.


Problem and Goal

I understand that for security issues, our goal here is, ECS instances should not be accessible from the Internet, but ECS instances needs to be able to "connect out" if in any case this is necessary (downloading packages etc.)

Approach A - by ecs-refarch-cloudformation

I noticed (at least I think) that in the template you guys have made use of private subnets and NAT gateways to achieve this goal.

Approach B - by me (bs-thomas)

To be honest, before I saw this CF template, I had built a cheap amateur version of a similar stack (with much less features of course) and have been using it for some time.

The approach I used to achieve the above goal is to simply declare some security groups for these ECS instances to block the traffic out from the Internet. (On a side note, I have also added a "backdoor" for my company's IP address to be able to access the underlying instances in case we have to do something about them, which is prety convenient)

This achieves a "similar" effect (probably not same), but cheaper approach as I do not need to employ NAT gateways.

My Question

I assume there is a difference, but I don't know what that is and wanted to ask experts like you guys out there.

So my question is, I want to know the pros and cons for the (a) and (b) approaches.

If you guys can shed me some light I'd be highly appreciated!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions