gpt4 book ai didi

azure - Terraform Azure 提供程序 - 容器的 Azure 公共(public)访问级别

转载 作者:行者123 更新时间:2023-12-03 00:01:46 26 4
gpt4 key购买 nike

我尝试将container_access_type值从“private”更改,但我不断收到错误消息。

我可以从 Azure UI 执行此操作。 Terraform 代码中可能缺少某些内容。

请帮忙,谢谢。

provider "azurerm" {
version = "=2.25.0"
features {}
}

resource "azurerm_resource_group" "storage" {
name = "tfstorageresourcegroup"
location = "North Europe"
}

resource "azurerm_storage_account" "account" {
name = "${azurerm_resource_group.storage.name}"
location = "${azurerm_resource_group.storage.location}"
account_tier = "Standard"
resource_group_name = "${azurerm_resource_group.storage.name}"
account_replication_type = "LRS"
enable_https_traffic_only = true
allow_blob_public_access = true
}


resource "azurerm_storage_container" "container" {
name = "tftestcontainer"
storage_account_name = "${azurerm_storage_account.account.name}"
container_access_type = "container"
}

resource "azurerm_storage_blob" "blob" {
name = "tftestblob"
storage_account_name = "${azurerm_storage_account.account.name}"
storage_container_name = "${azurerm_storage_container.container.name}"
type = "Page"
size = "5120"
}

Error: Error updating the Access Control for Container“tftestcontainer” (Storage Account “tfstorageresourcegroup” / ResourceGroup “tfstorageresourcegroup”): containers.Client#SetAccessControl:Failure sending request: StatusCode=409 – Original Error:autorest/azure: Service returned an error. Status=Code=“PublicAccessNotPermitted” Message=“Public access is notpermitted on this storageaccount.\nRequestId:80d021ca-501e-009f-4aa6-86a404000000\nTime:2020-09-09T12:38:47.5769058Z”

最佳答案

我在使用 terraform 创建 azure 基础设施时遇到了同样的错误。

我编辑的目的是:

  container_access_type = "private"

内部:

    resource "azurerm_storage_container" "container" {
...
...
...
}

ma​​in.tf文件中。

关于azure - Terraform Azure 提供程序 - 容器的 Azure 公共(public)访问级别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63825315/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com