Skip to content

Data Source: azurermStorageAccount

Use this data source to access information about an existing Storage Account.

Example Usage

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 dataAzurermStorageAccountExample =
  new azurerm.dataAzurermStorageAccount.DataAzurermStorageAccount(
    this,
    "example",
    {
      name: "packerimages",
      resource_group_name: "packer-storage",
    }
  );
new cdktf.TerraformOutput(this, "storage_account_tier", {
  value: dataAzurermStorageAccountExample.accountTier,
});

Argument Reference

  • name - Specifies the name of the Storage Account
  • resourceGroupName - Specifies the name of the resource group the Storage Account is located in.

Attributes Reference

  • id - The ID of the Storage Account.

  • location - The Azure location where the Storage Account exists

  • identity - An identity block as documented below.

  • accountKind - The Kind of account.

  • accountTier - The Tier of this storage account.

  • accountReplicationType - The type of replication used for this storage account.

  • accessTier - The access tier for blobStorage accounts.

  • enableHttpsTrafficOnly - Is traffic only allowed via HTTPS? See here for more information.

  • minTlsVersion - The minimum supported TLS version for this storage account.

  • allowNestedItemsToBePublic - Can nested items in the storage account opt into allowing public access?

  • isHnsEnabled - Is Hierarchical Namespace enabled?

  • nfsv3Enabled - Is NFSv3 protocol enabled?

  • customDomain - A customDomain block as documented below.

  • tags - A mapping of tags to assigned to the resource.

  • primaryLocation - The primary location of the Storage Account.

  • secondaryLocation - The secondary location of the Storage Account.

  • primaryBlobEndpoint - The endpoint URL for blob storage in the primary location.

  • primaryBlobHost - The hostname with port if applicable for blob storage in the primary location.

  • secondaryBlobEndpoint - The endpoint URL for blob storage in the secondary location.

  • secondaryBlobHost - The hostname with port if applicable for blob storage in the secondary location.

  • primaryQueueEndpoint - The endpoint URL for queue storage in the primary location.

  • primaryQueueHost - The hostname with port if applicable for queue storage in the primary location.

  • secondaryQueueEndpoint - The endpoint URL for queue storage in the secondary location.

  • secondaryQueueHost - The hostname with port if applicable for queue storage in the secondary location.

  • primaryTableEndpoint - The endpoint URL for table storage in the primary location.

  • primaryTableHost - The hostname with port if applicable for table storage in the primary location.

  • secondaryTableEndpoint - The endpoint URL for table storage in the secondary location.

  • secondaryTableHost - The hostname with port if applicable for table storage in the secondary location.

  • primaryFileEndpoint - The endpoint URL for file storage in the primary location.

  • primaryFileHost - The hostname with port if applicable for file storage in the primary location.

  • secondaryFileEndpoint - The endpoint URL for file storage in the secondary location.

  • secondaryFileHost - The hostname with port if applicable for file storage in the secondary location.

  • primaryDfsEndpoint - The endpoint URL for DFS storage in the primary location.

  • primaryDfsHost - The hostname with port if applicable for DFS storage in the primary location.

  • secondaryDfsEndpoint - The endpoint URL for DFS storage in the secondary location.

  • secondaryDfsHost - The hostname with port if applicable for DFS storage in the secondary location.

  • primaryWebEndpoint - The endpoint URL for web storage in the primary location.

  • primaryWebHost - The hostname with port if applicable for web storage in the primary location.

  • secondaryWebEndpoint - The endpoint URL for web storage in the secondary location.

  • secondaryWebHost - The hostname with port if applicable for web storage in the secondary location.

  • primaryAccessKey - The primary access key for the Storage Account.

  • secondaryAccessKey - The secondary access key for the Storage Account.

  • primaryConnectionString - The connection string associated with the primary location

  • secondaryConnectionString - The connection string associated with the secondary location

  • primaryBlobConnectionString - The connection string associated with the primary blob location

  • secondaryBlobConnectionString - The connection string associated with the secondary blob location

\~> Note: If there's a Write Lock on the Storage Account, or the account doesn't have permission then these fields will have an empty value due to a bug in the Azure API

  • queueEncryptionKeyType - The encryption key type of the queue.

  • tableEncryptionKeyType - The encryption key type of the table.

  • infrastructureEncryptionEnabled - Is infrastructure encryption enabled? See here for more information.

  • azureFilesAuthentication - A azureFilesAuthentication block as documented below.


  • customDomain supports the following:

  • name - The Custom Domain Name used for the Storage Account.


identity supports the following:

  • type - The type of Managed Service Identity that is configured on this Storage Account

  • identityIds - A list of User Assigned Managed Identity IDs assigned with the Identity of this Storage Account.

  • principalId - The Principal ID for the Service Principal associated with the Identity of this Storage Account.

  • tenantId - The Tenant ID for the Service Principal associated with the Identity of this Storage Account.


azureFilesAuthentication supports the following:

  • directoryType - The directory service used for this Storage Account.

  • activeDirectory - An activeDirectory block as documented below.


activeDirectory supports the following:

  • domainName - The primary domain that the AD DNS server is authoritative for.

  • netbiosDomainName - The NetBIOS domain name.

  • forestName - The name of the Active Directory forest.

  • domainGuid - The domain GUID.

  • domainSid - The domain security identifier.

  • storageSid - The security identifier for Azure Storage.

Timeouts

The timeouts block allows you to specify timeouts for certain actions:

  • read - (Defaults to 5 minutes) Used when retrieving the Storage Account.