Skip to content

Commit

Permalink
Merge pull request #53 from Infisical/daniel/fix-project-role-resource
Browse files Browse the repository at this point in the history
fix(project-role-resource): infinite drift on project role description
  • Loading branch information
DanielHougaard authored Sep 16, 2024
2 parents 5e56ae8 + 02cea11 commit bcf45d8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/resources/project_role.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ resource "infisical_project_role" "biller" {

### Optional

- `description` (String) The description for the new role
- `description` (String) The description for the new role. Defaults to an empty string.

### Read-Only

Expand Down
5 changes: 4 additions & 1 deletion internal/provider/resource/project_role_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"github.com/hashicorp/terraform-plugin-framework/resource"
"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/stringdefault"
"github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier"
"github.com/hashicorp/terraform-plugin-framework/types"
)
Expand Down Expand Up @@ -71,8 +72,10 @@ func (r *projectRoleResource) Schema(_ context.Context, _ resource.SchemaRequest
Required: true,
},
"description": schema.StringAttribute{
Description: "The description for the new role",
Description: "The description for the new role. Defaults to an empty string.",
Optional: true,
Computed: true,
Default: stringdefault.StaticString(""),
},
"project_slug": schema.StringAttribute{
Description: "The slug of the project to create role",
Expand Down

0 comments on commit bcf45d8

Please sign in to comment.