Skip to content

This project demonstrates the use of AWS RDS in a sample application.

Notifications You must be signed in to change notification settings

SAGE-Rebirth/rds-mysql-string

Repository files navigation

RDS Sample Project

This project demonstrates the use of AWS RDS in a sample application. Note: This project is for demo purposes only.

Setup Instructions

Follow the steps below to set up the project:

Prerequisites

  1. Ensure you have the following installed:

    • Python (v3.8 or later)
    • AWS CLI (configured with appropriate credentials)
  2. Clone the repository:

    git clone <repository-url>
    cd rds-sample-project

Create and Configure AWS RDS

  1. Search for AWS RDS on the AWS Console
    You can either use the search bar on the top or select from the Database services in the services tab and select AWS RDS.

  2. Create a Database Instance
    Select the database engine you want to use, such as MySQL, PostgreSQL, or Amazon Aurora. For this practical, we'll be using the default MySQL DB.

  3. Configure Instance
    Specify the instance type, storage, and other configuration options based on your requirements. For this example, we'll be using the default template (Free tier), user (admin), password, and make sure that you give an identifier and database name; otherwise, RDS will not create a database.

  4. Secure and Connect
    Configure security options, such as VPC and firewall rules, and connect to your RDS instance. For this example, we'll give our database public access to the application interface. Also, make sure that you have added the MySQL/Aurora security rule to the security group for connectivity.

  5. Database Connectivity
    For connectivity to the database, you need to create a connection string that consists of the database endpoint (host), name of the database, user, and password (master password).

Install Dependencies

Run the following command to install the required dependencies:

pip install -r requirements.txt

Configure Environment Variables

Create a .env file in the root directory and add the necessary environment variables:

DB_HOST=<your-rds-endpoint>
DB_USER=<your-database-username>
DB_PASSWORD=<your-database-password>
DB_NAME=<your-database-name>

Run the Application

Start the application using the following command:

python app.py

Notes

  • This project is intended for demonstration purposes only and should not be used in production environments.
  • Ensure your AWS credentials and RDS configurations are secure and not exposed in public repositories.

About

This project demonstrates the use of AWS RDS in a sample application.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages