Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

azurerm_storage_account: PATCH is not valid in the allowed_methods of the cors_rule #24941

Closed
diegopeinador opened this issue May 13, 2020 · 3 comments

Comments

@diegopeinador
Copy link

Terraform Version

Terraform v0.12.24
+ provider.azurerm v2.6.0

Terraform Configuration Files

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

resource "azurerm_resource_group" "test-cors" {
  name     = "test-cors-RG"
  location = "West Europe"
}

resource "azurerm_storage_account" "test-cors" {
  name                     = "terraformtestcors"
  resource_group_name      = azurerm_resource_group.test-cors.name
  location                 = azurerm_resource_group.test-cors.location
  account_tier             = "Standard"
  account_replication_type = "LRS"
  enable_https_traffic_only= true
  account_kind             = "StorageV2"
  static_website {
    index_document = "index.html"
  }
  blob_properties {
    cors_rule {
        allowed_headers    = ["x-ms-*"]
        allowed_methods    = [
            "PUT",
            "OPTIONS",
            "POST",
            "GET",
            "HEAD",
            "DELETE",
            "MERGE",
            "PATCH", # Not allowed by terraform CLI, but present on Azure
        ]
        allowed_origins    = ["http://localhost:61674"]
        exposed_headers    = ["x-ms-*"]
        max_age_in_seconds = 86400
    }
  }
  tags = {"DETELEME":"THIS IS A TEST"}
}

Debug Output

terraform validate:

Error: expected blob_properties.0.cors_rule.0.allowed_methods.7 to be one of [DELETE GET HEAD MERGE POST OPTIONS PUT], got PATCH

  on test-cors.tf line 11, in resource "azurerm_storage_account" "test-cors":
  11: resource "azurerm_storage_account" "test-cors" {

Expected Behavior

PATH To be a valid method.

Actual Behavior

Error from the validator

Steps to Reproduce

  1. terraform init
  2. terraform validate

Additional Context

In the Azure portal the patch is listed as a valid method:
Screenshot 2020-05-13 at 15 03 21

References

The documentation is consistent with the validator and doesn't list PATCH as a valid method for this parameter:
https://www.terraform.io/docs/providers/azurerm/r/storage_account.html#allowed_methods

@danieldreier
Copy link
Contributor

Thanks for reporting this! I think that this is an issue to be addressed in the AzureRM Terraform provider, rather than in core. I'm going to label it as such, and the HashiBot will shortly migrate it over to the provider GitHub repository. Please feel free to re-open this if they determine that it is indeed an issue that needs to be addressed in Terraform core.

@ghost
Copy link

ghost commented May 13, 2020

This issue has been automatically migrated to hashicorp/terraform-provider-azurerm#6904 because it looks like an issue with that provider. If you believe this is not an issue with the provider, please reply to hashicorp/terraform-provider-azurerm#6904.

@ghost ghost closed this as completed May 13, 2020
@ghost
Copy link

ghost commented Jun 13, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Jun 13, 2020
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants