terraform-gcp-integration
Provision and manage GCP resources with Terraform. Use when working with Pub/Sub topics/subscriptions, GKE clusters, Cloud SQL, IAM roles, Cloud Storage, VPCs, service accounts, or any GCP service. Covers provider configuration, resource patterns, authentication, and GCP-specific best practices.
What this skill does
# Terraform GCP Integration Skill
## Table of Contents
**Quick Start** → [What Is This](#purpose) | [When to Use](#when-to-use) | [Simple Example](#quick-start)
**How to Implement** → [Step-by-Step](#instructions) | [Examples](#examples)
**Help** → [Requirements](#requirements) | [See Also](#see-also)
## Purpose
Master GCP resource provisioning with Terraform including provider configuration, Pub/Sub patterns, GKE management, IAM security, and GCP-specific best practices.
## When to Use
Use this skill when you need to:
- **Work with Pub/Sub** - Create topics, subscriptions, and dead letter queues
- **Manage GKE clusters** - Deploy and configure Kubernetes on GCP
- **Configure Cloud SQL** - Set up managed databases with Terraform
- **Set up IAM roles** - Grant service accounts appropriate permissions
- **Work with Cloud Storage** - Create and manage GCS buckets
- **Configure VPCs** - Set up networking infrastructure
- **Manage service accounts** - Create and bind service accounts to resources
- **Import existing GCP resources** - Bring existing infrastructure under Terraform management
**Trigger Phrases:**
- "Create Pub/Sub topic with Terraform"
- "Configure GCP provider authentication"
- "Set up IAM permissions for service account"
- "Deploy GKE cluster"
- "Import existing GCP resource"
## Quick Start
Deploy a Pub/Sub topic with subscription and IAM in 5 minutes:
```bash
# 1. Configure provider
# main.tf
terraform {
required_providers {
google = {
source = "hashicorp/google"
version = "~> 5.26.0"
}
}
}
provider "google" {
project = "ecp-wtr-supplier-charges-prod"
region = "europe-west2"
}
# 2. Create resources
# pubsub.tf
resource "google_pubsub_topic" "incoming" {
name = "supplier-charges-incoming"
}
resource "google_pubsub_subscription" "incoming_sub" {
name = "supplier-charges-incoming-sub"
topic = google_pubsub_topic.incoming.name
}
# 3. Grant permissions
# iam.tf
data "google_service_account" "app" {
account_id = "app-runtime"
}
resource "google_pubsub_topic_iam_member" "publisher" {
topic = google_pubsub_topic.incoming.name
role = "roles/pubsub.publisher"
member = "serviceAccount:${data.google_service_account.app.email}"
}
# 4. Deploy
terraform init
terraform apply
```
## Instructions
### Step 1: Configure GCP Provider
```hcl
# main.tf
terraform {
required_providers {
google = {
source = "hashicorp/google"
version = "~> 5.26.0" # Pin to minor version
}
}
}
provider "google" {
project = "ecp-wtr-supplier-charges-prod"
region = "europe-west2"
zone = "europe-west2-a"
}
```
**Version Pinning Best Practices**:
- `>= 5.26.0` - Too loose, allows major updates
- `~> 5.26.0` - Recommended, allows 5.26.x only
- `5.26.0` - Safest, exact version (check updates regularly)
**Authentication** (Terraform auto-detects):
```bash
# Option 1: Application Default Credentials (recommended)
gcloud auth application-default login
# Option 2: Service account
export GOOGLE_APPLICATION_CREDENTIALS=/path/to/key.json
# Option 3: In code (for CI/CD)
provider "google" {
credentials = file("~/.gcp/credentials.json")
project = "ecp-wtr-supplier-charges-prod"
}
```
### Step 2: Work with Pub/Sub Topics
**Create Topic**:
```hcl
resource "google_pubsub_topic" "incoming_charges" {
name = "supplier-charges-incoming"
# Retention: How long to keep messages
message_retention_duration = "604800s" # 7 days
# Labels for organization
labels = {
environment = "production"
team = "charges"
}
# KMS encryption (optional)
kms_key_name = "projects/ecp-wtr-supplier-charges-prod/locations/global/keyRings/key-ring-1/cryptoKeys/key-1"
}
```
**Create Subscription**:
```hcl
resource "google_pubsub_subscription" "incoming_charges_sub" {
name = "supplier-charges-incoming-sub"
topic = google_pubsub_topic.incoming_charges.name
# Acknowledgment deadline
ack_deadline_seconds = 60 # 1 minute
# Message retention for subscription
message_retention_duration = "86400s" # 1 day
# Retry policy (for failed deliveries)
retry_policy {
minimum_backoff = "10s"
maximum_backoff = "600s" # 10 minutes
}
# Dead Letter Queue for failed messages
dead_letter_policy {
dead_letter_topic = google_pubsub_topic.incoming_dlq.id
max_delivery_attempts = 5 # Retry 5 times before DLQ
}
labels = {
environment = "production"
}
}
# Dead Letter Queue topic
resource "google_pubsub_topic" "incoming_dlq" {
name = "supplier-charges-incoming-dlq"
labels = {
environment = "production"
}
}
```
**Filter Messages**:
```hcl
# Only deliver messages matching filter
resource "google_pubsub_subscription" "high_value_charges" {
name = "supplier-charges-high-value"
topic = google_pubsub_topic.incoming_charges.name
filter = "attributes.amount > 1000" # CEL filter syntax
}
```
### Step 3: Configure IAM Permissions
**Least Privilege Principle**: Grant minimum required permissions.
**Pub/Sub Roles**:
- `roles/pubsub.editor` - Full control (avoid)
- `roles/pubsub.publisher` - Publish only
- `roles/pubsub.subscriber` - Subscribe only
- `roles/pubsub.viewer` - Read-only
**Grant Permissions**:
```hcl
# Get service account
data "google_service_account" "app_runtime" {
account_id = "app-runtime"
}
# Grant publisher role
resource "google_pubsub_topic_iam_member" "publisher" {
topic = google_pubsub_topic.incoming_charges.name
role = "roles/pubsub.publisher"
member = "serviceAccount:${data.google_service_account.app_runtime.email}"
}
# Grant subscriber role
resource "google_pubsub_subscription_iam_member" "subscriber" {
subscription = google_pubsub_subscription.incoming_charges_sub.name
role = "roles/pubsub.subscriber"
member = "serviceAccount:${data.google_service_account.app_runtime.email}"
}
# Grant project-level role (if needed for multiple resources)
resource "google_project_iam_member" "pubsub_editor" {
project = data.google_project.current.project_id
role = "roles/pubsub.admin"
member = "serviceAccount:${data.google_service_account.app_runtime.email}"
# Optional: Add condition for additional security
condition {
title = "Only in production"
description = "Access only allowed in production environment"
expression = "resource.matchTag('environment', 'production')"
}
}
```
**IAM Data Source**:
```hcl
# Get current project info
data "google_project" "current" {}
# Get existing service account
data "google_service_account" "existing" {
account_id = "app-runtime"
}
# Use in outputs
output "service_account_email" {
value = data.google_service_account.existing.email
}
```
### Step 4: Work with Service Accounts
**Create Service Account**:
```hcl
resource "google_service_account" "app_runtime" {
account_id = "app-runtime"
display_name = "Application Runtime Service Account"
description = "Service account for application to access Pub/Sub"
}
# Create key
resource "google_service_account_key" "app_runtime_key" {
service_account_id = google_service_account.app_runtime.name
}
# Export key (for local development)
output "service_account_key_json" {
value = base64decode(google_service_account_key.app_runtime_key.private_key)
sensitive = true
}
```
**Bind Service Account to GKE Node Pool**:
```hcl
resource "google_container_node_pool" "primary" {
name = "primary-pool"
cluster = google_container_cluster.primary.name
node_count = 3
node_config {
service_account = google_service_account.app_runtime.email
scopes = ["cloud-platform"] # Full API access
}
}
```
### Step 5: Work with Cloud Storage
**Create Bucket**:
```hcl
resource "google_storage_bucket" "charges_data" {
name = "supplier-charges-data-${var.environment}"
location = "EUROPE-WEST2"
# Lifecycle rules (auto-delete old objects)
lifecycle_rule {
condition {
age = 30 # Days
}
action {
type = "DRelated in Backend & APIs
jfrog
IncludedInteract with the JFrog Platform via the JFrog CLI and REST/GraphQL APIs. Use this skill when the user wants to manage Artifactory repositories, upload or download artifacts, manage builds, configure permissions, manage users and groups, work with access tokens, configure JFrog CLI servers, search artifacts, manage properties, set up replication, manage JFrog Projects, run security audits or scans, look up CVE details, query exposures scan results from JFrog Advanced Security, manage release bundles and lifecycle operations, aggregate or export platform data, or perform any JFrog Platform administration task. Also use when the user mentions jf, jfrog, artifactory, xray, distribution, evidence, apptrust, onemodel, graphql, workers, mission control, curation, advanced security, exposures, or any JFrog product name.
cupynumeric-migration-readiness
IncludedPre-migration readiness assessor for porting NumPy to cuPyNumeric. Use BEFORE substantial porting work begins when the user asks whether code will scale on GPU, whether they should migrate to cuPyNumeric, which NumPy patterns transfer cleanly, what must be refactored before porting, or mentions pre-port assessment, scaling analysis, or refactor planning. Inspect the user's source code, look up NumPy usage, cross-reference the cuPyNumeric API support manifest, and distinguish distributed-scaling-friendly patterns from blockers such as unsupported APIs, scalar synchronization, host round-trips, Python/object-heavy control flow, shape/data-dependent branching, and in-place mutation hazards. Produce a verdict of READY, LIGHT REFACTOR, SIGNIFICANT REFACTOR, or NOT RECOMMENDED, with concrete refactor pointers.
alibabacloud-data-agent-skill
IncludedInvoke Alibaba Cloud Apsara Data Agent for Analytics via CLI to perform natural language-driven data analysis on enterprise databases. Data Agent for Analytics is an intelligent data analysis agent developed by Alibaba Cloud Database team for enterprise users. It automatically completes requirement analysis, data understanding, analysis insights, and report generation based on natural language descriptions. This tool supports: discovering data resources (instances/databases/tables) managed in DMS, initiating query or deep analysis sessions, real-time progress tracking, and retrieving analysis conclusions and generated reports. Use this Skill when users need to query databases, analyze data trends, generate data reports, ask questions in natural language, or mention "Data Agent", "data analysis", "database query", "SQL analysis", "data insights".
token-optimizer
IncludedReduce OpenClaw token usage and API costs through smart model routing, heartbeat optimization, budget tracking, and native 2026.2.15 features (session pruning, bootstrap size limits, cache TTL alignment). Use when token costs are high, API rate limits are being hit, or hosting multiple agents at scale. The 4 executable scripts (context_optimizer, model_router, heartbeat_optimizer, token_tracker) are local-only — no network requests, no subprocess calls, no system modifications. Reference files (PROVIDERS.md, config-patches.json) document optional multi-provider strategies that require external API keys and network access if you choose to use them. See SECURITY.md for full breakdown.
resend-cli
IncludedUse this skill when the task is specifically about operating Resend from an AI agent, terminal session, or CI job via the official resend CLI: installing/authenticating the CLI, sending/listing/updating/cancelling emails, batch sends, domains and DNS, webhooks and local listeners, inbound receiving, contacts, topics, segments, broadcasts, templates, API keys, profiles, or debugging Resend CLI/API failures. Trigger on mentions of Resend CLI, `resend`, `resend doctor`, `resend emails send`, `resend domains`, `resend webhooks listen`, `resend emails receiving`, or agent-friendly terminal automation.
alibabacloud-odps-maxframe-coding
IncludedUse this skill for MaxFrame SDK development and documentation navigation on Alibaba Cloud MaxCompute (ODPS). Helps answer MaxFrame API, concept, official example, and supported pandas API questions; create data processing programs; read/write MaxCompute tables; debug jobs (remote or local); and build custom DPE runtime images. Trigger when users mention MaxFrame, MaxCompute with MaxFrame, ODPS table processing, DPE runtime, MaxFrame docs/examples, DataFrame/Tensor operations, or GPU runtime setup. Works for both English and Chinese queries about Alibaba Cloud data processing with MaxFrame.