From da08b9411fd6fe6b11a5157f84d1278f35de8ba8 Mon Sep 17 00:00:00 2001 From: Bryan Sakowski Date: Wed, 30 Oct 2019 11:00:52 -0500 Subject: [PATCH] Update SQL Server docs for identity block --- website/docs/d/sql_server.html.markdown | 12 ++++++++++++ website/docs/r/sql_server.html.markdown | 20 ++++++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/website/docs/d/sql_server.html.markdown b/website/docs/d/sql_server.html.markdown index a3bfffc0f469..3152d3493b7e 100644 --- a/website/docs/d/sql_server.html.markdown +++ b/website/docs/d/sql_server.html.markdown @@ -39,4 +39,16 @@ output "sql_server_id" { * `administrator_login` - The administrator username of the SQL Server. +* `identity` - An `identity` block as defined below. + * `tags` - A mapping of tags assigned to the resource. + +--- + +An `identity` block exports the following: + +* `principal_id` - The ID of the Principal (Client) in Azure Active Directory. + +* `tenant_id` - The ID of the Azure Active Directory Tenant. + +* `type` - The identity type of the SQL Server. diff --git a/website/docs/r/sql_server.html.markdown b/website/docs/r/sql_server.html.markdown index 667ab98af211..238d2b3b8bfa 100644 --- a/website/docs/r/sql_server.html.markdown +++ b/website/docs/r/sql_server.html.markdown @@ -51,8 +51,18 @@ The following arguments are supported: * `administrator_login_password` - (Required) The password associated with the `administrator_login` user. Needs to comply with Azure's [Password Policy](https://msdn.microsoft.com/library/ms161959.aspx) +* `identity` - (Optional) An `identity` block as defined below. + * `tags` - (Optional) A mapping of tags to assign to the resource. +--- + +An `identity` block supports the following: + +* `type` - (Required) Specifies the identity type of the SQL Server. At this time the only allowed value is `SystemAssigned`. + +~> **NOTE:** The assigned `principal_id` and `tenant_id` can be retrieved after the identity `type` has been set to `SystemAssigned` and the SQL Server has been created. More details are available below. + ## Attributes Reference The following attributes are exported: @@ -60,6 +70,16 @@ The following attributes are exported: * `id` - The SQL Server ID. * `fully_qualified_domain_name` - The fully qualified domain name of the Azure SQL Server (e.g. myServerName.database.windows.net) +--- + +`identity` exports the following: + +* `principal_id` - The Principal ID for the Service Principal associated with the Identity of this SQL Server. + +* `tenant_id` - The Tenant ID for the Service Principal associated with the Identity of this SQL Server. + +-> You can access the Principal ID via `${azurerm_sql_server.test.identity.0.principal_id}` and the Tenant ID via `${azurerm_sql_server.test.identity.0.tenant_id}` + ## Import SQL Servers can be imported using the `resource id`, e.g.