Skip to content

Small cookiecutter template for quick deployment of GCP Cloud Functions.

License

Notifications You must be signed in to change notification settings

dmontaner/gcp_cloud_function_template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GCP Cloud Function Template

Simple template for quick deployment of GCP Cloud Functions.

(There is a multipage version commented)

Usage

Dependencies

pip install cookiecutter

Create a new function directory from the template

cookiecutter https://github.com/dmontaner/gcp_cloud_function_template.git

Develop locally

cd gcp_cloud_function_1  # your created folder here
virtualenv venv
source venv/bin/activate
pip install -r src/requirements.txt
deactivate

./run_local_server.sh

Deploy to GCP using gcloud

The project where the function is to be deployed needs to have the right permits. Usually I just create a default function within the project web console so that GCP asks me for all those permits and sets them for the project.

Then:

bash deploy.sh 

Test the cloud function

python tests/test_cloud_function.py

Delete function fromGCP

bash delete.sh 

Deploy to GCP using Terraform

cd terraform
terraform init
terraform plan
terraform apply

Delete function using Terraform

terraform destroy

About

Small cookiecutter template for quick deployment of GCP Cloud Functions.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published