VPC for ec2 instance running DB, connected via VPC Peering to another VPC with an ec2 instance running application



I am looking for AWS recommended best practice for connecting an application running on EC2, with a DB, running on another EC2 instance.

I followed a recommendation to create two VPC instances, one for each EC2 (application, db), and connect them by using VPC Peering and security group rules (i.e., open specific ports for ingress and egress for each VPC).

A peer reviewer claims that this is "an obsolete, not recommended, pricy" approach "which is not required, and adds no benefits to the overhaul architecture".

The community's take on this issue is welcome. To VPC Peer, or not to VPC Peer - this is the question ...

posta un anno fa389 visualizzazioni
2 Risposte

Hi, you could have a read to this architecture whitepaper: https://docs.aws.amazon.com/whitepapers/latest/serverless-multi-tier-architectures-api-gateway-lambda/three-tier-architecture-overview.html There are different cases depending on your scenario (https://docs.aws.amazon.com/whitepapers/latest/serverless-multi-tier-architectures-api-gateway-lambda/sample-architecture-patterns.html),but in general you could exploit reusing the same VPC and having subnets where you can deploy layers to. For instance for databases and EC2 accessing the database you may want to have in 2 separate private subnets.

Finally, searching for 3-layer architecture will usually lead you to clear aws architecture which you can assess if fit your case.

Hope it helps ;)

profile picture
con risposta un anno fa

If you only want to separate applications and databases, you can simply divide subnets within the same VPC.
An example of dividing a VPC would be to divide it by system or by environment (production, staging, etc.). (In the first place, in this case, it is often divided by AWS account.)
It is also cumbersome to manage because it will be necessary to create flow logs for each VPC.

profile picture
con risposta un anno fa

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande