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_route_table with azurerm_route flipping resources #447

Closed
thiagocaiubi opened this Issue Oct 20, 2017 · 8 comments

Comments

Projects
5 participants
@thiagocaiubi
Contributor

thiagocaiubi commented Oct 20, 2017

Terraform Version

0.10.7

AzureRM Provider Version

0.3.0

Affected Resource(s)

Please list the resources as a list, for example:

  • azurerm_route_table
  • azurerm_route

Terraform Configuration Files

resource "azurerm_resource_group" "test" {
  name     = "acceptanceTestResourceGroup1"
  location = "West US"
}

resource "azurerm_route_table" "test" {
  name                = "acceptanceTestRouteTable1"
  location            = "${azurerm_resource_group.test.location}"
  resource_group_name = "${azurerm_resource_group.test.name}"
}

resource "azurerm_route" "test" {
  name                = "acceptanceTestRoute1"
  resource_group_name = "${azurerm_resource_group.test.name}"
  route_table_name    = "${azurerm_route_table.test.name}"
  address_prefix      = "10.1.0.0/16"
  next_hop_type       = "vnetlocal"
}

Debug Output

https://gist.github.com/thiagocaiubi/1c39ca2a9e40f866cc8ae3473b273cf1

Expected Behavior

First terraform apply must create the infrastructure.
Second terraform apply must do nothing.

Actual Behavior

Subsequent terraform apply are creating/destroying the resources.

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. terraform init
  2. terraform apply
  3. terraform apply

References

I guess is something related to the refactoring from Set to List.
Pretty sure that I'm facing the same issue with azurerm_network_security_group and azurerm_network_security_rule.

@thiagocaiubi

This comment has been minimized.

Show comment
Hide comment
@thiagocaiubi

thiagocaiubi Oct 22, 2017

Contributor

I've tested the same HCL against terraform v0.10.7 and azurerm provider v0.2.2 and get the expected behavior successfully.

Debug output: https://gist.github.com/thiagocaiubi/4030764cf958207a125c28e9e856253e

Contributor

thiagocaiubi commented Oct 22, 2017

I've tested the same HCL against terraform v0.10.7 and azurerm provider v0.2.2 and get the expected behavior successfully.

Debug output: https://gist.github.com/thiagocaiubi/4030764cf958207a125c28e9e856253e

@fstuck37

This comment has been minimized.

Show comment
Hide comment
@fstuck37

fstuck37 Oct 25, 2017

I appear to have this issue as well.
I'm adding a default route via azurerm_route and when I do a subsequent plan it wants to delete it from the azurerm_route_table. If I apply, allow it to remove it, and than plan again; it wants to add it based on azurerm_route. So it is flipping the route between the azurerm_route and azurerm_route_table.

~ module.vnet.azurerm_route_table.privrt
route.#: "1" => "0"
route.0.address_prefix: "0.0.0.0/0" => ""
route.0.name: "DefaultGateway" => ""
route.0.next_hop_type: "VirtualAppliance" => ""

I'm using 0.10.7 as well and Azure provider 0.3.1.
(terraform-provider-azurerm_v0.3.1_x4.exe)
I didn't have this issue with a previous version v0.1.7.
(terraform-provider-azurerm_v0.1.7_x4.exe)

Still reviewing to see if I can work around it and will provide additional information if I find any.

Thanks,
Fred

fstuck37 commented Oct 25, 2017

I appear to have this issue as well.
I'm adding a default route via azurerm_route and when I do a subsequent plan it wants to delete it from the azurerm_route_table. If I apply, allow it to remove it, and than plan again; it wants to add it based on azurerm_route. So it is flipping the route between the azurerm_route and azurerm_route_table.

~ module.vnet.azurerm_route_table.privrt
route.#: "1" => "0"
route.0.address_prefix: "0.0.0.0/0" => ""
route.0.name: "DefaultGateway" => ""
route.0.next_hop_type: "VirtualAppliance" => ""

I'm using 0.10.7 as well and Azure provider 0.3.1.
(terraform-provider-azurerm_v0.3.1_x4.exe)
I didn't have this issue with a previous version v0.1.7.
(terraform-provider-azurerm_v0.1.7_x4.exe)

Still reviewing to see if I can work around it and will provide additional information if I find any.

Thanks,
Fred

@rcarun rcarun modified the milestone: M1 Oct 27, 2017

@rcarun rcarun added this to Backlog in AzureRM Resources Oct 27, 2017

@VaijanathB VaijanathB self-assigned this Oct 30, 2017

@VaijanathB VaijanathB moved this from Backlog to In Progress in AzureRM Resources Oct 30, 2017

@VaijanathB

