MatthewMSaucedo / CarWorld

Car World needs me
GNU General Public License v3.0
4 stars 0 forks source link

(FE + BE - Infra): Stop needing to update CW_API_ENDPOINT constant in frontend AppConstants.tsx every time we redeploy the dev stack #16

Open samzofkie opened 4 months ago

samzofkie commented 4 months ago

Currently, whenever we tear down the CloudFormation stack and reploy with the CDK, the new API Gateway creates a new ID that is used in the URLs for the dev server to talk to (such as https://oe6vezgey6.execute-api.us-east-1.amazonaws.com/, the ID is oe6vezgey6), and currently, we have to copy and paste this ID from the AWS console into frontend/src/AppConstants.tsx. This is annoying, and it would be nicer if dev stack deployments could always set up the API Gateway to have the same URL, so we wouldn't have to update this ID every time.

A cursory look into this issue seems to suggest this would entail associating a domain name certificate with the API Gateway, which would probably mean using AWS Certificate Manager, and maybe talking to Russell to get the domain name info.

One other (janky) idea is also to just write a script (perhaps called from backend/app.py?) that would manually open frontend/AppConstants.tsx and write the ID to the variable.

MatthewMSaucedo commented 3 months ago

Tbh the janky idea is what I first thought, till we setup the Gateway stuff.

Could just add write to a .txt file, and have AppConstants.tsx read in the ID from there.