- Newest
- Most votes
- Most comments
For EC2 to access databases in a different VPC:
Required ports (inbound on database security groups):
MySQL: 3306 PostgreSQL: 5432 DocumentDB: 27017 Security Group Configuration Options:
Option 1: Add the EC2's security group as a source on the database security groups for the respective ports. This is the recommended approach for proper security separation.
Option 2: Attach the DMS security group to your EC2 instance as an additional security group. Since your databases already allow inbound from DMS SG, the EC2 would inherit that access. This follows the same pattern as your Redshift setup.
Option 2 is simpler but Option 1 provides better security isolation between migration and application workloads.
Network prerequisites:
VPC Peering or Transit Gateway configured Route tables updated in both VPCs NACLs allowing traffic (if using custom NACLs) Additional resources:
https://docs.aws.amazon.com/vpc/latest/userguide/security-group-rules-reference.html
https://docs.aws.amazon.com/vpc/latest/userguide/working-with-security-groups.html
https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html
https://docs.aws.amazon.com/vpc/latest/tgw/what-is-transit-gateway.html
https://docs.aws.amazon.com/vpc/latest/peering/working-with-vpc-peering.html
answered 10 months ago
Relevant content
asked 10 months ago
asked 7 years ago

You are using multiple VPCs? Are these VPCs connected in some way like transit gateway, VPC peering or Cloud WAN. If not, it won't work.