terraform 配置中密钥 属性 的用途是什么

What is the use of key property in terrform config

在这个声明中,key字段有什么用?我们可以给任何我们喜欢的价值吗?

terraform {   backend "azurerm" {
    resource_group_name  = "StorageAccount-ResourceGroup"
    storage_account_name = "abcd1234"
    container_name       = "tfstate"
    key                  = "prod.terraform.tfstate"   } }

Key 参数将 Terraform state file name 作为 Blob 存储帐户中 Blob 容器中的 Blob。

无论您将哪个名称分配给 Key,TF 状态 blob 都将使用该名称创建。

详细解释可以参考documentation.