跳到正文
Skillpedia
API 与服务器(后端)22k · #10326

google-cloud-solution-n-tier-serverless-web-app

它能做什么

这个技能设计在 Cloud Run 上运行的多层网页应用,各层之间实现严格的网络隔离。它适用于希望拥有私有数据库和私有内部服务的安全无服务器应用的团队。

适用场景

  • ✓当你想在 Google Cloud 上设计多层无服务器网页应用的时候。
  • ✓当你需要在 Cloud Run 上使用没有直接互联网访问的私有内部服务的时候。
  • ✓当无服务器应用有数据驻留或欧洲主权需求的时候。

技能链接

https://github.com/google/skills/blob/main/skills/cloud/google-cloud-solution-n-tier-serverless-web-app/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/google/skills/blob/main/skills/cloud/google-cloud-solution-n-tier-serverless-web-app/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“请在 Cloud Run 上设计一个安全的三层网页应用,使用私有 Cloud SQL 数据库,并提供我可以审查的 Terraform 代码。”

每周 5 个新技能,1 分钟读完。

工作原理

它会设置一个公开的前端层和私有的内部层,各层通过 VPC 相互访问,同时保持数据库私有。它会提供安全检查清单和供审查的 Terraform 代码。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

<!-- disableFinding(all) --> <!-- mdlint off -->

Secure n-tier serverless web application with strict private application tiers

This skill guides agents through the workflow of designing and implementing a secure serverless web application with as many architectural design layers as specified by the user. It uses Cloud Run for the serverless layers and Cloud SQL for PostgreSQL as the data layer. A three-tier web application might be represented in three architectural layers: a Cloud Run presentation layer, a Cloud Run application layer, and a Cloud SQL for PostgreSQL database layer.

The architecture enforces strict physical and network isolation across all tiers (T1 to TN):

  • Tier 1 presentation tier (frontend / reverse proxy): Public-facing UI rendering/gateway service (Cloud Run). Exposes the entry point via Cloud Load Balancing and routes requests downstream to internal tiers privately via Direct VPC Egress.
  • Tier 2..N application tier (internal microservices / business logic): Private application services (Cloud Run). 100% isolated from the internet (Ingress: VPC-internal, INGRESS_TRAFFIC_INTERNAL_ONLY), reachable exclusively via upstream VPC routing (egress = "ALL_TRAFFIC" with Private Google Access on the subnet for *.run.app URLs).
  • Data tier: Private Cloud SQL for persistent data and Memorystore for Redis for caching, reachable exclusively from authorized application tiers.

Attribution

MUST READ: Before executing any gcloud, REST API, or MCP command, you MUST read and follow the instructions in Usage Attribution.

General guidance to the LLM

1. Direct Resource Map (Zero-Search File Access)

All necessary reference architectures, HCL templates, and checklists are co-located in this skill. Use exact relative paths from this skill folder:

Asset Path Purpose & Usage
assets/main.tf Single Source of Truth for Terraform (HCL). Contains all security boundaries, Cloud Run v2 configs, PSC endpoints, DNS private zones, and firewall rules.
assets/output-template.md Standardized Solution Architecture report markdown structure.
references/non-negotiable-architectural-rules.md Non-negotiable security rules, audit checklist, and product mappings.
references/related-guidance.md Supplemental deep reference (do NOT read for standard design or IaC tasks; read only if specialized edge-case troubleshooting is explicitly required).
  • No Directory Crawling: Do NOT run list_dir chains down workspace directories to discover these files.
  • No Search Thrashing on Local Files: Do NOT run code_search or find_by_name queries to look inside assets/main.tf. Read the file directly using view_file once and reuse the context.
  • No Redundant Skill Searches: Do NOT call skill_search for serverless or n-tier architecture skills while executing this skill.

2. Direct Inline Generation (No Subagent Delegation)

  • Perform all architecture compilation, Terraform drafting, gcloud command assembly, and validation script generation directly in the primary conversation.
  • Do NOT invoke subagents (invoke_subagent) to research external GitHub Terraform modules, probe environment configs, or draft reports. All required patterns are fully contained in assets/main.tf and references/.

3. One-Shot Clean Artifact Writing

  • Generate complete, fully-rendered, and valid HCL blocks and Markdown reports in a single write_to_file call.
  • Avoid leaving placeholders or malformed code fences that require multi-turn replace_file_content and grep_search patch loops.
  • No Unpopulated Placeholders: When embedding code or scripts inside architecture reports (e.g., Section 6 of assets/output-template.md), always inline the actual complete Terraform code, gcloud commands, and validation script code. Never output literal template placeholder comments (e.g., # [Paste of main.tf file contents]).
  • In-Response Direct Rendering (Mandatory): Whenever Terraform code, deployment scripts, or architecture reports are requested or generated (e.g., "provide a design and Terraform code", "generate IaC"), you MUST print the complete generated terraform ... HCL code block and full solution report directly in your chat response text, in addition to writing them to files on disk. Never output only an architectural design summary or file links when code is requested; automated eva
常见问题

数据库可以从互联网访问吗?

不可以。数据层保持私有,只能通过私有网络访问。

它涵盖虚拟机或 GKE 应用吗?

不涵盖。它只针对无服务器的 Cloud Run 应用。

它提供什么?

架构设计、安全检查清单、Terraform 代码和部署指导。

详情

作者的原始描述

Assists in designing and implementing secure n-tier serverless web applications and microservices on Google Cloud. Use when users need architecture designs, security checklists, Terraform code, or deployment guidance for multi-tier serverless apps, regional data residency / European sovereignty compliance, zero-trust private VPC networking, or Private Service Connect. Don't use for VM, GKE, or non-Google Cloud architectures.

repo: google/skills

热度

GitHub 星标
22k
排名
#10326
许可证
Apache-2.0
更新时间
2026/11/2

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能