[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6BZRYWCS7Z2CNCJ9Z4QXDKZ":3,"skill-same:01M6BZRYWCS7Z2CNCJ9Z4QXDKZ":77},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":8,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":18,"categories":19,"keywords":30,"publishedAt":42,"linkOnly":43,"markdownContent":44,"markdownBody":45,"frontMatter":46,"refName":50,"commitSha":51,"skillDirectory":52,"forksCount":15,"repositoryHtmlUrl":53,"repositoryHomepageUrl":17,"ownerHtmlUrl":54,"ownerBlogUrl":17,"ownerDescription":55,"updatedAt":56,"install":57,"resources":70},"01M6BZRYWCS7Z2CNCJ9Z4QXDKZ","provider-actions","Terraform Provider动作实现","Implement Terraform Provider actions using the Plugin Framework. Use when developing imperative operations that execute at lifecycle events (before\u002Fafter create, update, destroy).","使用 Plugin Framework 实现 Terraform Provider 的 action（动作）。适用于开发在生命周期事件（创建\u002F更新\u002F销毁前后）执行的命令式操作。","twidxuga\u002Fdotfiles","twidxuga","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F12471681?v=4","01M6BZR45BH8JCC79Q9SKSS6SC","Ricardo Santos","01M6BZR49CRKSBZYQD1WNQWCXW",0,"MIT",null,"https:\u002F\u002Fgithub.com\u002Ftwidxuga\u002Fdotfiles\u002Fblob\u002Fmain\u002Fopencode\u002Fdot-config\u002Fopencode\u002Fskills\u002Fterraform-provider-actions\u002FSKILL.md",[20,25],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8BQ6TQZN6R52WBJ9H8NRMQM","软件开发工程师","PROFESSION","适用职业",{"categoryNo":26,"categoryName":27,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8C8X79YT9M7G8WNMPEXSGQQ","Terraform 基础设施即代码管理","SCENARIO","使用场景",[31,32,33,34,35,36,37,38,39,40,41],"actions","provider actions","implement","plugin","create","update","terraform","terraform provider","framework","ibm","lifecycle","2026-11-10 10:12:30",false,"---\nname: provider-actions\ndescription: Implement Terraform Provider actions using the Plugin Framework. Use when developing imperative operations that execute at lifecycle events (before\u002Fafter create, update, destroy).\nmetadata:\n  copyright: Copyright IBM Corp. 2026\n  version: \"0.0.1\"\n---\n\n# Terraform Provider Actions Implementation Guide\n\n## Overview\n\nTerraform Actions enable imperative operations during the Terraform lifecycle. Actions are experimental features that allow performing provider operations at specific lifecycle events (before\u002Fafter create, update, destroy).\n\n**References:**\n- [Terraform Plugin Framework](https:\u002F\u002Fdeveloper.hashicorp.com\u002Fterraform\u002Fplugin\u002Fframework)\n- [Terraform Actions RFC](https:\u002F\u002Fgithub.com\u002Fhashicorp\u002Fterraform\u002Fblob\u002Fmain\u002Fdocs\u002Fplugin-protocol\u002Factions.md)\n\n## File Structure\n\nActions follow the standard service package structure:\n\n```\ninternal\u002Fservice\u002F\u003Cservice>\u002F\n├── \u003Caction_name>_action.go       # Action implementation\n├── \u003Caction_name>_action_test.go  # Action tests\n└── service_package_gen.go        # Auto-generated service registration\n```\n\nDocumentation structure:\n```\nwebsite\u002Fdocs\u002Factions\u002F\n└── \u003Cservice>_\u003Caction_name>.html.markdown  # User-facing documentation\n```\n\nChangelog entry:\n```\n.changelog\u002F\n└── \u003Cpr_number_or_description>.txt  # Release note entry\n```\n\n## Action Schema Definition\n\nActions use the Terraform Plugin Framework with a standard schema pattern:\n\n```go\nfunc (a *actionType) Schema(ctx context.Context, req action.SchemaRequest, resp *action.SchemaResponse) {\n    resp.Schema = schema.Schema{\n        Attributes: map[string]schema.Attribute{\n            \u002F\u002F Required configuration parameters\n            \"resource_id\": schema.StringAttribute{\n                Required:    true,\n                Description: \"ID of the resource to operate on\",\n            },\n            \u002F\u002F Optional parameters with defaults\n            \"timeout\": schema.Int64Attribute{\n                Optional:    true,\n                Description: \"Operation timeout in seconds\",\n                Default:     int64default.StaticInt64(1800),\n                Computed:    true,\n            },\n        },\n    }\n}\n```\n\n### Common Schema Issues\n\n**Pay special attention to the schema definition** - common issues after a first draft:\n\n1. **Type Mismatches**\n   - Using `types.String` instead of `fwtypes.String` in model structs\n   - Using `types.StringType` instead of `fwtypes.StringType` in schema\n   - Mixing framework types with plugin-framework types\n\n2. **List\u002FMap Element Types**\n   ```go\n   \u002F\u002F WRONG - missing ElementType\n   \"items\": schema.ListAttribute{\n       Optional: true,\n   }\n\n   \u002F\u002F CORRECT\n   \"items\": schema.ListAttribute{\n       Optional:    true,\n       ElementType: fwtypes.StringType,\n   }\n   ```\n\n3. **Computed vs Optional**\n   - Attributes with defaults must be both `Optional: true` and `Computed: true`\n   - Don't mark action inputs as `Computed` unless they have defaults\n\n4. **Validator Imports**\n   ```go\n   \u002F\u002F Ensure proper imports\n   \"github.com\u002Fhashicorp\u002Fterraform-plugin-framework-validators\u002Fint64validator\"\n   \"github.com\u002Fhashicorp\u002Fterraform-plugin-framework-validators\u002Fstringvalidator\"\n   ```\n\n5. **Region\u002FProvider Attribute**\n   - Use framework-provided region handling when available\n   - Don't manually define provider-specific config in schema if framework handles it\n\n6. **Nested Attributes**\n   - Use appropriate nested object types for complex structures\n   - Ensure nested types are properly defined\n\n### Schema Validation Checklist\n\nBefore submitting, verify:\n- [ ] All attributes have descriptions\n- [ ] List\u002FMap attributes have ElementType defined\n- [ ] Validators are imported and applied correctly\n- [ ] Model struct uses correct framework types\n- [ ] Optional attributes with defaults are marked Computed\n- [ ] Code compiles without type errors\n- [ ] Run `go build` to catch type mismatches\n\n## Action Invoke Method\n\nThe Invoke method contains the action logic:\n\n```go\nfunc (a *actionType) Invoke(ctx context.Context, req action.InvokeRequest, resp *action.InvokeResponse) {\n    var data actionModel\n    resp.Diagnostics.Append(req.Config.Get(ctx, &data)...)\n\n    \u002F\u002F Create provider client\n    conn := a.Meta().Client(ctx)\n\n    \u002F\u002F Progress updates for long-running operations\n    resp.Progress.Set(ctx, \"Starting operation...\")\n\n    \u002F\u002F Implement action logic with error handling\n    \u002F\u002F Use context for timeout management\n    \u002F\u002F Poll for completion if async operation\n\n    resp.Progress.Set(ctx, \"Operation completed\")\n}\n```\n\n## Key Implementation Requirements\n\n### 1. Progress Reporting\n\n- Use `resp.SendProgress(action.InvokeProgressEvent{...})` for real-time updates\n- Provide meaningful progress messages during long operations\n- Update progress at key milestones\n- Include elapsed time for long operations\n\n### 2. Timeout Management\n\n- Always include configurable timeout parameter (default: 1800s)\n- Use `context.WithTimeout()` for API calls\n- Handle timeout errors gracefully\n- Validate timeout ranges (typically 60-7200 seconds)\n\n### 3. Error Handling\n\n- Add diagnostics with `resp.Diagnostics.AddError()`\n- Provide clear error messages with context\n- Include API error details when relevant\n- Map provider error types to user-friendly messages\n- Document all possible error cases\n\nExample error handling:\n```go\n\u002F\u002F Handle specific errors\nvar notFound *types.ResourceNotFoundException\nif errors.As(err, &notFound) {\n    resp.Diagnostics.AddError(\n        \"Resource Not Found\",\n        fmt.Sprintf(\"Resource %s was not found\", resourceID),\n    )\n    return\n}\n\n\u002F\u002F Generic error handling\nresp.Diagnostics.AddError(\n    \"Operation Failed\",\n    fmt.Sprintf(\"Could not complete operation for %s: %s\", resourceID, err),\n)\n```\n\n### 4. Provider SDK Integration\n\n- Use provider SDK clients from `a.Meta().\u003CService>Client(ctx)`\n- Handle pagination for list operations\n- Implement retry logic for transient failures\n- Use appropriate error types\n\n### 5. Parameter Validation\n\n- Use framework validators for input validation\n- Validate resource existence before operations\n- Check for conflicting parameters\n- Validate against provider naming requirements\n\n### 6. Polling and Waiting\n\nFor operations that require waiting for completion:\n\n```go\nresult, err := wait.WaitForStatus(ctx,\n    func(ctx context.Context) (wait.FetchResult[*ResourceType], error) {\n        \u002F\u002F Fetch current status\n        resource, err := findResource(ctx, conn, id)\n        if err != nil {\n            return wait.FetchResult[*ResourceType]{}, err\n        }\n        return wait.FetchResult[*ResourceType]{\n            Status: wait.Status(resource.Status),\n            Value:  resource,\n        }, nil\n    },\n    wait.Options[*ResourceType]{\n        Timeout:            timeout,\n        Interval:           wait.FixedInterval(5 * time.Second),\n        SuccessStates:      []wait.Status{\"AVAILABLE\", \"COMPLETED\"},\n        TransitionalStates: []wait.Status{\"CREATING\", \"PENDING\"},\n        ProgressInterval:   30 * time.Second,\n        ProgressSink: func(fr wait.FetchResult[any], meta wait.ProgressMeta) {\n            resp.SendProgress(action.InvokeProgressEvent{\n                Message: fmt.Sprintf(\"Status: %s, Elapsed: %v\", fr.Status, meta.Elapsed.Round(time.Second)),\n            })\n        },\n    },\n)\n```\n\n## Common Action Patterns\n\n### Batch Operations\n- Process items in configurable batches\n- Report progress per batch\n- Handle partial failures gracefully\n- Support prefix\u002Ffilter parameters\n\n### Command Execution\n- Submit command and get operation ID\n- Poll for completion status\n- Retrieve and report output\n- Handle timeout during polling\n- Validate resources exist before execution\n\n### Service Invocation\n- Invoke service with parameters\n- Wait for completion (if synchronous)\n- Return output\u002Fresults\n- Handle service-specific errors\n\n### Resource State Changes\n- Validate current state\n- Apply state change\n- Poll for target state\n- Handle transitional states\n\n### Async Job Submission\n- Submit job with configuration\n- Get job ID\n- Optionally wait for completion\n- Report job status\n\n## Action Triggers\n\nActions are invoked via `action_trigger` lifecycle blocks in Terraform configurations:\n\n```hcl\naction \"provider_service_action\" \"name\" {\n  config {\n    parameter = value\n  }\n}\n\nresource \"terraform_data\" \"trigger\" {\n  lifecycle {\n    action_trigger {\n      events  = [after_create]\n      actions = [action.provider_service_action.name]\n    }\n  }\n}\n```\n\n### Available Trigger Events\n\n**Terraform 1.14.0 Supported Events:**\n- `before_create` - Before resource creation\n- `after_create` - After resource creation\n- `before_update` - Before resource update\n- `after_update` - After resource update\n\n**Not Supported in Terraform 1.14.0:**\n- `before_destroy` - Not available (will cause validation error)\n- `after_destroy` - Not available (will cause validation error)\n\n## Testing Actions\n\n### Acceptance Tests\n\n- Test action invocation with valid parameters\n- Test timeout scenarios\n- Test error conditions\n- Verify provider state changes\n- Test progress reporting\n- Test with custom parameters\n- Test trigger-based invocation\n\n### Test Pattern\n\n```go\nfunc TestAccServiceAction_basic(t *testing.T) {\n    ctx := acctest.Context(t)\n\n    resource.ParallelTest(t, resource.TestCase{\n        PreCheck:                 func() { acctest.PreCheck(ctx, t) },\n        ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories,\n        TerraformVersionChecks: []tfversion.TerraformVersionCheck{\n            tfversion.SkipBelow(tfversion.Version1_14_0),\n        },\n        Steps: []resource.TestStep{\n            {\n                Config: testAccActionConfig_basic(),\n                Check: resource.ComposeTestCheckFunc(\n                    testAccCheckResourceExists(ctx, \"provider_resource.test\"),\n                ),\n            },\n        },\n    })\n}\n```\n\n### Test Cleanup with Sweep Functions\n\nAdd sweep functions to clean up test resources:\n\n```go\nfunc sweepResources(region string) error {\n    ctx := context.Background()\n    client := \u002F* get client for region *\u002F\n\n    input := &service.ListInput{\n        \u002F\u002F Filter for test resources\n    }\n\n    var sweeperErrs *multierror.Error\n\n    pages := service.NewListPaginator(client, input)\n    for pages.HasMorePages() {\n        page, err := pages.NextPage(ctx)\n        if err != nil {\n            sweeperErrs = multierror.Append(sweeperErrs, err)\n            continue\n        }\n\n        for _, item := range page.Items {\n            id := item.Id\n\n            \u002F\u002F Skip non-test resources\n            if !strings.HasPrefix(id, \"tf-acc-test\") {\n                continue\n            }\n\n            _, err := client.Delete(ctx, &service.DeleteInput{\n                Id: id,\n            })\n            if err != nil {\n                sweeperErrs = multierror.Append(sweeperErrs, err)\n            }\n        }\n    }\n\n    return sweeperErrs.ErrorOrNil()\n}\n```\n\n### Testing Best Practices\n\n**Service-Specific Prerequisites**\n- Always check for service-specific prerequisites that must be met before actions can succeed\n- Document prerequisites in action documentation and test configurations\n\n**Error Pattern Matching**\n- Terraform wraps action errors with additional context\n- Use flexible regex patterns: `regexache.MustCompile(\\`(?s)Error Title.*key phrase\\`)`\n\n**Test Patterns Not Applicable to Actions**\n1. Actions trigger on lifecycle events, not config reapplication\n2. Before\u002FAfter Destroy Tests: Not supported in Terraform 1.14.0\n\n### Running Tests\n\nCompile test to check for errors:\n```bash\ngo test -c -o \u002Fdev\u002Fnull .\u002Finternal\u002Fservice\u002F\u003Cservice>\n```\n\nRun specific action tests:\n```bash\nTF_ACC=1 go test .\u002Finternal\u002Fservice\u002F\u003Cservice> -run TestAccServiceAction_ -v\n```\n\nRun sweep to clean up test resources:\n```bash\nTF_ACC=1 go test .\u002Finternal\u002Fservice\u002F\u003Cservice> -sweep=\u003Cregion> -v\n```\n\n## Documentation Standards\n\nEach action documentation file must include:\n\n1. **Front Matter**\n   ```yaml\n   ---\n   subcategory: \"Service Name\"\n   layout: \"provider\"\n   page_title: \"Provider: provider_service_action\"\n   description: |-\n     Brief description of what the action does.\n   ---\n   ```\n\n2. **Header with Warnings**\n   - Beta\u002FAlpha notice about experimental status\n   - Warning about potential unintended consequences\n   - Link to provider documentation\n\n3. **Example Usage**\n   - Basic usage example\n   - Advanced usage with all options\n   - Trigger-based example with `terraform_data`\n   - Real-world use case examples\n\n4. **Argument Reference**\n   - List all required and optional arguments\n   - Include descriptions and defaults\n   - Note any validation rules\n\n5. **Documentation Linting**\n   - Run `terrafmt fmt` before submission\n   - Verify with `terrafmt diff`\n\n## Changelog Entry Format\n\nCreate a changelog entry in `.changelog\u002F` directory:\n\n```\n.changelog\u002F\u003Cpr_number_or_description>.txt\n```\n\nContent format:\n```release-note:new-action\naction\u002Fprovider_service_action: Brief description of the action\n```\n\n## Pre-Submission Checklist\n\nBefore submitting your action implementation:\n\n- [ ] Code compiles: `go build -o \u002Fdev\u002Fnull .`\n- [ ] Tests compile: `go test -c -o \u002Fdev\u002Fnull .\u002Finternal\u002Fservice\u002F\u003Cservice>`\n- [ ] Code formatted: `make fmt`\n- [ ] Documentation formatted: `terrafmt fmt website\u002Fdocs\u002Factions\u002F\u003Caction>.html.markdown`\n- [ ] Changelog entry created\n- [ ] Schema uses correct types\n- [ ] All List\u002FMap attributes have ElementType\n- [ ] Progress updates implemented for long operations\n- [ ] Error messages include context and resource identifiers\n- [ ] Documentation includes multiple examples\n- [ ] Documentation includes prerequisites and warnings\n\n## References\n\n- [Terraform Plugin Framework Documentation](https:\u002F\u002Fdeveloper.hashicorp.com\u002Fterraform\u002Fplugin\u002Fframework)\n- [Terraform Provider Development](https:\u002F\u002Fdeveloper.hashicorp.com\u002Fterraform\u002Fplugin)\n- [terraform-plugin-framework GitHub](https:\u002F\u002Fgithub.com\u002Fhashicorp\u002Fterraform-plugin-framework)\n- [terraform-plugin-testing](https:\u002F\u002Fgithub.com\u002Fhashicorp\u002Fterraform-plugin-testing)\n","# Terraform Provider Actions Implementation Guide\n\n## Overview\n\nTerraform Actions enable imperative operations during the Terraform lifecycle. Actions are experimental features that allow performing provider operations at specific lifecycle events (before\u002Fafter create, update, destroy).\n\n**References:**\n- [Terraform Plugin Framework](https:\u002F\u002Fdeveloper.hashicorp.com\u002Fterraform\u002Fplugin\u002Fframework)\n- [Terraform Actions RFC](https:\u002F\u002Fgithub.com\u002Fhashicorp\u002Fterraform\u002Fblob\u002Fmain\u002Fdocs\u002Fplugin-protocol\u002Factions.md)\n\n## File Structure\n\nActions follow the standard service package structure:\n\n```\ninternal\u002Fservice\u002F\u003Cservice>\u002F\n├── \u003Caction_name>_action.go       # Action implementation\n├── \u003Caction_name>_action_test.go  # Action tests\n└── service_package_gen.go        # Auto-generated service registration\n```\n\nDocumentation structure:\n```\nwebsite\u002Fdocs\u002Factions\u002F\n└── \u003Cservice>_\u003Caction_name>.html.markdown  # User-facing documentation\n```\n\nChangelog entry:\n```\n.changelog\u002F\n└── \u003Cpr_number_or_description>.txt  # Release note entry\n```\n\n## Action Schema Definition\n\nActions use the Terraform Plugin Framework with a standard schema pattern:\n\n```go\nfunc (a *actionType) Schema(ctx context.Context, req action.SchemaRequest, resp *action.SchemaResponse) {\n    resp.Schema = schema.Schema{\n        Attributes: map[string]schema.Attribute{\n            \u002F\u002F Required configuration parameters\n            \"resource_id\": schema.StringAttribute{\n                Required:    true,\n                Description: \"ID of the resource to operate on\",\n            },\n            \u002F\u002F Optional parameters with defaults\n            \"timeout\": schema.Int64Attribute{\n                Optional:    true,\n                Description: \"Operation timeout in seconds\",\n                Default:     int64default.StaticInt64(1800),\n                Computed:    true,\n            },\n        },\n    }\n}\n```\n\n### Common Schema Issues\n\n**Pay special attention to the schema definition** - common issues after a first draft:\n\n1. **Type Mismatches**\n   - Using `types.String` instead of `fwtypes.String` in model structs\n   - Using `types.StringType` instead of `fwtypes.StringType` in schema\n   - Mixing framework types with plugin-framework types\n\n2. **List\u002FMap Element Types**\n   ```go\n   \u002F\u002F WRONG - missing ElementType\n   \"items\": schema.ListAttribute{\n       Optional: true,\n   }\n\n   \u002F\u002F CORRECT\n   \"items\": schema.ListAttribute{\n       Optional:    true,\n       ElementType: fwtypes.StringType,\n   }\n   ```\n\n3. **Computed vs Optional**\n   - Attributes with defaults must be both `Optional: true` and `Computed: true`\n   - Don't mark action inputs as `Computed` unless they have defaults\n\n4. **Validator Imports**\n   ```go\n   \u002F\u002F Ensure proper imports\n   \"github.com\u002Fhashicorp\u002Fterraform-plugin-framework-validators\u002Fint64validator\"\n   \"github.com\u002Fhashicorp\u002Fterraform-plugin-framework-validators\u002Fstringvalidator\"\n   ```\n\n5. **Region\u002FProvider Attribute**\n   - Use framework-provided region handling when available\n   - Don't manually define provider-specific config in schema if framework handles it\n\n6. **Nested Attributes**\n   - Use appropriate nested object types for complex structures\n   - Ensure nested types are properly defined\n\n### Schema Validation Checklist\n\nBefore submitting, verify:\n- [ ] All attributes have descriptions\n- [ ] List\u002FMap attributes have ElementType defined\n- [ ] Validators are imported and applied correctly\n- [ ] Model struct uses correct framework types\n- [ ] Optional attributes with defaults are marked Computed\n- [ ] Code compiles without type errors\n- [ ] Run `go build` to catch type mismatches\n\n## Action Invoke Method\n\nThe Invoke method contains the action logic:\n\n```go\nfunc (a *actionType) Invoke(ctx context.Context, req action.InvokeRequest, resp *action.InvokeResponse) {\n    var data actionModel\n    resp.Diagnostics.Append(req.Config.Get(ctx, &data)...)\n\n    \u002F\u002F Create provider client\n    conn := a.Meta().Client(ctx)\n\n    \u002F\u002F Progress updates for long-running operations\n    resp.Progress.Set(ctx, \"Starting operation...\")\n\n    \u002F\u002F Implement action logic with error handling\n    \u002F\u002F Use context for timeout management\n    \u002F\u002F Poll for completion if async operation\n\n    resp.Progress.Set(ctx, \"Operation completed\")\n}\n```\n\n## Key Implementation Requirements\n\n### 1. Progress Reporting\n\n- Use `resp.SendProgress(action.InvokeProgressEvent{...})` for real-time updates\n- Provide meaningful progress messages during long operations\n- Update progress at key milestones\n- Include elapsed time for long operations\n\n### 2. Timeout Management\n\n- Always include configurable timeout parameter (default: 1800s)\n- Use `context.WithTimeout()` for API calls\n- Handle timeout errors gracefully\n- Validate timeout ranges (typically 60-7200 seconds)\n\n### 3. Error Handling\n\n- Add diagnostics with `resp.Diagnostics.AddError()`\n- Provide clear error messages with context\n- Include API error details when relevant\n- Map provider error types to user-friendly messages\n- Document all possible error cases\n\nExample error handling:\n```go\n\u002F\u002F Handle specific errors\nvar notFound *types.ResourceNotFoundException\nif errors.As(err, &notFound) {\n    resp.Diagnostics.AddError(\n        \"Resource Not Found\",\n        fmt.Sprintf(\"Resource %s was not found\", resourceID),\n    )\n    return\n}\n\n\u002F\u002F Generic error handling\nresp.Diagnostics.AddError(\n    \"Operation Failed\",\n    fmt.Sprintf(\"Could not complete operation for %s: %s\", resourceID, err),\n)\n```\n\n### 4. Provider SDK Integration\n\n- Use provider SDK clients from `a.Meta().\u003CService>Client(ctx)`\n- Handle pagination for list operations\n- Implement retry logic for transient failures\n- Use appropriate error types\n\n### 5. Parameter Validation\n\n- Use framework validators for input validation\n- Validate resource existence before operations\n- Check for conflicting parameters\n- Validate against provider naming requirements\n\n### 6. Polling and Waiting\n\nFor operations that require waiting for completion:\n\n```go\nresult, err := wait.WaitForStatus(ctx,\n    func(ctx context.Context) (wait.FetchResult[*ResourceType], error) {\n        \u002F\u002F Fetch current status\n        resource, err := findResource(ctx, conn, id)\n        if err != nil {\n            return wait.FetchResult[*ResourceType]{}, err\n        }\n        return wait.FetchResult[*ResourceType]{\n            Status: wait.Status(resource.Status),\n            Value:  resource,\n        }, nil\n    },\n    wait.Options[*ResourceType]{\n        Timeout:            timeout,\n        Interval:           wait.FixedInterval(5 * time.Second),\n        SuccessStates:      []wait.Status{\"AVAILABLE\", \"COMPLETED\"},\n        TransitionalStates: []wait.Status{\"CREATING\", \"PENDING\"},\n        ProgressInterval:   30 * time.Second,\n        ProgressSink: func(fr wait.FetchResult[any], meta wait.ProgressMeta) {\n            resp.SendProgress(action.InvokeProgressEvent{\n                Message: fmt.Sprintf(\"Status: %s, Elapsed: %v\", fr.Status, meta.Elapsed.Round(time.Second)),\n            })\n        },\n    },\n)\n```\n\n## Common Action Patterns\n\n### Batch Operations\n- Process items in configurable batches\n- Report progress per batch\n- Handle partial failures gracefully\n- Support prefix\u002Ffilter parameters\n\n### Command Execution\n- Submit command and get operation ID\n- Poll for completion status\n- Retrieve and report output\n- Handle timeout during polling\n- Validate resources exist before execution\n\n### Service Invocation\n- Invoke service with parameters\n- Wait for completion (if synchronous)\n- Return output\u002Fresults\n- Handle service-specific errors\n\n### Resource State Changes\n- Validate current state\n- Apply state change\n- Poll for target state\n- Handle transitional states\n\n### Async Job Submission\n- Submit job with configuration\n- Get job ID\n- Optionally wait for completion\n- Report job status\n\n## Action Triggers\n\nActions are invoked via `action_trigger` lifecycle blocks in Terraform configurations:\n\n```hcl\naction \"provider_service_action\" \"name\" {\n  config {\n    parameter = value\n  }\n}\n\nresource \"terraform_data\" \"trigger\" {\n  lifecycle {\n    action_trigger {\n      events  = [after_create]\n      actions = [action.provider_service_action.name]\n    }\n  }\n}\n```\n\n### Available Trigger Events\n\n**Terraform 1.14.0 Supported Events:**\n- `before_create` - Before resource creation\n- `after_create` - After resource creation\n- `before_update` - Before resource update\n- `after_update` - After resource update\n\n**Not Supported in Terraform 1.14.0:**\n- `before_destroy` - Not available (will cause validation error)\n- `after_destroy` - Not available (will cause validation error)\n\n## Testing Actions\n\n### Acceptance Tests\n\n- Test action invocation with valid parameters\n- Test timeout scenarios\n- Test error conditions\n- Verify provider state changes\n- Test progress reporting\n- Test with custom parameters\n- Test trigger-based invocation\n\n### Test Pattern\n\n```go\nfunc TestAccServiceAction_basic(t *testing.T) {\n    ctx := acctest.Context(t)\n\n    resource.ParallelTest(t, resource.TestCase{\n        PreCheck:                 func() { acctest.PreCheck(ctx, t) },\n        ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories,\n        TerraformVersionChecks: []tfversion.TerraformVersionCheck{\n            tfversion.SkipBelow(tfversion.Version1_14_0),\n        },\n        Steps: []resource.TestStep{\n            {\n                Config: testAccActionConfig_basic(),\n                Check: resource.ComposeTestCheckFunc(\n                    testAccCheckResourceExists(ctx, \"provider_resource.test\"),\n                ),\n            },\n        },\n    })\n}\n```\n\n### Test Cleanup with Sweep Functions\n\nAdd sweep functions to clean up test resources:\n\n```go\nfunc sweepResources(region string) error {\n    ctx := context.Background()\n    client := \u002F* get client for region *\u002F\n\n    input := &service.ListInput{\n        \u002F\u002F Filter for test resources\n    }\n\n    var sweeperErrs *multierror.Error\n\n    pages := service.NewListPaginator(client, input)\n    for pages.HasMorePages() {\n        page, err := pages.NextPage(ctx)\n        if err != nil {\n            sweeperErrs = multierror.Append(sweeperErrs, err)\n            continue\n        }\n\n        for _, item := range page.Items {\n            id := item.Id\n\n            \u002F\u002F Skip non-test resources\n            if !strings.HasPrefix(id, \"tf-acc-test\") {\n                continue\n            }\n\n            _, err := client.Delete(ctx, &service.DeleteInput{\n                Id: id,\n            })\n            if err != nil {\n                sweeperErrs = multierror.Append(sweeperErrs, err)\n            }\n        }\n    }\n\n    return sweeperErrs.ErrorOrNil()\n}\n```\n\n### Testing Best Practices\n\n**Service-Specific Prerequisites**\n- Always check for service-specific prerequisites that must be met before actions can succeed\n- Document prerequisites in action documentation and test configurations\n\n**Error Pattern Matching**\n- Terraform wraps action errors with additional context\n- Use flexible regex patterns: `regexache.MustCompile(\\`(?s)Error Title.*key phrase\\`)`\n\n**Test Patterns Not Applicable to Actions**\n1. Actions trigger on lifecycle events, not config reapplication\n2. Before\u002FAfter Destroy Tests: Not supported in Terraform 1.14.0\n\n### Running Tests\n\nCompile test to check for errors:\n```bash\ngo test -c -o \u002Fdev\u002Fnull .\u002Finternal\u002Fservice\u002F\u003Cservice>\n```\n\nRun specific action tests:\n```bash\nTF_ACC=1 go test .\u002Finternal\u002Fservice\u002F\u003Cservice> -run TestAccServiceAction_ -v\n```\n\nRun sweep to clean up test resources:\n```bash\nTF_ACC=1 go test .\u002Finternal\u002Fservice\u002F\u003Cservice> -sweep=\u003Cregion> -v\n```\n\n## Documentation Standards\n\nEach action documentation file must include:\n\n1. **Front Matter**\n   ```yaml\n   ---\n   subcategory: \"Service Name\"\n   layout: \"provider\"\n   page_title: \"Provider: provider_service_action\"\n   description: |-\n     Brief description of what the action does.\n   ---\n   ```\n\n2. **Header with Warnings**\n   - Beta\u002FAlpha notice about experimental status\n   - Warning about potential unintended consequences\n   - Link to provider documentation\n\n3. **Example Usage**\n   - Basic usage example\n   - Advanced usage with all options\n   - Trigger-based example with `terraform_data`\n   - Real-world use case examples\n\n4. **Argument Reference**\n   - List all required and optional arguments\n   - Include descriptions and defaults\n   - Note any validation rules\n\n5. **Documentation Linting**\n   - Run `terrafmt fmt` before submission\n   - Verify with `terrafmt diff`\n\n## Changelog Entry Format\n\nCreate a changelog entry in `.changelog\u002F` directory:\n\n```\n.changelog\u002F\u003Cpr_number_or_description>.txt\n```\n\nContent format:\n```release-note:new-action\naction\u002Fprovider_service_action: Brief description of the action\n```\n\n## Pre-Submission Checklist\n\nBefore submitting your action implementation:\n\n- [ ] Code compiles: `go build -o \u002Fdev\u002Fnull .`\n- [ ] Tests compile: `go test -c -o \u002Fdev\u002Fnull .\u002Finternal\u002Fservice\u002F\u003Cservice>`\n- [ ] Code formatted: `make fmt`\n- [ ] Documentation formatted: `terrafmt fmt website\u002Fdocs\u002Factions\u002F\u003Caction>.html.markdown`\n- [ ] Changelog entry created\n- [ ] Schema uses correct types\n- [ ] All List\u002FMap attributes have ElementType\n- [ ] Progress updates implemented for long operations\n- [ ] Error messages include context and resource identifiers\n- [ ] Documentation includes multiple examples\n- [ ] Documentation includes prerequisites and warnings\n\n## References\n\n- [Terraform Plugin Framework Documentation](https:\u002F\u002Fdeveloper.hashicorp.com\u002Fterraform\u002Fplugin\u002Fframework)\n- [Terraform Provider Development](https:\u002F\u002Fdeveloper.hashicorp.com\u002Fterraform\u002Fplugin)\n- [terraform-plugin-framework GitHub](https:\u002F\u002Fgithub.com\u002Fhashicorp\u002Fterraform-plugin-framework)\n- [terraform-plugin-testing](https:\u002F\u002Fgithub.com\u002Fhashicorp\u002Fterraform-plugin-testing)\n",{"name":5,"metadata":47,"description":7},{"version":48,"copyright":49},"0.0.1","Copyright IBM Corp. 2026","main","e25eb555e87aa9eeb59b520834f46fd926ad19a3","opencode\u002Fdot-config\u002Fopencode\u002Fskills\u002Fterraform-provider-actions","https:\u002F\u002Fgithub.com\u002Ftwidxuga\u002Fdotfiles","https:\u002F\u002Fgithub.com\u002Ftwidxuga","Software developer, data scientist, applications architect and all round computer geek.","2026-10-28 03:46:24",{"source":9,"skillName":5,"commands":58,"prompt":68,"zipAvailable":69},[59,62,65],{"tool":60,"command":61},"npx","npx skills add twidxuga\u002Fdotfiles --skill provider-actions",{"tool":63,"command":64},"bunx","bunx skills add twidxuga\u002Fdotfiles --skill provider-actions",{"tool":66,"command":67},"pnpm","pnpm dlx skills add twidxuga\u002Fdotfiles --skill provider-actions","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Ftwidxuga\u002Fdotfiles\u002Fblob\u002Fmain\u002Fopencode\u002Fdot-config\u002Fopencode\u002Fskills\u002Fterraform-provider-actions\u002FSKILL.md",true,[71],{"path":72,"resourceType":73,"resourceTypeDesc":74,"sizeBytes":75,"sourceHtmlUrl":76},"README.md","REFERENCE","参考文档",669,"https:\u002F\u002Fgithub.com\u002FJinsYin\u002Fskills\u002Fblob\u002Fmaster\u002Fskills\u002Fversion-release\u002FREADME.md",[78,106,123,143,162,172],{"skillNo":79,"name":80,"nameZh":81,"description":82,"descriptionZh":83,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":84,"categories":85,"keywords":90,"publishedAt":42},"01M6C9Z7VKBN4HAFBDXD67K3E1","terraform-test","Terraform 测试编写与执行","Comprehensive guide for writing and running Terraform tests. Use when creating test files (.tftest.hcl), writing test scenarios with run blocks, validating infrastructure behavior with assertions, mocking providers and data sources, testing module outputs and resource configurations, or troubleshooting Terraform test syntax and execution.","编写和运行 Terraform 测试的综合指南。适用于创建测试文件（.tftest.hcl）、编写带 run 块的测试场景、用断言验证基础设施行为、模拟 provider 和数据源、测试模块输出与资源配置，或排查 Terraform 测试语法和执行问题。","https:\u002F\u002Fgithub.com\u002Ftwidxuga\u002Fdotfiles\u002Fblob\u002Fmain\u002Fopencode\u002Fdot-config\u002Fopencode\u002Fskills\u002Fterraform-test\u002FSKILL.md",[86,89],{"categoryNo":87,"categoryName":88,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8BT9F3Z67AB1M6CHA8X75WW","云架构师",{"categoryNo":26,"categoryName":27,"taxonomyType":28,"taxonomyTypeDesc":29},[91,37,92,93,94,95,96,97,40,98,99,100,101,102,103,104,105],"test","terraform test","testing","writing","infrastructure","run","data","Providers","execution","troubleshooting","syntax","behavior","guide","use","files",{"skillNo":107,"name":108,"nameZh":109,"description":110,"descriptionZh":111,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":112,"categories":113,"keywords":116,"publishedAt":42},"01M6C9Z4GWWTXCXAS8NK747K07","terraform-style-guide","Terraform HCL 代码规范","Generate Terraform HCL code following HashiCorp's official style conventions and best practices. Use when writing, reviewing, or generating Terraform configurations.","遵循 HashiCorp 官方风格约定与最佳实践生成 Terraform HCL 代码。适用于编写、审查或生成 Terraform 配置。","https:\u002F\u002Fgithub.com\u002Ftwidxuga\u002Fdotfiles\u002Fblob\u002Fmain\u002Fopencode\u002Fdot-config\u002Fopencode\u002Fskills\u002Fterraform-style-guide\u002FSKILL.md",[114,115],{"categoryNo":87,"categoryName":88,"taxonomyType":23,"taxonomyTypeDesc":24},{"categoryNo":26,"categoryName":27,"taxonomyType":28,"taxonomyTypeDesc":29},[117,103,37,118,119,120,121,94,122,104],"terraform style guide","official","generate","code","best practices","hashicorp",{"skillNo":124,"name":125,"nameZh":126,"description":127,"descriptionZh":128,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":129,"categories":130,"keywords":133,"publishedAt":42},"01M6C9Z1DCAC8YQQ1WS0AHBB14","terraform-stacks","Terraform Stacks 配置管理","Comprehensive guide for working with HashiCorp Terraform Stacks. Use when creating, modifying, or validating Terraform Stack configurations (.tfcomponent.hcl, .tfdeploy.hcl files), working with stack components and deployments from local modules, public registry, or private registry sources, managing multi-region or multi-environment infrastructure, or troubleshooting Terraform Stacks syntax and structure.","使用 HashiCorp Terraform Stacks 的综合指南。适用于创建、修改或验证 Terraform Stack 配置（.tfcomponent.hcl、.tfdeploy.hcl 文件），处理来自本地模块、公共注册表或私有注册表源的堆栈组件与部署，管理多区域或多环境基础设施，或排查 Terraform Stacks 语法和结构问题。","https:\u002F\u002Fgithub.com\u002Ftwidxuga\u002Fdotfiles\u002Fblob\u002Fmain\u002Fopencode\u002Fdot-config\u002Fopencode\u002Fskills\u002Fterraform-stacks\u002FSKILL.md",[131,132],{"categoryNo":87,"categoryName":88,"taxonomyType":23,"taxonomyTypeDesc":24},{"categoryNo":26,"categoryName":27,"taxonomyType":28,"taxonomyTypeDesc":29},[37,134,135,105,136,137,138,139,95,140,40,122,141,100,101,142,103,104],"terraform stacks","multi-environment","deployments","public","modules","components","registry","stack","environment",{"skillNo":144,"name":145,"nameZh":146,"description":147,"descriptionZh":148,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":149,"categories":150,"keywords":153,"publishedAt":42},"01M6C9YYAVCNTR81V4HGZWPFW1","terraform-search-import","Terraform 云资源发现与批量导入","Discover existing cloud resources using Terraform Search queries and bulk import them into Terraform management. Use when bringing unmanaged infrastructure under Terraform control, auditing cloud resources, or migrating to IaC.","使用 Terraform Search 查询发现现有云资源，并将其批量导入 Terraform 管理。适用于将非托管基础设施纳入 Terraform 管控、审计云资源或迁移到基础设施即代码（IaC）。","https:\u002F\u002Fgithub.com\u002Ftwidxuga\u002Fdotfiles\u002Fblob\u002Fmain\u002Fopencode\u002Fdot-config\u002Fopencode\u002Fskills\u002Fterraform-search-import\u002FSKILL.md",[151,152],{"categoryNo":87,"categoryName":88,"taxonomyType":23,"taxonomyTypeDesc":24},{"categoryNo":26,"categoryName":27,"taxonomyType":28,"taxonomyTypeDesc":29},[154,155,37,104,156,95,157,40,98,158,159,160,161],"terraform search import","search","support","cloud","list","management","version","iac",{"skillNo":163,"name":164,"nameZh":17,"description":165,"descriptionZh":17,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":166,"licenseFileUrl":17,"sourceHtmlUrl":167,"categories":168,"keywords":169,"publishedAt":42},"01M6BZS7EAXHWK32RG213VE65G","run-acceptance-tests","Guide for running acceptance tests for a Terraform provider. Use this when asked to run an acceptance test or to run a test with the prefix `TestAcc`.","MPL-2.0","https:\u002F\u002Fgithub.com\u002Ftwidxuga\u002Fdotfiles\u002Fblob\u002Fmain\u002Fopencode\u002Fdot-config\u002Fopencode\u002Fskills\u002Fterraform-run-acceptance-tests\u002FSKILL.md",[],[170,171,96,91,37,38,40],"run acceptance tests","acceptance",{"skillNo":173,"name":174,"nameZh":17,"description":175,"descriptionZh":17,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":176,"categories":177,"keywords":178,"publishedAt":42},"01M6BZS4MJD31PY7M7654ZWQ56","refactor-module","Transform monolithic Terraform configurations into reusable, maintainable modules following HashiCorp's module design principles and community best practices.","https:\u002F\u002Fgithub.com\u002Ftwidxuga\u002Fdotfiles\u002Fblob\u002Fmain\u002Fopencode\u002Fdot-config\u002Fopencode\u002Fskills\u002Fterraform-refactor-module\u002FSKILL.md",[],[179,180,121,37,40,122,181],"refactor module","refactor","design"]