diff --git a/docs/resources/project_role.md b/docs/resources/project_role.md index bb7e7de..c456bb0 100644 --- a/docs/resources/project_role.md +++ b/docs/resources/project_role.md @@ -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 diff --git a/internal/provider/resource/project_role_resource.go b/internal/provider/resource/project_role_resource.go index ed81941..22c3a0d 100644 --- a/internal/provider/resource/project_role_resource.go +++ b/internal/provider/resource/project_role_resource.go @@ -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" ) @@ -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",