Node.js Express Server with Swagger UI for fetching AWS VPC resources(regions, VPCs, subnets) and storing in MySQL Database.
- Getting Started
- Prerequisites
- Instructions
- Development
- Project Requirements
- Project Structure
- References
Just clone this repository and follow instructions bellow!
node.jsfor JavaScript runtimeyarnornpmfor client package managerAWS Credentialsfor AWS SDK usage (For more information, see:
# clone repository
git clone https://github.com/Krapi0314/AWS-VPC-Describer.git
# change to project directory
cd AWS-VPC-Describer
# create a .env file by copying and adjusting env.example
cp env.example .env
# install dependencies using npm
npm install
# map prisma data model to the mysql database schema
npx prisma migrate dev --name init
# start server (nodemon)
npm start
# enter Swagger URL and check AWS VPC APIs and Schemas!
http://localhost:3000/api/v1/aws/api-docsExpressfor project base framework- For more information, see: http://expressjs.com/)
AWS-SDKfor fetching AWS resources using JavaScript- For more information, see: https://aws.amazon.com/sdk-for-javascript/)
Prismafor Node.js <-> Database ORM- For more information, see: https://www.prisma.io/)
Swaggerfor API documentation & testing- For more information, see: https://swagger.io/)
Client
controller: API controllers for fetching/serving AWS VPC resourcesprimsaschema.prisma: Model for AWS VPC resources, this corresponds with MySQL tables
routes: Router for routing APIs with Expressservice: Service for MySQL CRUD operation on AWS VPC resourcesserver.js: Main entry point, Exprses/Swagger/CORS configuration
AWS SDK JavaScript v3
Describe Region API: https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-ec2/classes/describeregionscommand.htmlDescribe Vpc API: https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-ec2/classes/describevpcscommand.htmlDescribe Subnet API: https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-ec2/classes/describesubnetscommand.html
AWS VPC Resources schema
Region: https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-ec2/interfaces/region.htmlVpc: https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-ec2/interfaces/vpc.htmlSubnet: https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-ec2/interfaces/subnet.html
