Connect to AWS RDS MySQL database instance with Flask-SQLAlchemy
Go to your AWS RDS console and choose your instance -> DB Security Groups -> Click Default
and add a new CIDR as per the recommended IP range.
This is basically a firewall configuration which determines who can connect to the database instance.
You could set it as 0.0.0.0/0 so that firewall doesn't prevent you from accessing it from any host/network.
This is a valid path: EC2 dashboard -> Find network & security from left side panel -> Security groups.
If you have a security group created, you may go to number 2.
- Creating a new security group:
There you can name your security group and description.
VPC will probably be automatically created for you.
After creating it, select it from the list.
- Set up inbound and / or outbound connections:
Here you can configure inbound connections rules.
On edit -> add rule you have default presets for easy configuration, for example HTTP on port 80.
I hope this helps everyone from now on.
- Due to security reasons, try to only allow trusted IPs and / or security groups needed.
make sure you're creating a database name in the initial setup of the database under addition configuration unless AWS RDS won't create a database.