diff --git a/examples/data-sources/biganimal_cluster/data-source.tf b/examples/data-sources/biganimal_cluster/data-source.tf index 0b10c642..8e29d8da 100644 --- a/examples/data-sources/biganimal_cluster/data-source.tf +++ b/examples/data-sources/biganimal_cluster/data-source.tf @@ -116,3 +116,7 @@ output "service_account_ids" { output "volume_snapshot_backup" { value = coalesce(data.biganimal_cluster.this.post_gis, false) } + +output "service_name" { + value = data.biganimal_cluster.this.service_name +} diff --git a/pkg/provider/data_source_cluster.go b/pkg/provider/data_source_cluster.go index 602cd4a1..fc876772 100644 --- a/pkg/provider/data_source_cluster.go +++ b/pkg/provider/data_source_cluster.go @@ -335,6 +335,24 @@ func (c *clusterDataSource) Schema(ctx context.Context, req datasource.SchemaReq "Pausing a high availability cluster shuts down all cluster nodes", Optional: true, }, + "tags": schema.SetNestedAttribute{ + Description: "Show existing tags associated with this resource", + Optional: true, + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "tag_id": schema.StringAttribute{ + Computed: true, + }, + "tag_name": schema.StringAttribute{ + Computed: true, + }, + "color": schema.StringAttribute{ + Computed: true, + }, + }, + }, + }, "transparent_data_encryption": schema.SingleNestedAttribute{ MarkdownDescription: "Transparent Data Encryption (TDE) key", Optional: true, @@ -366,6 +384,10 @@ func (c *clusterDataSource) Schema(ctx context.Context, req datasource.SchemaReq MarkdownDescription: "Transparent data encryption action.", Computed: true, }, + "service_name": schema.StringAttribute{ + MarkdownDescription: "Cluster connection service name.", + Computed: true, + }, }, } } diff --git a/pkg/provider/resource_cluster.go b/pkg/provider/resource_cluster.go index 531469ad..6b6f2f07 100644 --- a/pkg/provider/resource_cluster.go +++ b/pkg/provider/resource_cluster.go @@ -81,6 +81,7 @@ type ClusterResourceModel struct { TransparentDataEncryptionAction types.String `tfsdk:"transparent_data_encryption_action"` VolumeSnapshot types.Bool `tfsdk:"volume_snapshot_backup"` Tags []commonTerraform.Tag `tfsdk:"tags"` + ServiceName types.String `tfsdk:"service_name"` Timeouts timeouts.Value `tfsdk:"timeouts"` } @@ -569,6 +570,11 @@ func (c *clusterResource) Schema(ctx context.Context, req resource.SchemaRequest Computed: true, PlanModifiers: []planmodifier.String{plan_modifier.CustomTDEAction()}, }, + "service_name": schema.StringAttribute{ + MarkdownDescription: "Cluster connection service name.", + Computed: true, + PlanModifiers: []planmodifier.String{stringplanmodifier.UseStateForUnknown()}, + }, }, } } @@ -845,6 +851,7 @@ func readCluster(ctx context.Context, client *api.ClusterClient, tfClusterResour tfClusterResource.ReadOnlyConnections = types.BoolPointerValue(responseCluster.ReadOnlyConnections) tfClusterResource.ConnectionUri = types.StringPointerValue(&connection.PgUri) tfClusterResource.RoConnectionUri = types.StringPointerValue(&connection.ReadOnlyPgUri) + tfClusterResource.ServiceName = types.StringPointerValue(&connection.ServiceName) tfClusterResource.CspAuth = types.BoolPointerValue(responseCluster.CSPAuth) tfClusterResource.LogsUrl = responseCluster.LogsUrl tfClusterResource.MetricsUrl = responseCluster.MetricsUrl