2

Let's assume this simple example of creating shared file storage on Azure using Terraform and azurerm provider.

resource "azurerm_resource_group" "example" {
  name     = "azuretest"
  location = "West Europe"
}

resource "azurerm_storage_account" "example" {
  name                     = "azureteststorage"
  resource_group_name      = azurerm_resource_group.example.name
  location                 = azurerm_resource_group.example.location
  account_tier             = "Standard"
  account_replication_type = "LRS"
}

resource "azurerm_storage_share" "example" {
  name                 = "sharename"
  storage_account_name = azurerm_storage_account.example.name
  quota                = 50

  acl {
    id = "MTIzNDU2Nzg5MDEyMzQ1Njc4OTAxMjM0NTY3ODkwMTI"

    access_policy {
      permissions = "rwdl"
      start       = "2020-08-02T09:38:21.0000000Z"
      expiry      = "2021-08-02T10:38:21.0000000Z"
    }
  }
}

The access policy states that it will expire on August 2 2021. How to extend that using terraform? Is it even possible?

Darko Miletic
  • 195
  • 1
  • 1
  • 8

1 Answers1

2

Have you tried just changing the date and re-running the Terraform?

You are creating a Stored Access Policy, which outside of Terraform can just be updated by sending an update request, so I would have thought Terraform would do the same.

Sam Cogan
  • 38,158
  • 6
  • 77
  • 113