Google Cloud Functions in Python deployed with C#
A minimal C# Pulumi program using Google Cloud Functions.
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-cs-functionscd pulumi-examples/gcp-cs-functionsThis example deploys a Google Cloud Function implemented in Python. Pulumi program is implemented in C#.
Deploying the App#
To deploy your infrastructure, follow the below steps.
Prerequisites#
Deploying and running the program#
-
Create a new stack:
$ pulumi stack init dev -
Set the GCP project and region:
$ pulumi config set gcp:project <your-gcp-project>$ pulumi config set gcp:region <gcp-region> -
Run
pulumi upto preview and deploy changes:$ pulumi upPreviewing changes:...Performing changes:...info: 10 changes performed:+ 10 resources createdUpdate duration: 45s -
Check the deployed function endpoints:
$ pulumi stack output PythonEndpointhttps://us-central1-test-1234.cloudfunctions.net/python-func-742a512$ curl "$(pulumi stack output PythonEndpoint)"Hello World! -
From there, feel free to experiment. Simply making edits and running
pulumi upwill incrementally update your stack. -
Once you’ve finished experimenting, tear down your stack’s resources by destroying and removing it:
Terminal window pulumi destroy --yespulumi stack rm --yes