AWS RDS Instance cross-region access

0

I have a codepipeline in us-east-1 region. The codebuild stage has a vpc to it(us-vpc). I want this codebuild to access the rds instance which is in ap-south-1 which is in mumbai-vpc.

2 Answers
2

Hii

To allow your CodeBuild stage in us-east-1 to access an RDS instance in ap-south-1, you'll need to establish a VPC peering connection between the two VPCs: us-vpc and mumbai-vpc.

Here's a step-by-step guide on how to achieve this:

  1. Create a VPC Peering Connection:
  • In the AWS Management Console, navigate to the VPC service.
  • Choose "VPC Peering Connections" in the navigation pane.
  • Click "Create VPC Peering Connection".
  • For the "Requester VPC", select your us-vpc (us-east-1).
  • For the "Accepter VPC", select your mumbai-vpc (ap-south-1).
  • Specify a name for the VPC Peering Connection.
  • Click "Create VPC Peering Connection".
  1. Accept the VPC Peering Connection:
  • In the VPC Peering Connections list, you'll see a pending request from the us-vpc.
  • Select the request and click "Accept".
  1. Update the CodeBuild Project:
  • In the CodeBuild console, go to your project.
  • In the "Environment" section, under "Vpc configuration", select "Use a VPC".
  • Choose your us-vpc and the subnet(s) where your CodeBuild instance will reside.
  • In the "Security groups" section, add a security group that allows inbound traffic from the mumbai-vpc to the ports used by the RDS instance.
  1. Configure the RDS Instance:
  • In the RDS console, go to your instance.
  • In the "Connectivity & security" tab, under "Security groups", ensure that the security group attached to the RDS instance allows outbound traffic to the VPC peering connection.
  1. Test the Connection:

html

profile picture
EXPERT
Sandeep
answered a month ago
EXPERT
reviewed a month ago
1

You can establish an inter-region VPC peering connection (VPC peering) to connect to your RDS instance.

Make a peering connection between us-vpc and mumbai-vpc, and configure the route table.

For more information on VPC peering, check out this AWS documentation:

https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html

profile picture
Sean
answered a month ago
profile picture
EXPERT
reviewed a month ago
profile pictureAWS
EXPERT
reviewed a month ago

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