diff --git a/azurerm/internal/services/postgres/postgresql_server_data_source.go b/azurerm/internal/services/postgres/postgresql_server_data_source.go index 859ccebd7d9f..1fec26075e60 100644 --- a/azurerm/internal/services/postgres/postgresql_server_data_source.go +++ b/azurerm/internal/services/postgres/postgresql_server_data_source.go @@ -48,6 +48,11 @@ func dataSourcePostgreSqlServer() *schema.Resource { Computed: true, }, + "sku_name": { + Type: schema.TypeString, + Computed: true, + }, + "tags": tags.SchemaDataSource(), }, } @@ -86,5 +91,9 @@ func dataSourceArmPostgreSqlServerRead(d *schema.ResourceData, meta interface{}) d.Set("administrator_login", props.AdministratorLogin) } + if sku := resp.Sku; sku != nil { + d.Set("sku_name", sku.Name) + } + return tags.FlattenAndSet(d, resp.Tags) } diff --git a/azurerm/internal/services/postgres/tests/postgresql_server_data_source_test.go b/azurerm/internal/services/postgres/tests/postgresql_server_data_source_test.go index b221ba0631cc..a29a03c88ebb 100644 --- a/azurerm/internal/services/postgres/tests/postgresql_server_data_source_test.go +++ b/azurerm/internal/services/postgres/tests/postgresql_server_data_source_test.go @@ -25,6 +25,7 @@ func TestAccDataSourceAzureRMPPostgreSqlServer_basic(t *testing.T) { resource.TestCheckResourceAttrSet(data.ResourceName, "fqdn"), resource.TestCheckResourceAttrSet(data.ResourceName, "version"), resource.TestCheckResourceAttrSet(data.ResourceName, "administrator_login"), + resource.TestCheckResourceAttrSet(data.ResourceName, "sku_name"), resource.TestCheckResourceAttr(data.ResourceName, "tags.%", "0"), ), }, diff --git a/website/docs/d/postgresql_server.html.markdown b/website/docs/d/postgresql_server.html.markdown index 0f391127ba8a..be8059d7b2bb 100644 --- a/website/docs/d/postgresql_server.html.markdown +++ b/website/docs/d/postgresql_server.html.markdown @@ -39,6 +39,8 @@ output "postgresql_server_id" { * `administrator_login` - The administrator username of the PostgreSQL Server. +* `sku_name` - The SKU name of the PostgreSQL Server. + * `tags` - A mapping of tags assigned to the resource. ## Timeouts