I need proper explanation and steps to connect to an RDS database from my AWS Elastic BeanStalk Project. I have already created a RDS instance on AWS and successfully connected to it from MYSQL Workbench. After that, I have also connected it to my Elastic BeanStalk project. But still my java based website project cannot fetch data from it. Why ????
This use case is documented here:
https://github.com/awsdocs/aws-doc-sdk-examples/tree/master/javav2/usecases/Creating_rds_item_tracker
This tutorial steps you through creating a Java Spring app that is deployed to AWS Elastic Beanstalk and queries data from an RDS instance.
Please check if you can access your RDS instance from your elastic beanstalk environment when you set the RDS instance to public. If you can you have not configured your security groups to allow connections from your EB environments towards your rds instance.
Note: don't forget to set it to private again after you're done with testing.
Related
I'm currently having issues setting up the AWS Explorer plugin in DataGrip to recognise the Aurora Serverless Clusters (MySQL). I have set up credentials from IAM in the credentials file, and can access other AWS services (if I select the dropdown "Schemas", for example, I can see the list of schemas in my org) but clicking the RDS dropdown shows "empty", and doesn't even show the list of database engines. I have tried connecting with secrets manager and using the correct secret for the DB cluster but no luck. When I try and add the database cluster as a data source, it just hangs on "Introspecting" and then the endpoint for that cluster.
I found this issue on the aws-toolkit for jetbrains github https://github.com/aws/aws-toolkit-jetbrains/issues/2124
which mentions that it could be a driver problem. I have tried changing to the mySQL driver, and that hasn't seemed to fix it. DataGrip also seems to heavily encourage using the recommended Aurora MySQL driver.
Is this a bug with DataGrip, or AWS Explorer, or am I missing something obvious? Do I need to enable SSL CAs to get AWS Explorer the correct permissions?
Thanks!
EDIT: I have gone through the prerequisites listed on the AWS docs:
I have installed the AWS CLI and AWS SAM CLI
I have installed Docker (but I haven't set up any containers - I think this is
only needed if I'm running localhost?)
I'm running Windows 10.
Aurora serverless can't be accessed from the internet. From docs:
You must create your Aurora Serverless DB cluster in an Amazon Virtual Private Cloud (Amazon VPC). Aurora Serverless DB clusters are accessible only from an Amazon VPC and can't use a public IP address.
Thus, you need to setup VPN or some proxy (e.g. ssh tunnel through a bastion host) to be able to connect to Aurora serverless from outside of AWS.
Considering CakePHP 2.x's database config docs:
https://book.cakephp.org/2.0/en/development/configuration.html
And the fact that instead of providing ssl_key, ssl_cert, and ssl_ca, AWS RDS provides an rds-combined-ca-bundle.pem:
https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_MySQL.html#MySQL.Concepts.SSLSupport
How can we connect a CakePHP 2.x app to an AWS RDS instance with SSL?
Is it possible? Has someone done it?
How do you refer to the single pem file?
I've had it working fine with a server that does work with the 3 files, but this single file thing I can't figure out.
I made an API REST with Spring boot, connected to an existing MySQL database. This database is not hosted on my local.
The API works fine on my local but I want to deploy it on AWS.
Is it possible to use this remote MySQL database or do I need to use a new one hosted on AWS?
If it is possible, can you guys link any tutorial or documentation? I can't find anything related to this particular issue.
Thank you!
yes, AWS does not limit you to using only their RDS (Relational Database Services) offerings. Configuration of the DB will be the same (or similar if you want to use other instance than one used for your local development) as for your local environment.
Application hosted in aws can be connected to both cloud db and on-perm dB.only thing we need to check is security groups configured in ec2 along with other DB configurations.
Can you install MySQL for AWS Elastic Cloud Compute (EC2) directly on the instance? I can't afford to purchase a separate RDS instance at the moment.
My website is setup on AWS EC2 already and now I'm going to try out some features with a database. I need to set up the instance to run on the EC2 localhost and connect it to my website to store my user data.
So first you need to separate XAMPP from mysql in your thought process. XAMPP is a tool only for your local development. You can set up a database on the Elastic Cloud Compute (EC2) instance similarly to how you set up your XAMPP config locally.
Here are the official docs on how to install a full LAMP stack on an EC2 instance running the Amazon Linux AMI - https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/install-LAMP.html
I am really frustrated in trying to figure out how to connect my already existing RDS mysql instance, that I use with my ec2 to my newly created elastic beanstalk environment. I don't understand why EB wants me to create a new one when I already have one. Can anyone please advise?
No you don't have to create a new one. You just need to open the RDS security group to allow the Elastic Beanstalk instances to connect, and set an environment variable in the Elastic Beanstalk environment with the URL of the RDS server.