Configure EC2 connection to RDS

0

I have an application server running on EC2 in VPC A under one cloud account. I have an RDS Oracle instance in VPC B under diffent cloud account. There is TGW between both clouds. What do you normally have to do on the EC2 machine or networking to be able to connect and forward traffic to the RDS in VPC B? I have oracle client software installed on EC2 machine in order to connect to oracle server.

1 Answer
2
Accepted Answer

Assuming that the Transit gateway is all setup, confirm that the route tables are correctly configured so that the subnet in VPC A containing the EC2 instance has a route to the subnet(s) in VPC B that form the subnet group in which the RDS instance is provisioned (and vice versa) https://aws.amazon.com/blogs/architecture/field-notes-working-with-route-tables-in-aws-transit-gateway/

Then setup security groups (or network ACLs, but SGs are more common) to allow outbound access from the EC2 on port 1521/tcp to the subnets in the subnet group that have the RDS instance running. And similarly, that the RDS instance has a security group with an inbound rule on port 1521/tcp for traffic coming from the EC2 instance.

profile picture
EXPERT
Steve_M
answered 7 months ago
profile picture
EXPERT
reviewed 7 months ago
  • Excellent Answer! I am not very clear on proper setup of Route tables. Is there a good link or video that shows how do you normally setup those AWS entries correctly?

  • As long as you understand routing tables within a single VPC, it's really just an extension of that.

    The theory behind it is here https://docs.aws.amazon.com/vpc/latest/tgw/tgw-route-tables.html

    And a more practical working through of it is here https://aws.amazon.com/blogs/architecture/field-notes-working-with-route-tables-in-aws-transit-gateway/

  • Great Info. It seems to me the routing should be configured as this so that traffic from application/web server in VPC1 can be forwarded to private RDS in VPC2. Does this seem correct?

    1. Update the route table for private subnet where the source Application server is to forward outbound traffic to TGW. If the IP for outbound traffic is for the RDS instance in another account it will go to the TGW.

    Destination Target 10.0.0.0/16 Local 0.0.0.0/0 TGW (foreward any traffic that is not local)

    1. The TGW Route table should have an entry to forward traffic to second VPC where the RDS is located.

    Destination Target RDS Subnet IP Range VPC#2

    The TGW also will have attachments defined to first and second VPC.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions