Skip to content

Commit

Permalink
fix: update IDAttribute to resource schema
Browse files Browse the repository at this point in the history
  • Loading branch information
jar-b committed Dec 2, 2022
1 parent eb33c59 commit 7e8cfed
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions internal/framework/id_attribute.go
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
package framework

import (
"github.com/hashicorp/terraform-plugin-framework/resource"
"github.com/hashicorp/terraform-plugin-framework/tfsdk"
"github.com/hashicorp/terraform-plugin-framework/types"
"github.com/hashicorp/terraform-plugin-framework/resource/schema"
"github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier"
"github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier"
)

// TODO: migrate to schema.Attribute flavors
func IDAttribute() tfsdk.Attribute {
return tfsdk.Attribute{
Type: types.StringType,
func IDAttribute() schema.StringAttribute {
return schema.StringAttribute{
Computed: true,
PlanModifiers: []tfsdk.AttributePlanModifier{
resource.UseStateForUnknown(),
PlanModifiers: []planmodifier.String{
stringplanmodifier.UseStateForUnknown(),
},
}
}

0 comments on commit 7e8cfed

Please sign in to comment.