made-to-order-db
v3.2.3
Published
The database is currently being hosted in DEV only on AWS RDS a t3.micro server. You can connect to it using PGAdmin. Everytime you update the database please update the version as well in package.json as the repo is hosted on npm publically _(yikes)_ The
Downloads
672
Readme
made-to-order-db
The database is currently being hosted in DEV only on AWS RDS a t3.micro server. You can connect to it using PGAdmin. Everytime you update the database please update the version as well in package.json as the repo is hosted on npm publically (yikes) The public repo schema is then used in the api repo.
Should there be migration issues, check for mismatches between local migration and hosted migration, or what exists in the current DB. We run the migrate command locally, and the deploy command for CI/CD pipelines. Binary targets are necessary for choosing deployment targets from the repo.
Dev Builds an RDS postgres instance for dev on one AZ with a t3.micro Hosted on a public subnet so can access locally for testing This is pubilically accessible
Prod TODO when deploying, place in private subnet Will most likeley need to setup a runner in AWS or have a lambda run migrations https://www.youtube.com/watch?v=PxFZt8MG2ss
Testing migration script
Running sam build every time to capture changes, then run test to see if it connects/migrates.
Connecting to private RDS instances locally
You created a bastion-key-pair called bastion-key, this is used to connect to the bastion host you have running on EC2. That allows you to tunnel to your VPN to connect to the RDS instance when testing your AWS API Lambda funcs on SAM in the API repo locally.
To log into the bastion host use this command to test if you can get access to it ssh -i ~/.ssh/bastion-key.pem [email protected] (the ip is listed on the bastion host on ec2 itself)
Now you can open ports ssh -i ~/.ssh/bastion-key.pem -L 5432:made-to-order-db-dev.clmk02sk4sc1.us-east-1.rds.amazonaws.com:5432 [email protected] ssh -i ~/.ssh/bastion-key.pem -L 5432:made-to-order-db-prod.clmk02sk4sc1.us-east-1.rds.amazonaws.com:5432 [email protected]
Test if you can connect to the dev db Using PG ADMIN connect with all values host is localhost and maintenance name is madetoorderdbdev
Note locally, when connecting to the database (while tunneling) you need to use localhost as your database not the actual database url
Also if you want to connect locally you need to add your current local ip address to the terraform file for the bastion host (currently only have we work and 2055 15th st) BUT THIS WONT WORK IN A DOCKER INSTANCE LOCALLY because localhost refers to something different (Try this host.docker.internal)
When installing make sure what ever othe repo you're adding this to has the same prisma version