From volcengine
Manages Volcengine infrastructure via Terraform with plan/diff/drift/destroy safety for VKE, managed databases, cache, storage, load balancers, domains, logging, and monitoring.
How this skill is triggered — by the user, by Claude, or both
Slash command
/volcengine:volcengine-iacThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Generate, plan, and apply Volcengine infrastructure with Terraform when the user chooses IaC. `volcengine-deploy` still owns application packaging, runtime rollout, health checks, and CLI resource-ledger deployment.
assets/examples/volcengine-vke-cr-nginx/infra/main.tfassets/examples/volcengine-vke-cr-nginx/workload/main.tfassets/examples/volcenginecc-alb-acl/main.tfassets/examples/volcenginecc-alb-certificate/main.tfassets/examples/volcenginecc-alb-customized-cfg/main.tfassets/examples/volcenginecc-alb-health-check/main.tfassets/examples/volcenginecc-alb/main.tfassets/examples/volcenginecc-apig/main.tfassets/examples/volcenginecc-autoscaling/main.tfassets/examples/volcenginecc-cbr/main.tfassets/examples/volcenginecc-cen/main.tfassets/examples/volcenginecc-clb-acl/main.tfassets/examples/volcenginecc-clb-certificate/main.tfassets/examples/volcenginecc-clb/main.tfassets/examples/volcenginecc-cloudmonitor/main.tfassets/examples/volcenginecc-cr/main.tfassets/examples/volcenginecc-directconnect/main.tfassets/examples/volcenginecc-dns/main.tfassets/examples/volcenginecc-ebs-snapshot-group/main.tfassets/examples/volcenginecc-ebs-snapshot/main.tfGenerate, plan, and apply Volcengine infrastructure with Terraform when the user chooses IaC. volcengine-deploy still owns application packaging, runtime rollout, health checks, and CLI resource-ledger deployment.
When writing new examples, prefer the Cloud Control provider volcengine/volcenginecc. Start from verified examples under assets/examples/, then read the matching references/volcenginecc-*.md note for validation results and pitfalls. Blocked resources are tracked in references/volcenginecc-blocked.md. Existing reusable modules under assets/modules/ still use the legacy volcengine/volcengine provider until each component is re-verified with volcenginecc.
Use this skill when one of these is true:
Do not use this skill just because a deployment is long-lived, VKE-based, or has managed dependencies. Recommend IaC where appropriate, but let the user choose. Do not use this skill when the user asks for CLI, a temporary demo/quick validation, a pure ECS single-VM service with no plan/diff/destroy requirement, or when Terraform/provider installation is blocked and the target can safely use the CLI fallback.
The skill ships verified volcenginecc examples under assets/examples/, legacy reusable modules under assets/modules/, and wrapper scripts for tfvars generation, plan summaries, output export, and drift checks. Select files only after the target shape is known; do not load broad catalogs into context for small Terraform edits.
Resources outside the six legacy modules (CLB/ALB, VKE, CR, databases, caches, object storage) should be added as verified volcenginecc examples first, then wrapped only after repeated use proves the interface is stable.
Required env vars: VOLCENGINE_ACCESS_KEY, VOLCENGINE_SECRET_KEY, VOLCENGINE_REGION.
Required tools: terraform >= 1.5, jq, git, python3 (for gen_tfvars.py).
Optional: .volcengine/deploy-choice.json from volcengine-prepare/volcengine-deploy. If absent, ask a short batch of Terraform-specific questions.
The skill writes Terraform working files into .volcengine/terraform/ by default. State can use a TOS S3-compatible backend when the user wants remote state; see references/backend-tos.md. Local state is acceptable for small one-off experiments when the user accepts the tradeoff.
If invoked by volcengine-deploy, return outputs in .volcengine/iac-outputs.json and let deploy continue with image build/push, Cloud Assistant commands, Kubernetes manifests, veFaaS release, migrations, and health checks.
.volcengine/deploy-choice.jsonwork_dir="${work_dir:-.volcengine/terraform}"
workload="${workload:-standard}"
mkdir -p "$work_dir"
python3 scripts/gen_tfvars.py \
--input ".volcengine/deploy-choice.json" \
--output "$work_dir/terraform.tfvars" \
--workload "$workload"
gen_tfvars.py derives:
project, region, AZ pair from the choice file and environmentenable_vke / enable_cr / enable_rds / enable_redis / enable_tos flags from the chosen mode and known dependencies--workload tierThe user can override any value before applying.
When no prepare report exists, ask the user one batch of questions, then create a Terraform working directory from verified examples or legacy modules and generate matching variable values. Required answers:
cn-beijing)gen_tfvars.py writes only terraform.tfvars. The Terraform configuration files come from copied verified examples under assets/examples/ or from a small root module assembled from assets/modules/; edit those files to match the selected stack instead of expecting the script to generate them.
| File | Purpose |
|---|---|
main.tf / variables.tf | Copied or assembled Terraform configuration |
terraform.tfvars | Concrete values generated by gen_tfvars.py or edited by hand |
backend.tf | Generated only when TOS remote state is selected; otherwise omit it |
The full per-module variable schema lives in references/modules.md. For new volcenginecc work, start from a verified example under assets/examples/ instead of these legacy modules unless the user explicitly needs the old provider.
volcenginecc verified examplesCopy the relevant verified example, then run the same init/validate/plan sequence:
cp -R "assets/examples/<example-name>" "$work_dir/<component>"
cd "$work_dir/<component>"
terraform init -backend=false -input=false
terraform validate
terraform plan -out=tfplan.binary -input=false
Before apply, show the plan summary and require explicit user confirmation. Read the matching reference before changing inputs or destroying resources; the references contain field choices, validation notes, import IDs, and provider pitfalls.
Use the deployment shape to choose a small set of verified examples. Start with examples; wrap into reusable modules only after repeated use proves the interface stable. Typical stacks combine:
volcenginecc-network, volcenginecc-ecs, optional TLS/CloudMonitorvolcenginecc-network, volcenginecc-vke, volcenginecc-cr, CLB or ALBvolcenginecc-vefaas, optional APIG/TLSThis mapping is a guide, not a promise that a prebuilt module exists. Copy relevant examples into .volcengine/terraform/<component> and keep component boundaries clear so plan/destroy output remains readable.
For the end-to-end VKE private CR nginx path, use assets/examples/volcengine-vke-cr-nginx/ and read references/volcengine-vke-cr-nginx.md first. That example exists for the CR credential addon, core-dns, CR token expiry, and image architecture pitfalls found in a real run.
Use the filesystem as the catalog. After selecting a deployment shape, list only the relevant directories under assets/examples/, then read the matching references/volcenginecc-*.md file for validation notes, import IDs, and provider caveats. Do not load every example into context up front.
Common example families:
volcenginecc-network, VPC extras, NAT, VPN, DirectConnect, CEN, TransitRouter, PrivateLink, DNS, PrivateZonevolcenginecc-ecs, ECS extras, launch template versions, EBS snapshots, Auto Scalingvolcenginecc-vke, volcenginecc-cr, CLB/ALB entry, APIG, veFaaSvolcenginecc-rdsmysql, volcenginecc-rdspostgresql, volcenginecc-rdsmssql, Redis, Kafka allowlistvolcenginecc-tos, TOS notification, TLS, CloudMonitor, IAM, FileNAS, EFSLegacy volcengine modules are still available under assets/modules/; read references/modules.md before using them.
Legacy modules currently cover network, vke, cr, rds-mysql, redis, and tos. ECS and CLB/ALB stay as verified examples because their workload shapes vary too much for one stable module interface.
cd "$work_dir"
# Map Volcengine creds to the Terraform s3 backend's required env variable names.
export AWS_ACCESS_KEY_ID="$VOLCENGINE_ACCESS_KEY"
export AWS_SECRET_ACCESS_KEY="$VOLCENGINE_SECRET_KEY"
export AWS_EC2_METADATA_DISABLED=true
terraform init -input=false
tf_workspace="${tf_workspace:-default}"
terraform workspace select "$tf_workspace" || \
terraform workspace new "$tf_workspace"
When remote state is requested, generate backend.tf from references/backend-tos.md. The verified TOS backend shape requires skip_requesting_account_id = true and must not set force_path_style or use_path_style.
Provider download (~30–60 seconds first time) goes through registry.terraform.io. In China networks this may be blocked or slow. If public registry access fails and the user still wants IaC, configure Terraform provider_installation with a filesystem or internal mirror. Otherwise return to volcengine-deploy and ask whether to use the CLI resource-ledger path.
For the TOS bucket prerequisite (must exist before init), see references/backend-tos.md. Without a TOS bucket, omit backend.tf and Terraform falls back to local state.
terraform plan -out=tfplan.binary -input=false
terraform show -json tfplan.binary > tfplan.json
bash scripts/plan_summary.sh tfplan.json
plan_summary.sh groups changes by action (CREATE / UPDATE / DELETE / REPLACE) and prints a one-line summary at the end. Show this to the user before any apply.
Watch for:
terraform show tfplan.binaryAlways require explicit user confirmation. Do not pass -auto-approve. The pattern:
The plan above will create N resources, change M, destroy K. Approve apply? [yes/no]
After yes:
terraform apply tfplan.binary
VKE cluster creation takes ~10–15 minutes. RDS HA instances take ~20 minutes. Surface the long-running message to the user once at apply start so they don't think it hung.
After apply succeeds, run export_outputs.sh automatically:
bash scripts/export_outputs.sh
echo "Resources ready. .volcengine/iac-outputs.json now contains downstream consumption keys."
export_outputs.sh writes terraform output -json to .volcengine/iac-outputs.json with mode 0600. Downstream skills commonly consume VPC/subnet/security group IDs, VKE kubeconfig, CR repository data, RDS/Redis endpoints or IDs, and TOS bucket names. Some keys are conditional on which examples/modules were enabled; consumers must use defensive jq defaults.
# Show what will be destroyed first
terraform plan -destroy -out=destroy.binary
terraform show -json destroy.binary | bash scripts/plan_summary.sh
Then:
This will permanently delete N resources including RDS / Redis / TOS bucket data. Confirm? [yes/no]
On yes:
terraform destroy
# Note: provider does not accept -auto-approve=false; we rely on the agent-level prompt above.
Hard rule: never destroy in prod workspace without a second confirmation. The agent should explicitly re-prompt:
Workspace = prod. Re-confirm destroy by typing 'destroy prod':
bash scripts/check_drift.sh
Returns:
0 and {"drift": false, ...} — no drift2 and {"drift": true, "changed_resources": N, ...} — N resources changed outside Terraform1 and {"drift": "error", ...} — refresh-only plan erroredUse this:
apply to confirm baseline matches stateIf the user wants to adopt resources created via volcengine-cli or console, use terraform import. Import IDs differ by resource; read the matching references/volcenginecc-*.md or references/modules.md before importing. After import, run terraform plan and reconcile by editing config, not state.
~/.volcengine/config.json; it may contain plaintext AK/SK.terraform.tfstate* or .volcengine/iac-outputs.json.-auto-approve to terraform apply or terraform destroy.check_drift.sh before every apply on shared environments.0600 on files holding kubeconfig or secrets.The scripts enforce file permissions where possible. Apply and destroy gates are the agent's responsibility.
Look up by the exact error string; act on the mapped cause before suspecting unrelated layers.
| Symptom | Cause | Fix |
|---|---|---|
terraform init: "Failed to query available provider packages" | outbound to registry.terraform.io blocked | Configure provider_installation with a filesystem/internal mirror and rerun init; otherwise return to volcengine-deploy and ask whether CLI resource-ledger provisioning is acceptable |
terraform init: "InvalidAccessKeyId" against TOS backend | s3 backend env vars not exported | Export AWS_ACCESS_KEY_ID="$VOLCENGINE_ACCESS_KEY", AWS_SECRET_ACCESS_KEY="$VOLCENGINE_SECRET_KEY", AWS_EC2_METADATA_DISABLED=true |
terraform init: TOS backend returns InvalidPathAccess | path-style access or unsupported workspace prefix | Use the verified template in references/backend-tos.md: keep skip_requesting_account_id = true, remove force_path_style/use_path_style |
apply succeeds for VPC but subnet fails with InvalidVpc.InvalidStatus | VPC not yet Available (consistency window) | Add depends_on = [volcengine_vpc.main] (already wired in the network module) |
VKE cluster stuck in Creating for >20 min | quota or AZ capacity | ve vke ListClusters --body '{"Filter":{"Ids":["..."]}}' | jq .Result.Items[0].Status for the real reason |
redis output missing endpoint | provider does not export it | Resolve via ve redis DescribeDBInstanceDetail --InstanceId $(jq -r '.redis_instance_id.value' .volcengine/iac-outputs.json) |
terraform plan shows unexpected changes after no edits | drift, or provider patch bump silently changing a default | Run check_drift.sh, inspect tfplan.json, decide whether to accept or revert |
Two engineers' apply collide | TOS backend has no DynamoDB-style locking | Coordinate manually; see references/backend-tos.md |
| Resource-specific apply/import drift | provider caveat for that resource | Read the matching references/volcenginecc-*.md note before editing config |
npx claudepluginhub volcengine/volcengine-skills --plugin volcengineBuilds accessible UIs with shadcn/ui components on Radix UI + Tailwind CSS, plus canvas visuals. For React apps (Next.js, Vite, Remix, Astro), design systems, responsive layouts, themes, dark mode, prototypes.