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

Cosmos ip_range_filter argument broken after azurerm provider version 1.4 #1456

Closed
Phydeauxman opened this issue Jun 27, 2018 · 4 comments · Fixed by #1463
Closed

Cosmos ip_range_filter argument broken after azurerm provider version 1.4 #1456

Phydeauxman opened this issue Jun 27, 2018 · 4 comments · Fixed by #1463

Comments

@Phydeauxman
Copy link

Terraform Version

Terraform v0.11.7
provider.azurerm v1.4.0

Affected Resource(s)

azurerm_cosmosdb_account

Terraform Configuration Files

resource azurerm_cosmosdb_account "cdb" {
  name                = "${var.cdba_name}"
  resource_group_name = "${azurerm_resource_group.rg.name}"
  location            = "${azurerm_resource_group.rg.location}"
  offer_type          = "Standard"
  kind                = "GlobalDocumentDB"
  ip_range_filter     = "${var.vnet_address_space},1.2.3.4,5.6.7.8,9.1.4.7,8.3.6.9,8.2.5.4,0.0.0.0"
  depends_on          = ["azurerm_resource_group.rg"]

  consistency_policy {
    consistency_level       = "Session"
    max_interval_in_seconds = 5
    max_staleness_prefix    = 100
  }

  geo_location {
    location          = "${azurerm_resource_group.rg.location}"
    failover_priority = 0
  }
}

Expected Behavior

The resource creates successfully

Actual Behavior

When we upgraded from 1.4 to 1.7 of the provider, the ip_range_filter value started throwing the error below. We tried reverting to version 1.6 but still got the same error. Had to revert to 1.4 for it to create successfully again:

Error: azurerm_cosmosdb_account.cdb: invalid value for ip_range_filter (Cosmos DB ip_range_filter must be a set of CIDR IP addresses separated by commas with no spaces: '10.0.0.1,10.0.0.2')

Steps to Reproduce

Run terraform -plan with config using azurerm provider 1.6 or 1.7

@katbyte
Copy link
Collaborator

katbyte commented Jun 28, 2018

Hi @Phydeauxman,

What is the value you are passing into the ip_range_filter? is ${var.vnet_address_space} potentially empty some of the time leading to an empty element in the comma separated list?

@katbyte katbyte added this to the 1.9.0 milestone Jun 28, 2018
@Phydeauxman
Copy link
Author

Phydeauxman commented Jun 28, 2018

@katbyte the value is 10.20.0.0/16. It is defined in my variables.tf file. I can literally put the line version = "1.4.0" in my main.tf and it works fine. Change that to version = "1.6.0" or version = "1.7.0", run terraform init, and now terraform plan fails with the error I indicated.

@katbyte
Copy link
Collaborator

katbyte commented Jun 29, 2018

@Phydeauxman,

That is definitely a bug in the properties validation, thank you for letting us know!

I've pushed a fix for 1.9 via #1463

@ghost
Copy link

ghost commented Mar 30, 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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks!

@ghost ghost locked and limited conversation to collaborators Mar 30, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants