Skip to content

Commit

Permalink
add float64 id attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
mschuchard committed Aug 7, 2024
1 parent fbe39e6 commit 06c0035
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions internal/id_schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package util

import (
"github.com/hashicorp/terraform-plugin-framework/resource/schema"
"github.com/hashicorp/terraform-plugin-framework/resource/schema/float64planmodifier"
"github.com/hashicorp/terraform-plugin-framework/resource/schema/int64planmodifier"
"github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier"
"github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier"
Expand All @@ -26,3 +27,13 @@ func IDInt64Attribute() schema.Int64Attribute {
},
}
}

func IDFloat64Attribute() schema.Float64Attribute {
return schema.Float64Attribute{
Computed: true,
Description: "Aliased to number input parameter(s) for efficiency and proper plan diff detection.",
PlanModifiers: []planmodifier.Float64{
float64planmodifier.UseStateForUnknown(),
},
}
}

0 comments on commit 06c0035

Please sign in to comment.