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개 답변
2
수락된 답변

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
전문가
Steve_M
답변함 8달 전
profile picture
전문가
검토됨 8달 전
  • 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.

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