Data Source: azurermUserAssignedIdentity
Use this data source to access information about an existing User Assigned Identity.
Example Usage (reference an existing)
import * as cdktf from "cdktf";
/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as azurerm from "./.gen/providers/azurerm";
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: azurerm.
For a more precise conversion please use the --provider flag in convert.*/
const dataAzurermUserAssignedIdentityExample =
new azurerm.dataAzurermUserAssignedIdentity.DataAzurermUserAssignedIdentity(
this,
"example",
{
name: "name_of_user_assigned_identity",
resource_group_name: "name_of_resource_group",
}
);
new cdktf.TerraformOutput(this, "uai_client_id", {
value: dataAzurermUserAssignedIdentityExample.clientId,
});
new cdktf.TerraformOutput(this, "uai_principal_id", {
value: dataAzurermUserAssignedIdentityExample.principalId,
});
new cdktf.TerraformOutput(this, "uai_tenant_id", {
value: dataAzurermUserAssignedIdentityExample.tenantId,
});
Argument Reference
name
- The name of the User Assigned Identity.resourceGroupName
- The name of the Resource Group in which the User Assigned Identity exists.
Attributes Reference
The following attributes are exported:
id
- The ID of the User Assigned Identity.location
- The Azure location where the User Assigned Identity exists.principalId
- The Service Principal ID of the User Assigned Identity.clientId
- The Client ID of the User Assigned Identity.tenantId
- The Tenant ID of the User Assigned Identity.tags
- A mapping of tags assigned to the User Assigned Identity.
Timeouts
The timeouts
block allows you to specify timeouts for certain actions:
read
- (Defaults to 5 minutes) Used when retrieving the User Assigned Identity.