Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ICU-12824-Add-Boundary-version-of-the-cluster-to-the-hcp_boundary_cluster-resource-data-source #1089

Merged
merged 5 commits into from
Sep 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .changelog/1089.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:improvement
Added the `version` attribute(s) to `hcp_boundary_cluster` resource and data sources.
```
1 change: 1 addition & 0 deletions docs/data-sources/boundary_cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ If a project is not configured in the HCP Provider config block, the oldest proj
- `maintenance_window_config` (List of Object) (see [below for nested schema](#nestedatt--maintenance_window_config))
- `state` (String) The state of the Boundary cluster.
- `tier` (String) The tier of the Boundary cluster.
- `version` (String) The version of the Boundary cluster.

<a id="nestedblock--timeouts"></a>
### Nested Schema for `timeouts`
Expand Down
1 change: 1 addition & 0 deletions docs/resources/boundary_cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ If a project is not configured in the HCP Provider config block, the oldest proj
- `created_at` (String) The time that the Boundary cluster was created.
- `id` (String) The ID of this resource.
- `state` (String) The state of the Boundary cluster.
- `version` (String) The version of the Boundary cluster.

<a id="nestedblock--maintenance_window_config"></a>
### Nested Schema for `maintenance_window_config`
Expand Down
5 changes: 5 additions & 0 deletions internal/providersdkv2/data_source_boundary_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,11 @@ If a project is not configured in the HCP Provider config block, the oldest proj
},
},
},
"version": {
Description: "The version of the Boundary cluster.",
Type: schema.TypeString,
Computed: true,
},
},
}
}
Expand Down
9 changes: 9 additions & 0 deletions internal/providersdkv2/resource_boundary_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,11 @@ If a project is not configured in the HCP Provider config block, the oldest proj
},
},
},
"version": {
Description: "The version of the Boundary cluster.",
Type: schema.TypeString,
Computed: true,
},
},
}
}
Expand Down Expand Up @@ -492,6 +497,10 @@ func setBoundaryClusterResourceData(d *schema.ResourceData, cluster *boundarymod
if err := d.Set("maintenance_window_config", []interface{}{mwConfig}); err != nil {
return err
}

if err := d.Set("version", cluster.BoundaryVersion); err != nil {
return err
}
return nil
}

Expand Down
4 changes: 4 additions & 0 deletions internal/providersdkv2/resource_boundary_cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ func TestAccBoundaryCluster(t *testing.T) {
testAccCheckFullURL(boundaryClusterResourceName, "cluster_url", ""),
resource.TestCheckResourceAttrSet(boundaryClusterResourceName, "state"),
resource.TestCheckResourceAttr(boundaryClusterResourceName, "tier", "PLUS"),
resource.TestCheckResourceAttrSet(boundaryClusterResourceName, "version"),
),
},
{
Expand Down Expand Up @@ -96,6 +97,7 @@ func TestAccBoundaryCluster(t *testing.T) {
testAccCheckFullURL(boundaryClusterResourceName, "cluster_url", ""),
resource.TestCheckResourceAttrSet(boundaryClusterResourceName, "state"),
resource.TestCheckResourceAttr(boundaryClusterResourceName, "tier", "PLUS"),
resource.TestCheckResourceAttrSet(boundaryClusterResourceName, "version"),
),
},
{
Expand All @@ -108,6 +110,7 @@ func TestAccBoundaryCluster(t *testing.T) {
testAccCheckFullURL(boundaryClusterDataSourceName, "cluster_url", ""),
resource.TestCheckResourceAttrPair(boundaryClusterResourceName, "state", boundaryClusterDataSourceName, "state"),
resource.TestCheckResourceAttr(boundaryClusterResourceName, "tier", "PLUS"),
resource.TestCheckResourceAttrPair(boundaryClusterResourceName, "version", boundaryClusterDataSourceName, "version"),
),
},
{
Expand All @@ -125,6 +128,7 @@ func TestAccBoundaryCluster(t *testing.T) {
resource.TestCheckResourceAttr(boundaryClusterResourceName, "maintenance_window_config.0.day", "TUESDAY"),
resource.TestCheckResourceAttr(boundaryClusterResourceName, "maintenance_window_config.0.start", "2"),
resource.TestCheckResourceAttr(boundaryClusterResourceName, "maintenance_window_config.0.end", "12"),
resource.TestCheckResourceAttrSet(boundaryClusterResourceName, "version"),
),
},
},
Expand Down