https://github.com/frnn4268/terraform-data-injector
This project sets up a microservice using AWS Lambda and RDS, managed by Terraform. The service generates random data and stores it in a MySQL database, with an API Gateway endpoint for triggering the Lambda function.
https://github.com/frnn4268/terraform-data-injector
aws github-actions python script terraform
Last synced: 2 months ago
JSON representation
This project sets up a microservice using AWS Lambda and RDS, managed by Terraform. The service generates random data and stores it in a MySQL database, with an API Gateway endpoint for triggering the Lambda function.
- Host: GitHub
- URL: https://github.com/frnn4268/terraform-data-injector
- Owner: Frnn4268
- Created: 2024-12-14T00:58:13.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-02-10T15:18:43.000Z (over 1 year ago)
- Last Synced: 2025-04-07T04:52:43.938Z (about 1 year ago)
- Topics: aws, github-actions, python, script, terraform
- Language: HCL
- Homepage:
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# AWS Terraform Data Injector
This project creates a microservice that generates random data and stores it in an AWS RDS database. It uses AWS Lambda, API Gateway, and Terraform for infrastructure management.
### Project Structure
```plaintext
│ .gitignore
│ main.tf
│ outputs.tf
│ terraform.tfvars
│ variables.tf
│
├───.github
│ └───workflows
│ terraform-apply.yaml
│
└───scripts
lambda_function.py
lambda_function.zip
```
### GitHub Actions Configuration
Add the following secrets to your GitHub repository settings:
- `AWS_REGION`
- `DB_PASSWORD`
- `DB_SECRET_ARN`
- `DB_RESOURCE_ARN`
- `AWS_ACCESS_KEY_ID`
- `AWS_SECRET_ACCESS_KEY`
## Deploying the Project
1. Initialize Terraform:
```bash
terraform init
```
2. Executes the Terraform plan:
```bash
terraform plan
```
3. Apply the Terraform configuration:
```bash
terraform apply
```
4. The `API URL` will be output upon successful deployment.
5. Destroy the Terraform configuration:
```bash
terraform destroy
```
### Usage
Make a `POST` request to the `API URL` to generate random data and store it in the RDS database.