Force resource replacement on scope change (#66960)

This commit is contained in:
Hugo Shaka
2026-05-22 21:43:42 +00:00
committed by GitHub
parent 9443943375
commit 57ee7542c8
6 changed files with 18 additions and 9 deletions
@@ -54,6 +54,8 @@ plan_modifiers:
# Force to recreate resource if its name changes
Metadata.name:
- "github.com/hashicorp/terraform-plugin-framework/tfsdk.RequiresReplace()"
ScopedRole.scope:
- "github.com/hashicorp/terraform-plugin-framework/tfsdk.RequiresReplace()"
# This must be defined for the generator to be happy, but in reality all time
# fields are overridden (because the protobuf timestamps contain locks and the
@@ -55,6 +55,8 @@ plan_modifiers:
# Force to recreate resource if its name changes
Metadata.name:
- "github.com/hashicorp/terraform-plugin-framework/tfsdk.RequiresReplace()"
ScopedRoleAssignment.scope:
- "github.com/hashicorp/terraform-plugin-framework/tfsdk.RequiresReplace()"
# This must be defined for the generator to be happy, but in reality all time
# fields are overridden (because the protobuf timestamps contain locks and the
@@ -59,6 +59,8 @@ plan_modifiers:
# Force to recreate resource if its name changes
Metadata.name:
- "github.com/hashicorp/terraform-plugin-framework/tfsdk.RequiresReplace()"
ScopedToken.scope:
- "github.com/hashicorp/terraform-plugin-framework/tfsdk.RequiresReplace()"
# This must be defined for the generator to be happy, but in reality all time
# fields are overridden (because the protobuf timestamps contain locks and the
@@ -101,9 +101,10 @@ func GenSchemaScopedRoleAssignment(ctx context.Context) (github_com_hashicorp_te
Required: true,
},
"scope": {
Description: "Scope is the scope of the role assignment resource.",
Required: true,
Type: github_com_hashicorp_terraform_plugin_framework_types.StringType,
Description: "Scope is the scope of the role assignment resource.",
PlanModifiers: []github_com_hashicorp_terraform_plugin_framework_tfsdk.AttributePlanModifier{github_com_hashicorp_terraform_plugin_framework_tfsdk.RequiresReplace()},
Required: true,
Type: github_com_hashicorp_terraform_plugin_framework_types.StringType,
},
"spec": {
Attributes: github_com_hashicorp_terraform_plugin_framework_tfsdk.SingleNestedAttributes(map[string]github_com_hashicorp_terraform_plugin_framework_tfsdk.Attribute{
@@ -103,9 +103,10 @@ func GenSchemaScopedRole(ctx context.Context) (github_com_hashicorp_terraform_pl
Required: true,
},
"scope": {
Description: "Scope is the scope of the role resource.",
Required: true,
Type: github_com_hashicorp_terraform_plugin_framework_types.StringType,
Description: "Scope is the scope of the role resource.",
PlanModifiers: []github_com_hashicorp_terraform_plugin_framework_tfsdk.AttributePlanModifier{github_com_hashicorp_terraform_plugin_framework_tfsdk.RequiresReplace()},
Required: true,
Type: github_com_hashicorp_terraform_plugin_framework_types.StringType,
},
"spec": {
Attributes: github_com_hashicorp_terraform_plugin_framework_tfsdk.SingleNestedAttributes(map[string]github_com_hashicorp_terraform_plugin_framework_tfsdk.Attribute{
@@ -102,9 +102,10 @@ func GenSchemaScopedToken(ctx context.Context) (github_com_hashicorp_terraform_p
Required: true,
},
"scope": {
Description: "Scope is the scope of the token resource.",
Required: true,
Type: github_com_hashicorp_terraform_plugin_framework_types.StringType,
Description: "Scope is the scope of the token resource.",
PlanModifiers: []github_com_hashicorp_terraform_plugin_framework_tfsdk.AttributePlanModifier{github_com_hashicorp_terraform_plugin_framework_tfsdk.RequiresReplace()},
Required: true,
Type: github_com_hashicorp_terraform_plugin_framework_types.StringType,
},
"spec": {
Attributes: github_com_hashicorp_terraform_plugin_framework_tfsdk.SingleNestedAttributes(map[string]github_com_hashicorp_terraform_plugin_framework_tfsdk.Attribute{