Google Cloud Functions
GCP Functions example
This example lives in the pulumi/examples repository. Check out just this directory to use it:
git clone --filter=blob:none --sparse https://github.com/pulumi/examples pulumi-examplesgit -C pulumi-examples sparse-checkout set gcp-ts-functionscd pulumi-examples/gcp-ts-functionsAn example of deploying an HTTP Google Cloud Function endpoint using TypeScript.
Prerequisites#
Deploying the example#
-
Create a new stack:
Terminal window pulumi stack init gcp-fn -
Configure your GCP project and region:
Terminal window pulumi config set gcp:project <projectname>pulumi config set gcp:region <region> -
Install dependencies:
Terminal window npm install -
Deploy the stack:
Terminal window pulumi upPreviewing changes:...Performing changes:...info: 6 changes performed:+ 6 resources createdUpdate duration: 39.65130324s -
Check the deployed function endpoint:
Terminal window pulumi stack output urlcurl "$(pulumi stack output url)"https://us-central1-pulumi-development.cloudfunctions.net/greeting-function-7f95447Greetings from Google Cloud Functions!
Cleaning up#
Once you’re finished experimenting, destroy your stack and remove it to avoid incurring any additional cost:
pulumi destroypulumi stack rm