0

sorry for the rookie question, I'm just starting with Google Cloud and web developement. I have a Flask application, works perfectly locally, and also when deployed to a VM in GC. However I can only trigger the API now by using the external IP address, and I'd like to give it a friendly url.

So currently I have 15.15.15.15/triggerawesomapi And I want to have: https://awesomeapplication.com/triggerawesomapi

What should I do to achieve this?

1
  • 1
    create a dns record point to that ip
    – c4f4t0r
    Feb 28, 2022 at 18:44

1 Answer 1

0

Option 1) The easier and faster way, but less reliable:

1.1. Assign an external/static IP to your VM server
1.2. Change your DNS entry awesomeapplication.com to point to your static external IP

In this case, your application is supposed to have an outage in case your server goes down

Option 2) Demands a little more work, but it's more reliable

2.1. Create a VM image with your application
2.2. Create a MIG (Managed Instance Group)
2.3. Configure a load balancer with health-check pointing to your MIG
2.4. Change your DNS entry to point to your load balancer

In this case, GCP is supposed to launch a new healthy VM, in case of an application failure

Option 3) Recommended one: Easier to maintain e reliable

3.1. Create a docker image and deploy it to AppEngine
3.2. Change your DNS entry to point to your AppEngine's URL

In this case, you're supposed to have automatic scale and reliability. Besides, AppEngine standard can downscale to zero when idle, in order to save costs. In addition, you can leverage canary deployments and cache from default's AppEngine infrastructure.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .