一键导入
provider-add-attribute
// Add new attributes to an existing Terraform Provider resource. Covers the full workflow from code changes (Schema/Create/Read/Update), testing, documentation, to submitting a PR.
// Add new attributes to an existing Terraform Provider resource. Covers the full workflow from code changes (Schema/Create/Read/Update), testing, documentation, to submitting a PR.
| name | provider-add-attribute |
| description | Add new attributes to an existing Terraform Provider resource. Covers the full workflow from code changes (Schema/Create/Read/Update), testing, documentation, to submitting a PR. |
| metadata | {"version":"2.0.0","domain":"terraform-provider","triggers":"add attribute, add field, new attribute, new field, resource attribute"} |
Add one or more new attributes to an existing Terraform Provider resource.
Requirements may come from:
If the user provides a link, use the link-info-extractor skill to extract requirement details first:
task(category="quick", load_skills=["link-info-extractor"], ...)
cd <provider_repo_path>
git checkout master
git pull --rebase alicloud master
git checkout -b feat/<briefDescription>
Checkpoint: git branch --show-current should show the new branch name.
Find these four files:
alicloud/resource_alicloud_<product>_<resource>.go — Schema + CRUDalicloud/resource_alicloud_<product>_<resource>_test.go — Testsalicloud/service_alicloud_<product>[_v2].go — Describe method (data source for Read)website/docs/r/<product>_<resource>.html.markdown — DocumentationFind an existing attribute with the same type and behavior as a reference template (e.g., same TypeBool + Optional + Computed + ForceNew combination).
Note: Attribute tags must be set based on actual requirements:
Computed is NOT set by default. If tests show the new attribute causes a diff when unset (typically in existing test cases), add Computed: true.ForceNew should be set to true when the attribute does not support updates.// Package alicloud. This file is generated automatically...snake_case (e.g., delete_on_release), API uses PascalCase (e.g., DeleteOnRelease)GetOkExists: GetOk cannot distinguish false from unset (Go zero-value problem), causing false values to be silently droppedGetOkv.(*schema.Set) or v.([]interface{}) for array type assertion — use convertToInterfaceArray instead* \tags` - (Optional, Map, Available since v1.55.3) ...`. Use the upcoming version from CHANGELOG.md# 1. Quick CI check
make ci-check-quick
# 2. Full CI check (includes example tests and integration tests)
make ci-check
# 3. If step 2 has test failures, debug with specific resource and test case:
make test-resource-debug RESOURCE=alicloud_vpc TESTCASE=TestAccAliCloudVPC_enableIpv6 LOGLEVEL=TRACE LOGFILE=vpc-test.log
Squash all changes into a single commit:
git status && git diff
make commit
git push origin feat/<brief_description>
Commit message format:
feat(<resource_name>): add <attribute_name> attribute
Closes: <requirement_url>
aliyun <Product> <Action> help to check API documentationAutomated acceptance workflow for Terraform Provider resource releases. Supports two modes - Aone-driven (from workitem link) and local-branch (already on feature branch). Covers code review, acceptance testing, fixing failures, and CI checks.
Code review SOP for Terraform Provider resource changes. Covers delete implementation, code-doc consistency, conditional logic documentation, doc quality, test quality, and common bug patterns. Used standalone or referenced by provider-resource-acceptance.
Fix documentation issues in Terraform Provider resources. Covers attribute value corrections, description updates, example fixes, and documentation consistency checks.
Extract requirement details from a URL (Aone workitem, GitLab Code Review, etc.) using MCP tools. Use when the user provides a link to a requirement or review system.