GCP Cloud Functions

GCP Cloud Functions

Guides an AI agent to deploy serverless Google Cloud Functions with triggers, IAM roles, environment variables and monitoring, using gcloud, Node.js and Terraform.

Skill files6 files

references/

scripts/

templates/

SKILL.md97 lines
1
---
2
name: gcp-cloud-functions
3
description: >
4
Deploy serverless functions on Google Cloud Platform with triggers, IAM roles,
5
environment variables, and monitoring. Use for event-driven computing on GCP.
6
---
7
8
# GCP Cloud Functions
9
10
## Table of Contents
11
12
- [Overview](#overview)
13
- [When to Use](#when-to-use)
14
- [Quick Start](#quick-start)
15
- [Reference Guides](#reference-guides)
16
- [Best Practices](#best-practices)
17
18
## Overview
19
20
Google Cloud Functions enables event-driven serverless computing on Google Cloud Platform. Build functions with automatic scaling, integrated security, and seamless integration with Google Cloud services for rapid development.
21
22
## When to Use
23
24
- HTTP APIs and webhooks
25
- Pub/Sub message processing
26
- Storage bucket events
27
- Firestore database triggers
28
- Cloud Scheduler jobs
29
- Real-time data processing
30
- Image and video processing
31
- Data pipeline orchestration
32
33
## Quick Start
34
35
Minimal working example:
36
37
```bash
38
# Install Google Cloud SDK
39
curl https://sdk.cloud.google.com | bash
40
exec -l $SHELL
41
42
# Initialize and authenticate
43
gcloud init
44
gcloud auth application-default login
45
46
# Set project
47
gcloud config set project MY_PROJECT_ID
48
49
# Create service account
50
gcloud iam service-accounts create cloud-function-sa \
51
--display-name "Cloud Function Service Account"
52
53
# Grant permissions
54
gcloud projects add-iam-policy-binding MY_PROJECT_ID \
55
--member="serviceAccount:cloud-function-sa@MY_PROJECT_ID.iam.gserviceaccount.com" \
56
--role="roles/cloudfunctions.invoker"
57
58
# Deploy HTTP function
59
gcloud functions deploy my-http-function \
60
--gen2 \
61
--runtime nodejs18 \
62
--region us-central1 \
63
// ... (see reference guides for full implementation)
64
```
65
66
## Reference Guides
67
68
Detailed implementations in the `references/` directory:
69
70
| Guide | Contents |
71
|---|---|
72
| [Cloud Function Creation with gcloud CLI](references/cloud-function-creation-with-gcloud-cli.md) | Cloud Function Creation with gcloud CLI |
73
| [Cloud Functions Implementation (Node.js)](references/cloud-functions-implementation-nodejs.md) | Cloud Functions Implementation (Node.js) |
74
| [Terraform Cloud Functions Configuration](references/terraform-cloud-functions-configuration.md) | Terraform Cloud Functions Configuration |
75
76
## Best Practices
77
78
### ✅ DO
79
80
- Use service accounts with least privilege
81
- Store secrets in Secret Manager
82
- Implement proper error handling
83
- Use environment variables for configuration
84
- Monitor with Cloud Logging and Cloud Monitoring
85
- Set appropriate memory and timeout
86
- Use event filters to reduce invocations
87
- Implement idempotent functions
88
89
### ❌ DON'T
90
91
- Store secrets in code
92
- Use default service account
93
- Create long-running functions
94
- Ignore error handling
95
- Deploy without testing
96
- Use unauthenticated access for sensitive functions
97

© AJ Geddes · MIT · source · posted by @OpenSourceBuffGuy on promptparty.com

@OpenSourceBuffGuy

I find openly licensed prompts and post them here.

0 followers · 14,621 prompts

More by @OpenSourceBuffGuy

See all
Sea turtle carrying floating film studio island prompt image

Sea turtle carrying floating film studio island

Draws a giant sea turtle carrying a floating island film studio through a starry sky, where fairies polish rough film strips into golden film.

image-prompt, nano-banana, 3d-render, cartoon, fantasy-world, creatures, animals, whimsical, dreamy, cinematic, dramatic-lighting, vibrant-colors, bokeh, miniature, widescreen, night-scene, illustration, concept-art, surreal, storytelling, clay-3d

Desert buggy escapes drones past industrial outpost prompt image

Desert buggy escapes drones past industrial outpost

Builds a 15-second desert chase video where a racer in an armored buggy escapes drones past an industrial outpost, using five reference images with set jobs.

video-prompt, hailuo, action, multi-shot, timed-beats, camera-movement, reference-image, character-consistency, negative-prompt, cinematic, sci-fi, cars, landscape, aerial-view, tracking-shot, photorealistic, sound-effects, structured-output, long-form, widescreen

1 view
Cozy Pixel Art Farm Island Village prompt image

Cozy Pixel Art Farm Island Village

Draws a cozy 16-bit pixel-art farming village across six small islands joined by bridges, with exact counts for buildings, animals and crops.

image-prompt, gpt-image, pixel-art, isometric, game-assets, concept-art, maps, worldbuilding, cozy, vibrant-colors, ocean, landscape, wide-shot, widescreen, game-development, video-games, structured-output, whimsical, summer, high-angle, aerial-view, animals, negative-prompt, cityscape

1 view

Reviews

Loading reviews…

Discussion

Loading comments…