This comment has been minimized.

Show comment
Hide comment
@VaijanathB

VaijanathB Oct 30, 2017

Collaborator

Hello @thiagocaiubi ,

Since you have already confirmed that this is no longer an issue, can you please go ahead and close this.

Thanks,
VJ

Collaborator

VaijanathB commented Oct 30, 2017

Hello @thiagocaiubi ,

Since you have already confirmed that this is no longer an issue, can you please go ahead and close this.

Thanks,
VJ

@fstuck37

This comment has been minimized.

Show comment
Hide comment
@fstuck37

fstuck37 Oct 31, 2017

VJ,
I still have this issue. I think thiagocaiubi was saying that this issue didn't exist in an older version (Terraform v0.10.7 and azurerm provider v0.2.2) and for me, I didn't have this issue with Azure version v0.1.7.

Seems like this issue was introduced between v0.2.2 and v0.3.0.
(v0.2.2 < v?.?.? <= v0.3.0)

Hope this helps

Thanks,
Fred

fstuck37 commented Oct 31, 2017

VJ,
I still have this issue. I think thiagocaiubi was saying that this issue didn't exist in an older version (Terraform v0.10.7 and azurerm provider v0.2.2) and for me, I didn't have this issue with Azure version v0.1.7.

Seems like this issue was introduced between v0.2.2 and v0.3.0.
(v0.2.2 < v?.?.? <= v0.3.0)

Hope this helps

Thanks,
Fred

@thiagocaiubi

This comment has been minimized.

Show comment
Hide comment
@thiagocaiubi

thiagocaiubi Nov 1, 2017

Contributor

Thanks, @fstuck37. That's it!

Contributor

thiagocaiubi commented Nov 1, 2017

Thanks, @fstuck37. That's it!

@VaijanathB

This comment has been minimized.

Show comment
Hide comment
@VaijanathB

VaijanathB Nov 1, 2017

Collaborator

Hello @thiagocaiubi , @fstuck37 ,

Thanks for the clarification. I tried the above repro provided by @thiagocaiubi , with Terraform version 0.10.9 and Azure provider version 0.3.2 and could not reproduce it.
When I perform, tf apply multiple times I get the following output.
tf apply
Apply complete! Resources: 0 added, 0 changed, 0 destroyed.
tf apply
Apply complete! Resources: 0 added, 0 changed, 0 destroyed.

If this is still an issue with latest version of Terraform and provider, can you provide with me updated repro steps ?

Thanks,
VJ

Collaborator

VaijanathB commented Nov 1, 2017

Hello @thiagocaiubi , @fstuck37 ,

Thanks for the clarification. I tried the above repro provided by @thiagocaiubi , with Terraform version 0.10.9 and Azure provider version 0.3.2 and could not reproduce it.
When I perform, tf apply multiple times I get the following output.
tf apply
Apply complete! Resources: 0 added, 0 changed, 0 destroyed.
tf apply
Apply complete! Resources: 0 added, 0 changed, 0 destroyed.

If this is still an issue with latest version of Terraform and provider, can you provide with me updated repro steps ?

Thanks,
VJ

@fstuck37

This comment has been minimized.

Show comment
Hide comment
@fstuck37

fstuck37 Nov 2, 2017

@VaijanathB - seems like v0.3.2 fixes the issue. Not sure what caused it but looks better now.
Thanks,
Fred

fstuck37 commented Nov 2, 2017

@VaijanathB - seems like v0.3.2 fixes the issue. Not sure what caused it but looks better now.
Thanks,
Fred

@rcarun rcarun moved this from In Progress to Waiting on Author in AzureRM Resources Nov 2, 2017

@thiagocaiubi

This comment has been minimized.

Show comment
Hide comment
@thiagocaiubi

thiagocaiubi Nov 3, 2017

Contributor

Hi @VaijanathB .

I've tested with terraform v0.10.8 and azurerm provider v0.3.2 and it worked as expected. I will now close the issue. Thanks!

PS: You mentioned terraform v0.10.9, I'm afraid it doesn't exists.
https://github.com/hashicorp/terraform/blob/f25d08061d8c68a5e205f0e82b8bab8c30afc63f/CHANGELOG.md

Contributor

thiagocaiubi commented Nov 3, 2017

Hi @VaijanathB .

I've tested with terraform v0.10.8 and azurerm provider v0.3.2 and it worked as expected. I will now close the issue. Thanks!

PS: You mentioned terraform v0.10.9, I'm afraid it doesn't exists.
https://github.com/hashicorp/terraform/blob/f25d08061d8c68a5e205f0e82b8bab8c30afc63f/CHANGELOG.md

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment