9.2 Google Cloud Function

Support for Google Cloud Function is implemented in the Micronaut GCP subproject.

Simple Functions with Cloud Function

You can implement Cloud Functions with Micronaut that implement directly the Cloud Function Framework API. See the documentation on Simple Functions for more information.

Using the CLI

To create a Google Cloud Function:

  1. $ mn create-function-app my-app features google-cloud-function

Or with Micronaut Launch

HTTP Functions with Cloud Function

You can deploy regular Micronaut applications that use @Controller etc. using Micronaut’s support for HTTP Functions. See the documentation on Google Cloud HTTP Functions for more information.

Using the CLI

To create a Google Cloud HTTP Function:

  1. $ mn create-app my-app features google-cloud-function

Or with Micronaut Launch

  1. $ curl https://launch.micronaut.io/example.zip\?features\=google-cloud-function -o example.zip
  2. $ unzip example.zip -d example