Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Story: Add new api subdomain, clean up the deployment process #3

Open
danielsomerfield opened this issue Jan 9, 2024 · 0 comments
Open

Comments

@danielsomerfield
Copy link
Owner

As an operator I hate, hate, hate manual steps in my deploy process, but every time I tear down and re-set up the API, I have to change the endpoint the UI points to. This could be fixed easily by setting up a new DNS record for yersong-api.danielsomerfield.com and having that point at whatever is built by the api deploy process.

ACs

  • the build:production hackery is gone from ui/package.json
  • you can tear down the entire application and set it up again without having to manually change anything
  • all this stuff is configured in terraform and/or SAM (probably terraform, given where the other stuff lives)
    Implementation notes
    This will need to be done in the same way as yersong.danielsomerfield.com was configured, except that rather than pointing at a cloudfront endpoint, it will have a cname that points to the api gateway location of the yersong api. Here is more or less what has to be done:
  • Create a DNS record in route53 for the new subdomain yersong-api.danielsomerfield.com. For example, here is how the other DNS record was created. This will need to pull the hostname out of SAM's cloudformation config for api gateway. We will also need to point the api gateway endpoint to our existing TLS certificate. I'm not sure how to do that. We'll have to figure it out.
  • Get the name server records created by the route53 record. They are available either in the terraform, output or in the route53 console. Add a couple of NS records to namescheap using those dns servers. Image of the UI host name is below:
  • Replace the code that loads the REACT_APP_SONG_API_HOST variable and change the default endpoint to yersong-api.danielsomerfield.com for production. You should still be able to run against localhost when running on a dev laptop.
  • Add a virtual host to the existing TLS certificate so it can be used for that, too. That is here.

Picture of adding NS records in namescheap.
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant