How to connect Codebuild to RDS database?
My codebuild project should have access to my database. However, it fails to connect.
I have tried following this tutorial: https://ctoasaservice.org/2019/01/23/aws-codebuild-and-access-to-rds/
However it still didn't work. In the security group of my RDS instance I added a TCP inbound rule with: 22.214.171.124/29 using port range 0-65535. which should be the IP address of Codebuild in eu-central-1. What am I doing wrong?
The blog post you are following assumes your rds is accessible from the internet A better practise is to configure your codebuild project to use your VPC - See here.
Basically a network interface for your codebuild job will be provisioned in your vpc and all communication will occur within your vpc (not over internet). The security group assigned to your codebuild project should allow outbound access to rds security group and the security group assigned to rds should allow inbound from the security group you assigned to codebuild project
Thank you for your help! I followed your instructions and configured my codebuild project to use my VPC. In addition, I added the security group of my backend to the codebuild project and allowed outbound access to rds the rds security group (TCP). I also added inbound connection to the security group of RDS to allow the security group of the backend (and code build).
Now the building of codebuild actually stops in a phase earlier. In the DOWNLOAD_SOURCE phase it complains about timing out when fetching the source code from S3. I am thinking it is no longer allowed access?
How to Use CodeBuild and CodeDeploy to Deploy Lambda to Different Environmentsasked 2 months ago
Connection to MariaDB server gets a timeout, out of nowhere.asked 3 years ago
Can't connect to my application using ROS Bridgeasked 5 months ago
about endpoint connectionasked 17 hours ago
Lightsale instances cannot connect to Lightsail databaseasked 5 months ago
How to connect MySQL database in nodeJS file.asked 2 years ago
Why can't I find my RDS database from my lambda function?
Handler error when connecting lambda function to RDS database
Unable to connect to RDS databaseasked a year ago
How to connect Codebuild to RDS database?asked 11 days ago