diff --git a/docs/data-sources/pgd.md b/docs/data-sources/pgd.md index 788d9db5..83ef26c4 100644 --- a/docs/data-sources/pgd.md +++ b/docs/data-sources/pgd.md @@ -33,6 +33,10 @@ output "data_groups" { output "witness_groups" { value = data.biganimal_pgd.this.witness_groups } + +output "ro_connection_uri" { + value = data.biganimal_cluster.this.ro_connection_uri +} ``` ## PGD Data Source Example @@ -98,6 +102,7 @@ terraform { - `data_groups` (Attributes Set) Cluster data groups. (see [below for nested schema](#nestedatt--data_groups)) - `id` (String) The ID of this resource. - `witness_groups` (Attributes Set) (see [below for nested schema](#nestedatt--witness_groups)) +- `ro_connection_uri` (String) PGD Cluster read-only connection URI. Only available for high availability clusters. ### Nested Schema for `data_groups` diff --git a/docs/resources/pgd.md b/docs/resources/pgd.md index d3134269..eb8c0d4c 100644 --- a/docs/resources/pgd.md +++ b/docs/resources/pgd.md @@ -1714,6 +1714,7 @@ Read-Only: - `metrics_url` (String) The URL to find the metrics of this cluster. - `phase` (String) Current phase of the data group. - `resizing_pvc` (Set of String) Resizing PVC. +- `ro_connection_uri` (String) Cluster read-only connection URI. Only available for high availability clusters. ### Nested Schema for `data_groups.cloud_provider` diff --git a/pkg/models/pgd/api/data_group.go b/pkg/models/pgd/api/data_group.go index 2eddca0f..39b57444 100644 --- a/pkg/models/pgd/api/data_group.go +++ b/pkg/models/pgd/api/data_group.go @@ -28,4 +28,5 @@ type DataGroup struct { MaintenanceWindow *models.MaintenanceWindow `json:"maintenanceWindow,omitempty"` ServiceAccountIds *[]string `json:"serviceAccountIds,omitempty"` PeAllowedPrincipalIds *[]string `json:"peAllowedPrincipalIds,omitempty"` + RoConnectionUri *string `json:"roConnectionUri,omitempty"` } diff --git a/pkg/models/pgd/terraform/data_group.go b/pkg/models/pgd/terraform/data_group.go index 52acdfc9..d7567846 100644 --- a/pkg/models/pgd/terraform/data_group.go +++ b/pkg/models/pgd/terraform/data_group.go @@ -31,4 +31,5 @@ type DataGroup struct { MaintenanceWindow *models.MaintenanceWindow `tfsdk:"maintenance_window"` ServiceAccountIds types.Set `tfsdk:"service_account_ids"` PeAllowedPrincipalIds types.Set `tfsdk:"pe_allowed_principal_ids"` + RoConnectionUri types.String `tfsdk:"ro_connection_uri"` } diff --git a/pkg/provider/data_source_pgd.go b/pkg/provider/data_source_pgd.go index a14d83b8..6b4c8f49 100644 --- a/pkg/provider/data_source_pgd.go +++ b/pkg/provider/data_source_pgd.go @@ -275,6 +275,11 @@ func (p pgdDataSource) Schema(ctx context.Context, req datasource.SchemaRequest, Computed: true, ElementType: types.StringType, }, + "ro_connection_uri": schema.SetAttribute{ + Description: "Read-only connection URI.", + Computed: true, + ElementType: types.StringType, + }, }, }, }, diff --git a/pkg/provider/resource_pgd.go b/pkg/provider/resource_pgd.go index 156d7403..d0fed59b 100644 --- a/pkg/provider/resource_pgd.go +++ b/pkg/provider/resource_pgd.go @@ -331,6 +331,11 @@ func PgdSchema(ctx context.Context) schema.Schema { }, }, }, + "ro_connection_uri": schema.StringAttribute{ + MarkdownDescription: "Cluster read-only connection URI. Only available for high availability clusters.", + Computed: true, + PlanModifiers: []planmodifier.String{plan_modifier.CustomConnection()}, + }, "instance_type": schema.SingleNestedAttribute{ Description: "Instance type.", Required: true, @@ -1368,6 +1373,7 @@ func buildTFGroupsAs(ctx context.Context, diags *diag.Diagnostics, state tfsdk.S MaintenanceWindow: apiDgModel.MaintenanceWindow, ServiceAccountIds: types.SetValueMust(types.StringType, serviceAccIds), PeAllowedPrincipalIds: types.SetValueMust(types.StringType, principalIds), + RoConnectionUri: types.StringPointerValue(apiDgModel.RoConnectionUri), } outPgdTFResource.DataGroups = append(outPgdTFResource.DataGroups, tfDGModel)