从 Azure 文件共享获取访问密钥 - Terraform

doc*_*oob 4 azure terraform terraform-provider-azure

我正在尝试按照此示例创建一个azure file share直通通道,但是我想为此获取. 我如何得到它,对此的任何帮助将不胜感激。terraformAccess Keystorage account

Ami*_*nes 9

azurerm_storage_share由于此属性未公开,因此您无法获取访问密钥。您需要access key从获取azurerm_storage_account.

代码片段:

data "azurerm_storage_account" "example" {
  name                = "packerimages"
  resource_group_name = "packer-storage"
}

output "storage_account_primary_access_key" {
  value = data.azurerm_storage_account.example.primary_access_key
}
Run Code Online (Sandbox Code Playgroud)

另外,在每个组件下,您可以找到在Attributes Reference.

更多信息可以在这里找到。