Skip to content

Commit

Permalink
comment out unsupported config properties
Browse files Browse the repository at this point in the history
  • Loading branch information
AgustinBettati committed Oct 21, 2024
1 parent f7e8d4c commit 8686b0b
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 22 deletions.
39 changes: 18 additions & 21 deletions tools/codegen/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,30 +9,27 @@ resources:
schema:
aliases:
group_id: project_id

ignores: ["links"]
timeouts: ["create", "update", "delete"]

overrides:
project_id:
description: "Unique 24-hexadecimal digit string that identifies your project."
plan_modifiers: [{
imports: [ "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier" ],
definition: "stringplanmodifier.RequiresReplace()"
}]
validators: [{
imports: [
"github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator",
"github.com/hashicorp/terraform-plugin-framework/path"
],
definition: "stringvalidator.ConflictsWith(path.MatchRoot(\"name\"))"
}]

prefix_path:
computability:
optional: true
computed: true
# overrides:
# project_id:
# plan_modifiers: [{
# imports: [ "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier" ],
# definition: "stringplanmodifier.RequiresReplace()"
# }]
# validators: [{
# imports: [
# "github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator",
# "github.com/hashicorp/terraform-plugin-framework/path"
# ],
# definition: "stringvalidator.ConflictsWith(path.MatchRoot(\"name\"))"
# }]

timeouts: ["create", "update", "delete"]
# prefix_path:
# computability:
# optional: true
# computed: true

search_deployment:
read:
Expand Down
6 changes: 6 additions & 0 deletions tools/codegen/schema/schema_file_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,12 @@ func TestSchemaGenerationFromCodeSpec(t *testing.T) {
Name: "test_name",
Schema: &codespec.Schema{
Attributes: []codespec.Attribute{
{
Name: "string_attr",
String: &codespec.StringAttribute{},
Description: admin.PtrString("string description"),
ComputedOptionalRequired: codespec.Required,
},
{
Name: "timeouts",
Timeouts: &codespec.TimeoutsAttribute{
Expand Down
8 changes: 7 additions & 1 deletion tools/codegen/schema/testdata/timeouts.golden.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,16 @@ import (

"github.com/hashicorp/terraform-plugin-framework-timeouts/resource/timeouts"
"github.com/hashicorp/terraform-plugin-framework/resource/schema"
"github.com/hashicorp/terraform-plugin-framework/types"
)

func ResourceSchema(ctx context.Context) schema.Schema {
return schema.Schema{
Attributes: map[string]schema.Attribute{
"string_attr": schema.StringAttribute{
Required: true,
MarkdownDescription: "string description",
},
"timeouts": timeouts.Attributes(ctx, timeouts.Opts{
Create: true,
Update: true,
Expand All @@ -20,5 +25,6 @@ func ResourceSchema(ctx context.Context) schema.Schema {
}

type TFModel struct {
Timeouts timeouts.Value `tfsdk:"timeouts"`
StringAttr types.String `tfsdk:"string_attr"`
Timeouts timeouts.Value `tfsdk:"timeouts"`
}

0 comments on commit 8686b0b

Please sign in to comment.