Skip to content

Commit

Permalink
Fix library variable set resource and data source schema + changes
Browse files Browse the repository at this point in the history
  • Loading branch information
IsaacCalligeros95 committed Aug 15, 2024
1 parent 14cdf76 commit bfdd443
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
10 changes: 9 additions & 1 deletion octopusdeploy_framework/schemas/library_variable_set.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ import (
"github.com/hashicorp/terraform-plugin-framework/attr"
datasourceSchema "github.com/hashicorp/terraform-plugin-framework/datasource/schema"
resourceSchema "github.com/hashicorp/terraform-plugin-framework/resource/schema"
"github.com/hashicorp/terraform-plugin-framework/resource/schema/mapplanmodifier"
"github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier"
"github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier"
types "github.com/hashicorp/terraform-plugin-framework/types"
)

Expand Down Expand Up @@ -93,10 +96,15 @@ func GetLibraryVariableSetResourceSchema() resourceSchema.Schema {
"template_ids": resourceSchema.MapAttribute{
ElementType: types.StringType,
Computed: true,
Optional: true,
PlanModifiers: []planmodifier.Map{
mapplanmodifier.UseStateForUnknown(),
},
},
"variable_set_id": resourceSchema.StringAttribute{
Computed: true,
PlanModifiers: []planmodifier.String{
stringplanmodifier.UseStateForUnknown(),
},
},
},
Description: "This resource manages library variable sets in Octopus Deploy.",
Expand Down
8 changes: 8 additions & 0 deletions octopusdeploy_framework/schemas/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ package schemas

import (
"fmt"
"github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier"
"github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier"

"github.com/hashicorp/terraform-plugin-framework/resource/schema/booldefault"
"github.com/hashicorp/terraform-plugin-framework/resource/schema/stringdefault"
Expand Down Expand Up @@ -145,6 +147,9 @@ func GetIdResourceSchema() resourceSchema.Attribute {
Description: "The unique ID for this resource.",
Computed: true,
Optional: true,
PlanModifiers: []planmodifier.String{
stringplanmodifier.UseStateForUnknown(),
},
}
}

Expand All @@ -153,6 +158,9 @@ func GetSpaceIdResourceSchema(resourceDescription string) resourceSchema.Attribu
Description: "The space ID associated with this " + resourceDescription + ".",
Computed: true,
Optional: true,
PlanModifiers: []planmodifier.String{
stringplanmodifier.UseStateForUnknown(),
},
}
}

Expand Down

0 comments on commit bfdd443

Please sign in to comment.