GCP App Engine Primer
Tags: gcp, appengine, serverless, paas
Published: 2023-03-13 15:40:20

Google App Engine is a cloud computing platform as a service for developing and hosting web applications in Google-managed data centres.

This comes with the added advantage of running apps load balanced across multiple servers without the worry of managing underlying infrastructure.

The other cool thing is you get a free SSL certificate and URL endpoint provided by google. While this is fine, a lot of the times, we want our own domain. Thankfully, this is also provided out of the box.

But before you can use a custom domain, you need to have one. If you don't have, you can purchase from any domain registrar, even google itself.

With that out of the way; head over to your [google cloud console](https://console.cloud.google.com/).
This is with the assumption that you already have a GCP project with app engine API enabled.

If you have not yet done that, you can search for app engine in cloud console.


![Search for app engine](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vnvbffzaj9u3kswfg54j.png)

Then proceed to creating a new project. After you have that taken care of, you can go ahead and get the gcloud CLI (SDK as google incorrectly calls it).

This can be installed from [here](https://cloud.google.com/sdk/docs/install).

Allow the gcloud CLI to login into your GCP with  the following command:

```bash

gcloud auth login

```

The above command opens your default browser asking you to login into you GCP account. Once authorised, the CLI can be used to deploy your app engine service(s).

# App Engine Environments

App engine provides two deployment environments, i.e standard and flexible.

## Standard

According to google, in the standard environment,the "applications run in a secure, sandboxed environment, allowing the standard environment to distribute requests across multiple servers and scale servers to meet traffic demands. Your application runs within its own secure, reliable environment that is independent of the hardware, operating system, or physical location of the server". Aside from this, the only supported languages under standard environment are PHP, Nodejs, GO, Java, Ruby and Python as of the time of this writing.

The standard package also provides a free tier, if resource consumption is low.

For the actual free tier resources, follow this [link](https://cloud.google.com/free/docs/free-cloud-features#app-engine).

## Flexible

The flexible environment has everything understand, with more "flexibility" as the name suggest.
This means that you are not limited by the choice of the programming language.

Using a programming language that is not part of the standard app engine programming languages is as easy as adding your own Dockerfile, and setting the runtime value to custom in the `app.yaml` file.

Aside from this, you can also specify the compute resources (i.e CPU, RAM,etc)to allocate to the app engine instances

# Conclusion

This is going to be a series of articles meant to help one get started with GCP app engine, and the next article will dive into adding the `app.yaml` file to your project to make it deployable to app engine.

Be on the look out.