Google Cloud Global Load Balancer Setup

Google Cloud Global Load Balancer Setup

Guides an agent through a six-step discovery process to design and deploy Google Cloud global Application Load Balancers with CDN, Cloud Armor and Terraform or gcloud output.

Skill files8 files

references/

SKILL.md146 lines
1
---
2
name: google-cloud-global-frontend-configuration
3
metadata:
4
version: "1.0.2"
5
category: Networking
6
description: |
7
Guides agents through a 6-step discovery process to design and deploy Google Cloud global external Application Load Balancers with Cloud CDN, Cloud Armor, and Service Extensions, mapping workload requirements to best-practice configurations.
8
Use when:
9
- Designing, configuring, or deploying a Google Cloud global external Application Load Balancer, Cloud CDN, Cloud Armor WAF, or Service Extensions.
10
- Discovering existing Google Cloud resources (Cloud Storage, MIGs, GKE, Cloud Run) to use as backends.
11
- Generating production-grade Terraform HCL or gcloud CLI scripts for global external Application Load Balancers.
12
- Actuating deployments via Infrastructure Manager or bash scripts, including IAM pre-checks.
13
- Detecting, analyzing, or reconciling configuration drift on deployed global external Application Load Balancers.
14
Don't use for:
15
- Non-Google Cloud load balancing or security configurations.
16
- Purely regional or internal load balancing setups (unless part of a hybrid/failover global design).
17
---
18
19
# Google Cloud global external Application Load Balancer Configuration Skill
20
21
## Attribution
22
23
**MUST READ**: Before executing any `gcloud`, REST API, or MCP command, you
24
MUST read [Usage Attribution](references/attribution.md). For commands executed
25
directly in the terminal (never in generated scripts, Terraform, or user code),
26
prefix `gcloud` with
27
`CLOUDSDK_METRICS_REQUEST_ATTRIBUTION="agent-skills/1.0 (skill:google-cloud-global-frontend-configuration)"`
28
and append
29
`agent-skills/1.0 (skill:google-cloud-global-frontend-configuration)`
30
to `User-Agent` headers.
31
32
## Purpose & Agent Guidance
33
34
This skill enables the agent to guide users through a structured, 6-step discovery process to design and deploy Google Cloud global external Application Load Balancers (incorporating Cloud CDN, Cloud Armor, and Service Extensions).
35
36
**Assumptions & Target Environments:**
37
- This skill assumes it is called from environments (such as Gemini CLI, Antigravity, etc.) where the Google Cloud CLI (`gcloud`) can be executed.
38
- If `gcloud` is not available or accessible, the skill cannot perform automated resource discovery or managed deployment actuation. In such environments, the skill will limit its support to guiding the design and generating Terraform HCL configurations.
39
40
When executing this skill, the agent must:
41
- Map user workload requirements to simplified, opinionated best-practice configurations using actual Google Cloud product names.
42
- Progressively disclose details, hiding advanced complexity unless the user explicitly asks for customization.
43
- Leverage the reference documents in the `references/` directory to perform resource discovery, code generation, actuation, and drift detection.
44
45
## The 6-Step Configuration Flow
46
47
### Step 1: Basics
48
* **Project Discovery:** Consult `references/resource-discovery.md` to auto-detect the Google Cloud project ID. Present the discovered project ID to the user.
49
* Ask the user for the foundational details of their load balancer:
50
* **Name & Description:** What should we call this load balancer?
51
* **Protocol Selection:** Do they need HTTP, HTTPS, or both?
52
* **Certificate Management:** Do they want to use Google-managed certificates or bring their own existing certificates?
53
54
### Step 2: Origin Configuration
55
Help the user define their backend workloads through a strictly sequential, step-by-step loop. Do NOT ask everything at once. All steps are mandatory.
56
57
* **Sub-step A - Origin Setup:** Ask if they have a single origin or need multi-origin support. Wait for response.
58
* **Sub-step B - Origin Types:** Ask them to select the backend types from: Cloud Storage Buckets, Compute Engine Managed Instance Groups (MIGs), Google Kubernetes Engine (GKE) Clusters, Cloud Run Services, or External/Internet origins (IP/FQDN). Wait for response.
59
* **Sub-step C - Origin Definition Loop:** Execute the following loop sequentially for EACH origin type selected in Sub-step B. Wait for the user to answer for one origin before asking about the next:
60
* **Resource Discovery:** For Google Cloud-native origins (Cloud Storage, MIGs, GKE, Cloud Run), consult `references/resource-discovery.md` to fetch resources. Present the list starting with **1. Create New**, **2. NA**. For External/Internet origins, just ask for the FQDN/IP.
61
* **Workload Type (CRITICAL):** Immediately after they define the resource, ask exactly what type of workload is being served:
62
1. **Static Images / Objects** (Static content, images, videos, styling assets)
63
2. **Cacheable API** (Read-only, public APIs where cached data is acceptable)
64
3. **Uncacheable API / Transactions** (Transactional endpoints, login, checkout, account changes)
65
4. **Dynamic Web (SSR)** (Dynamic pages, server-side rendered apps, custom dynamic sessions)
66
* **Sub-step D - Routing Rules:** Once ALL origins have been fully defined one by one, ask how traffic should be routed between them (Path-based, header-based, or query-param-based). Wait for response.
67
* **Sub-step E - Logging:** After routing is established, ask if they want to enable Cloud CDN logging, and if so, at what sampling rate (0-100%). Wait for response.
68
69
### Step 3: Traffic Management & Extensibility
70
* Provide a brief summary of the origins and routing rules defined in Step 2.
71
* Ask if they need to enable Advanced Traffic Management settings (such as granular weighted load balancing, traffic mirroring, or **Cloud Load Balancing Service Extensions** for custom WASM plugins / callouts), or if they want to proceed with **Google Cloud Best Practice Configuration**.
72
73
### Step 4: Caching (Cloud CDN)
74
Propose a "Recommended Configuration" based entirely on the Workload Type from Step 2. Do not list the advanced settings (TTL, Cache Keys, Compression) unless they reject the recommendation and want to customize.
75
76
* **If Workload = Static Images / Objects:**
77
* Cache Mode: Cache All Static
78
* TTL: Client (1 day / 86400s), Default (30 days / 2592000s), Max (365 days / 31536000s) — balances long-term cache offload for static assets with periodic re-validation.
79
* Cache Key: Backend services use Protocol + Host + Path (Ignore Query
80
Strings); Cloud Storage backend buckets omit Protocol and Host (Object
81
Path + Cloud Storage query parameters only)
82
* Compression: Enabled (Brotli & Gzip)
83
* Negative Caching: Enabled
84
* Serve while stale: Enabled
85
* **If Workload = Cacheable API:**
86
* Cache Mode: Use Origin Headers
87
* TTL: Managed by Origin (Omitted from configuration to prevent errors)
88
* Cache Key: Protocol + Host + Path + Include Query Strings
89
* Compression: Enabled (Gzip)
90
* Negative Caching: Enabled
91
* Serve while stale: Disabled
92
* **If Workload = Uncacheable API / Transactions:**
93
* Cache Mode: Disabled (CDN Bypassed)
94
* **If Workload = Dynamic Web (SSR):**
95
* Cache Mode: Use Origin Headers
96
* TTL: Managed by Origin (Omitted from configuration to prevent errors)
97
* Cache Key: Protocol + Host + Path
98
* Compression: Enabled (Brotli & Gzip)
99
* Cache Bypass: Bypass cache if session cookies (e.g., SESSID, JWT) are present
100
101
### Step 5: Security (Cloud Armor)
102
Propose a "Recommended Configuration" based entirely on the Workload Type from Step 2. Keep advanced protection (Bot Management, Threat Intel, Geo-blocking) hidden unless requested.
103
104
* **If Workload = Static Images / Objects:**
105
* Rate Limiting: None (Standard Edge behavior; rate limiting is unsupported on Cloud Armor Edge policies for Cloud Storage buckets).
106
* OWASP Protection: Disabled
107
* **If Workload = Cacheable API:**
108
* Rate Limiting: 100 requests per minute per client IP (standard baseline to prevent API abuse and DDoS while accommodating normal interactive usage).
109
* OWASP Protection: Enabled (SQLi, XSS, Local File Inclusion)
110
* **If Workload = Uncacheable API / Transactions:**
111
* Rate Limiting: Strict 30 requests per minute per client IP (tight threshold to protect sensitive transactional endpoints like login/checkout from credential stuffing and brute-force attacks).
112
* OWASP Protection: Enabled (SQLi, XSS, Remote Command Execution, Session Fixation)
113
* Bot Management & Threat Intel: Enabled (Block malicious bots and known malicious IPs)
114
* **If Workload = Dynamic Web (SSR):**
115
* Rate Limiting: 120 requests per minute per client IP (generous threshold to accommodate burst requests for initial page loads and asset hydration in SSR web applications).
116
* OWASP Protection: Enabled (SQLi, XSS, CSRF, Shellshock)
117
* Geo-blocking: Optional (Restrict/allow specific country access)
118
119
### Step 6: Review & Deploy
120
* **Configuration Summary:** Generate a complete, formatted markdown table showing all finalized settings from Steps 1 through 5, using Google Cloud product names. Follow this exact template structure:
121
122
| Component | Parameter / Setting | Value & Justification |
123
| :--- | :--- | :--- |
124
| **Load Balancer** | Name & Protocol | `<Name>` (HTTP/HTTPS) |
125
| **Origins** | Backends & Workloads | `<Backend 1>` (`<Workload Type>`), `<Backend 2>`... |
126
| **Traffic Management** | Routing Rules | `<Path / Header rules or Default>` |
127
| **Cloud CDN** | Cache Mode & TTLs | `<Cache Mode>`, Default TTL: `<TTL>` |
128
| **Cloud Armor** | Rate Limiting & OWASP | `<RPM Limit>`, OWASP Rules: `<Enabled/Disabled>` |
129
| **Service Extensions**| WASM / Callouts | `<Enabled/Disabled or N/A>` |
130
131
* **Next Action:** Ask the user to choose their deployment/generation format (Terraform HCL or gcloud CLI Bash Script) and their next action:
132
1. **Show Code / Script** (Display the HCL code or gcloud bash script. Once displayed, offer options to **Download** or **Deploy/Execute**)
133
2. **Download files** (Save `main.tf` or `deploy.sh` to the local workspace)
134
3. **Deploy Configuration:** Initiate the deployment via Infrastructure Manager or execute the gcloud script. This should be done using the deployment instructions in `references/managed-deployment.md`.
135
136
---
137
138
## Relevant Documentation & Supportive Links
139
- [Cloud Load Balancing Overview](https://cloud.google.com/load-balancing/docs/load-balancing-overview)
140
- [Cloud CDN Documentation](https://cloud.google.com/cdn/docs)
141
- [Cloud Armor Documentation](https://cloud.google.com/armor/docs)
142
- [Cloud Load Balancing Service Extensions](https://cloud.google.com/service-extensions/docs/overview)
143
- [Infrastructure Manager Overview](https://cloud.google.com/infrastructure-manager/docs)
144
- [Official Terraform LB-HTTP Module](https://registry.terraform.io/modules/GoogleCloudPlatform/lb-http/google/latest)
145
- [Official Terraform Cloud Armor Module](https://registry.terraform.io/modules/GoogleCloudPlatform/cloud-armor/google/latest)
146

© Google LLC · Apache 2.0 · 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…