Skip to content

Commit

Permalink
all: Migrate tfsdk RequiresReplace and UseStateForUnknown to resource…
Browse files Browse the repository at this point in the history
… package (#83)

Reference: hashicorp/terraform-plugin-framework#434

Updated via:

```shell
go get github.com/hashicorp/terraform-plugin-framework@51b944f8a359e8ca29efc8d22c6843a7deedfad9
go mod tidy
```
  • Loading branch information
bflad committed Aug 2, 2022
1 parent 60a6d8a commit 83884bd
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.17

require (
github.com/hashicorp/go-memdb v1.3.3
github.com/hashicorp/terraform-plugin-framework v0.10.1-0.20220802131049-3b0c5196c215
github.com/hashicorp/terraform-plugin-framework v0.10.1-0.20220802150237-51b944f8a359
github.com/hashicorp/terraform-plugin-go v0.13.0
github.com/hashicorp/terraform-plugin-mux v0.7.0
github.com/hashicorp/terraform-plugin-sdk/v2 v2.20.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@ github.com/hashicorp/terraform-exec v0.17.2 h1:EU7i3Fh7vDUI9nNRdMATCEfnm9axzTnad
github.com/hashicorp/terraform-exec v0.17.2/go.mod h1:tuIbsL2l4MlwwIZx9HPM+LOV9vVyEfBYu2GsO1uH3/8=
github.com/hashicorp/terraform-json v0.14.0 h1:sh9iZ1Y8IFJLx+xQiKHGud6/TSUCM0N8e17dKDpqV7s=
github.com/hashicorp/terraform-json v0.14.0/go.mod h1:5A9HIWPkk4e5aeeXIBbkcOvaZbIYnAIkEyqP2pNSckM=
github.com/hashicorp/terraform-plugin-framework v0.10.1-0.20220802131049-3b0c5196c215 h1:0V4c3u745nRahUAEEHBzOUDwXpPLEELOR0ELu5ELq24=
github.com/hashicorp/terraform-plugin-framework v0.10.1-0.20220802131049-3b0c5196c215/go.mod h1:mfVAo3qMZ6LmK0y02rhDJNLUhP957OmwGuumNKz5qDQ=
github.com/hashicorp/terraform-plugin-framework v0.10.1-0.20220802150237-51b944f8a359 h1:+BV3Y2pi1OH6PHVwPrnRjpmzZLecW1O7935pnLgiTS0=
github.com/hashicorp/terraform-plugin-framework v0.10.1-0.20220802150237-51b944f8a359/go.mod h1:mfVAo3qMZ6LmK0y02rhDJNLUhP957OmwGuumNKz5qDQ=
github.com/hashicorp/terraform-plugin-go v0.12.0/go.mod h1:kwhmaWHNDvT1B3QiSJdAtrB/D4RaKSY/v3r2BuoWK4M=
github.com/hashicorp/terraform-plugin-go v0.13.0 h1:Zm+o91HUOcTLotaEu3X2jV/6wNi6f09gkZwGg/MDvCk=
github.com/hashicorp/terraform-plugin-go v0.13.0/go.mod h1:NYGFEM9GeRdSl52txue3RcBDFt2tufaqS22iURP8Bxs=
Expand Down
6 changes: 3 additions & 3 deletions internal/framework5provider/resource_user.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func (r resourceUserType) GetSchema(_ context.Context) (tfsdk.Schema, diag.Diagn
"email": {
Type: types.StringType,
Required: true,
PlanModifiers: []tfsdk.AttributePlanModifier{tfsdk.RequiresReplace()},
PlanModifiers: []tfsdk.AttributePlanModifier{resource.RequiresReplace()},
},
"name": {
Type: types.StringType,
Expand All @@ -39,15 +39,15 @@ func (r resourceUserType) GetSchema(_ context.Context) (tfsdk.Schema, diag.Diagn
Type: types.StringType,
Computed: true,
PlanModifiers: []tfsdk.AttributePlanModifier{
tfsdk.UseStateForUnknown(),
resource.UseStateForUnknown(),
},
},
"language": {
Type: types.StringType,
Optional: true,
Computed: true,
PlanModifiers: []tfsdk.AttributePlanModifier{
tfsdk.UseStateForUnknown(),
resource.UseStateForUnknown(),
},
},
},
Expand Down
6 changes: 3 additions & 3 deletions internal/framework6provider/resource_user.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func (r resourceUserType) GetSchema(_ context.Context) (tfsdk.Schema, diag.Diagn
"email": {
Type: types.StringType,
Required: true,
PlanModifiers: []tfsdk.AttributePlanModifier{tfsdk.RequiresReplace()},
PlanModifiers: []tfsdk.AttributePlanModifier{resource.RequiresReplace()},
},
"name": {
Type: types.StringType,
Expand All @@ -39,15 +39,15 @@ func (r resourceUserType) GetSchema(_ context.Context) (tfsdk.Schema, diag.Diagn
Type: types.StringType,
Computed: true,
PlanModifiers: []tfsdk.AttributePlanModifier{
tfsdk.UseStateForUnknown(),
resource.UseStateForUnknown(),
},
},
"language": {
Type: types.StringType,
Optional: true,
Computed: true,
PlanModifiers: []tfsdk.AttributePlanModifier{
tfsdk.UseStateForUnknown(),
resource.UseStateForUnknown(),
},
},
},
Expand Down
6 changes: 3 additions & 3 deletions internal/tf6muxprovider/provider1/resource_user.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func (r resourceUserType) GetSchema(_ context.Context) (tfsdk.Schema, diag.Diagn
"email": {
Type: types.StringType,
Required: true,
PlanModifiers: []tfsdk.AttributePlanModifier{tfsdk.RequiresReplace()},
PlanModifiers: []tfsdk.AttributePlanModifier{resource.RequiresReplace()},
},
"name": {
Type: types.StringType,
Expand All @@ -39,15 +39,15 @@ func (r resourceUserType) GetSchema(_ context.Context) (tfsdk.Schema, diag.Diagn
Type: types.StringType,
Computed: true,
PlanModifiers: []tfsdk.AttributePlanModifier{
tfsdk.UseStateForUnknown(),
resource.UseStateForUnknown(),
},
},
"language": {
Type: types.StringType,
Optional: true,
Computed: true,
PlanModifiers: []tfsdk.AttributePlanModifier{
tfsdk.UseStateForUnknown(),
resource.UseStateForUnknown(),
},
},
},
Expand Down
6 changes: 3 additions & 3 deletions internal/tf6muxprovider/provider2/resource_user.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func (r resourceUserType) GetSchema(_ context.Context) (tfsdk.Schema, diag.Diagn
"email": {
Type: types.StringType,
Required: true,
PlanModifiers: []tfsdk.AttributePlanModifier{tfsdk.RequiresReplace()},
PlanModifiers: []tfsdk.AttributePlanModifier{resource.RequiresReplace()},
},
"name": {
Type: types.StringType,
Expand All @@ -39,15 +39,15 @@ func (r resourceUserType) GetSchema(_ context.Context) (tfsdk.Schema, diag.Diagn
Type: types.StringType,
Computed: true,
PlanModifiers: []tfsdk.AttributePlanModifier{
tfsdk.UseStateForUnknown(),
resource.UseStateForUnknown(),
},
},
"language": {
Type: types.StringType,
Optional: true,
Computed: true,
PlanModifiers: []tfsdk.AttributePlanModifier{
tfsdk.UseStateForUnknown(),
resource.UseStateForUnknown(),
},
},
},
Expand Down
6 changes: 3 additions & 3 deletions internal/tf6to5provider/provider/resource_user.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func (r resourceUserType) GetSchema(_ context.Context) (tfsdk.Schema, diag.Diagn
"email": {
Type: types.StringType,
Required: true,
PlanModifiers: []tfsdk.AttributePlanModifier{tfsdk.RequiresReplace()},
PlanModifiers: []tfsdk.AttributePlanModifier{resource.RequiresReplace()},
},
"name": {
Type: types.StringType,
Expand All @@ -39,15 +39,15 @@ func (r resourceUserType) GetSchema(_ context.Context) (tfsdk.Schema, diag.Diagn
Type: types.StringType,
Computed: true,
PlanModifiers: []tfsdk.AttributePlanModifier{
tfsdk.UseStateForUnknown(),
resource.UseStateForUnknown(),
},
},
"language": {
Type: types.StringType,
Optional: true,
Computed: true,
PlanModifiers: []tfsdk.AttributePlanModifier{
tfsdk.UseStateForUnknown(),
resource.UseStateForUnknown(),
},
},
},
Expand Down

0 comments on commit 83884bd

Please sign in to comment.