Skip to content

Commit

Permalink
Remove retention policy from project group
Browse files Browse the repository at this point in the history
  • Loading branch information
IsaacCalligeros95 committed Aug 16, 2024
1 parent 9f27509 commit ccf1d36
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 28 deletions.
1 change: 0 additions & 1 deletion docs/data-sources/project_groups.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ Optional:

- `description` (String) The description of this project group.
- `id` (String) The unique ID for this resource.
- `retention_policy_id` (String) The ID of the retention policy associated with this project group.
- `space_id` (String) The space ID associated with this project group.

Read-Only:
Expand Down
1 change: 0 additions & 1 deletion docs/resources/project_group.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ resource "octopusdeploy_project_group" "example" {

- `description` (String) The description of this project group.
- `id` (String) The unique ID for this resource.
- `retention_policy_id` (String) The ID of the retention policy associated with this project group.
- `space_id` (String) The space ID associated with this project group.

## Import
Expand Down
9 changes: 4 additions & 5 deletions octopusdeploy_framework/datasource_project_groups.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,10 @@ func NewProjectGroupsDataSource() datasource.DataSource {

func getNestedGroupAttributes() map[string]attr.Type {
return map[string]attr.Type{
"id": types.StringType,
"space_id": types.StringType,
"name": types.StringType,
"retention_policy_id": types.StringType,
"description": types.StringType,
"id": types.StringType,
"space_id": types.StringType,
"name": types.StringType,
"description": types.StringType,
}
}

Expand Down
27 changes: 6 additions & 21 deletions octopusdeploy_framework/schemas/project_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,40 +4,25 @@ import (
"github.com/OctopusDeploy/terraform-provider-octopusdeploy/octopusdeploy_framework/util"
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/planmodifier"
"github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier"
"github.com/hashicorp/terraform-plugin-framework/types"
)

const projectGroupDescription = "project group"

func GetProjectGroupDatasourceSchema() map[string]datasourceSchema.Attribute {
return map[string]datasourceSchema.Attribute{
"id": util.GetIdResourceSchema(),
"space_id": util.GetSpaceIdResourceSchema(projectGroupDescription),
"name": GetReadonlyNameDatasourceSchema(),
"retention_policy_id": datasourceSchema.StringAttribute{
Computed: true,
Optional: true,
Description: "The ID of the retention policy associated with this project group.",
},
"id": util.GetIdResourceSchema(),
"space_id": util.GetSpaceIdResourceSchema(projectGroupDescription),
"name": GetReadonlyNameDatasourceSchema(),
"description": util.GetDescriptionResourceSchema(projectGroupDescription),
}
}

func GetProjectGroupResourceSchema() map[string]resourceSchema.Attribute {
return map[string]resourceSchema.Attribute{
"id": util.GetIdResourceSchema(),
"space_id": util.GetSpaceIdResourceSchema(projectGroupDescription),
"name": util.GetNameResourceSchema(true),
"retention_policy_id": resourceSchema.StringAttribute{
Computed: true,
Optional: true,
Description: "The ID of the retention policy associated with this project group.",
PlanModifiers: []planmodifier.String{
stringplanmodifier.UseStateForUnknown(),
},
},
"id": util.GetIdResourceSchema(),
"space_id": util.GetSpaceIdResourceSchema(projectGroupDescription),
"name": util.GetNameResourceSchema(true),
"description": util.GetDescriptionResourceSchema(projectGroupDescription),
}
}
Expand Down

0 comments on commit ccf1d36

Please sign in to comment.