← Back to list

new-resource
by datarobot-community
⭐ 4🍴 3📅 Jan 19, 2026
SKILL.md
name: new-resource description: Create a new Terraform resource for the DataRobot provider
Create New Terraform Resource
This skill helps you create a new Terraform resource for the DataRobot provider following established patterns.
Steps
-
Create the resource file at
pkg/provider/{resource_name}_resource.go:- Define the resource struct with
provider *Provider - Implement
resource.Resourceinterface (Metadata, Schema, Configure, Create, Read, Update, Delete) - Implement
resource.ResourceWithImportStatefor import support - Add proper MarkdownDescription for all schema attributes
- Define the resource struct with
-
Create the model file at
pkg/provider/{resource_name}_model.go:- Define the ResourceModel struct with
types.*fields - Match field names to API response/request structures
- Define the ResourceModel struct with
-
Add client service methods in
internal/client/:- Add interface methods to
service.go - Implement methods in appropriate
*_service.gofile
- Add interface methods to
-
Create tests at
pkg/provider/{resource_name}_resource_test.go:- Add TestAcc{ResourceName}Resource for acceptance tests
- Add Test{ResourceName}ResourceSchema for schema validation
-
Add example in
examples/resources/{resource_name}/:- Create
resource.tfwith usage example
- Create
-
Update documentation:
- Run
make generateto create docs - Update CHANGELOG.md
- Run
Template
package provider
import (
"context"
"fmt"
"github.com/datarobot-community/terraform-provider-datarobot/internal/client"
"github.com/hashicorp/terraform-plugin-framework/resource"
"github.com/hashicorp/terraform-plugin-framework/resource/schema"
"github.com/hashicorp/terraform-plugin-framework/types"
)
var _ resource.Resource = &{ResourceName}Resource{}
var _ resource.ResourceWithImportState = &{ResourceName}Resource{}
func New{ResourceName}Resource() resource.Resource {
return &{ResourceName}Resource{}
}
type {ResourceName}Resource struct {
provider *Provider
}
func (r *{ResourceName}Resource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
resp.TypeName = req.ProviderTypeName + "_{resource_name}"
}
Score
Total Score
60/100
Based on repository quality metrics
✓SKILL.md
SKILL.mdファイルが含まれている
+20
✓LICENSE
ライセンスが設定されている
+10
○説明文
100文字以上の説明がある
0/10
○人気
GitHub Stars 100以上
0/15
○最近の活動
3ヶ月以内に更新がある
0/10
○フォーク
10回以上フォークされている
0/5
✓Issue管理
オープンIssueが50未満
+5
✓言語
プログラミング言語が設定されている
+5
○タグ
1つ以上のタグが設定されている
0/5
Reviews
💬
Reviews coming soon