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

shared_key is not updated for existing azurerm_virtual_network_gateway_connection #11673

Closed
andkardas opened this issue May 12, 2021 · 1 comment · Fixed by #11742
Closed

Comments

@andkardas
Copy link

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform (and AzureRM Provider) Version

Terraform v0.15.3

provider registry.terraform.io/hashicorp/azurerm v2.58.0

Affected Resource(s)

  • azurerm_virtual_network_gateway_connection

Terraform Configuration Files

resource "azurerm_virtual_network_gateway_connection" "CONN-A" {
    name                = var.conn_a
    location            = data.azurerm_resource_group.myrg.location
    resource_group_name = data.azurerm_resource_group.myrg.name

    type                       = "IPsec"
    virtual_network_gateway_id = azurerm_virtual_network_gateway.vpn-gw.id
    local_network_gateway_id   = azurerm_local_network_gateway.local-gw.id
    enable_bgp                 = var.bgp_enable

    shared_key                 = "myysuuupersecretkeyForExample!"

  
}

Debug Output

Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the
following symbols:
  ~ update in-place

Terraform will perform the following actions:

  # azurerm_virtual_network_gateway_connection.CONN-A will be updated in-place
  ~ resource "azurerm_virtual_network_gateway_connection" "CONN-A" {
        id                                 = "/subscriptions/XXXXXXXXXXXXX/resourceGroups/myrg/providers/Microsoft.Network/connections/CONN-A"
        name                               = "CONN-A"
      # Warning: this attribute value will no longer be marked as sensitive
      # after applying this change
      ~ shared_key                         = (sensitive value)
        tags                               = {
            "environment"  = "MY"
            "resourceType" = "MYVPN"
        }
        # (12 unchanged attributes hidden)

        # (1 unchanged block hidden)
    }

Plan: 0 to add, 1 to change, 0 to destroy.

Do you want to perform these actions?
  Terraform will perform the actions described above.
  Only 'yes' will be accepted to approve.

  Enter a value: yes

azurerm_virtual_network_gateway_connection.CONN-A: Modifying... [id=/XXXXXXXXXXXXX/resourceGroups/myrg/providers/Microsoft.Network/connections/CONN-A]
azurerm_virtual_network_gateway_connection.CONN-A: Still modifying... [id=/subscriptions/XXXXXXXXXXXXX-...k/connections/CONN-A, 10s elapsed]
azurerm_virtual_network_gateway_connection.CONN-A: Still modifying... [id=/subscriptions/XXXXXXXXXXXXX-...k/connections/CONN-A, 20s elapsed]
azurerm_virtual_network_gateway_connection.CONN-A: Still modifying... [id=/subscriptions/XXXXXXXXXXXXX-...k/connections/CONN-A, 30s elapsed]
azurerm_virtual_network_gateway_connection.CONN-A: Still modifying... [id=/subscriptions/XXXXXXXXXXXXX-...k/connections/CONN-A, 40s elapsed]
azurerm_virtual_network_gateway_connection.CONN-A: Modifications complete after 43s [id=/subscriptions/XXXXXXXXXXXXX/resourceGroups/myrg/providers/Microsoft.Network/connections/CONN-A]

Apply complete! Resources: 0 added, 1 changed, 0 destroyed.

Shared key is not updated, even terraform says Apply complete!, if I reapeat terraform apply, terraform still want to update it:

Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the
following symbols:
  ~ update in-place

Terraform will perform the following actions:

  # azurerm_virtual_network_gateway_connection.CONN-A will be updated in-place
  ~ resource "azurerm_virtual_network_gateway_connection" "CONN-A" {
        id                                 = "/subscriptions/XXXXXXXXXXXXX/resourceGroups/myrg/providers/Microsoft.Network/connections/CONN-A"
        name                               = "CONN-A"
      # Warning: this attribute value will no longer be marked as sensitive
      # after applying this change
      ~ shared_key                         = (sensitive value)
        tags                               = {
            "environment"  = "MY"
            "resourceType" = "MYVPN"
        }
        # (12 unchanged attributes hidden)

        # (1 unchanged block hidden)
    }

Plan: 0 to add, 1 to change, 0 to destroy.

Do you want to perform these actions?
  Terraform will perform the actions described above.
  Only 'yes' will be accepted to approve.

  Enter a value: yes

azurerm_virtual_network_gateway_connection.CONN-A: Modifying... [id=/XXXXXXXXXXXXX/resourceGroups/myrg/providers/Microsoft.Network/connections/CONN-A]
azurerm_virtual_network_gateway_connection.CONN-A: Still modifying... [id=/subscriptions/XXXXXXXXXXXXX-...k/connections/CONN-A, 10s elapsed]
azurerm_virtual_network_gateway_connection.CONN-A: Still modifying... [id=/subscriptions/XXXXXXXXXXXXX-...k/connections/CONN-A, 20s elapsed]
azurerm_virtual_network_gateway_connection.CONN-A: Still modifying... [id=/subscriptions/XXXXXXXXXXXXX-...k/connections/CONN-A, 30s elapsed]
azurerm_virtual_network_gateway_connection.CONN-A: Still modifying... [id=/subscriptions/XXXXXXXXXXXXX-...k/connections/CONN-A, 40s elapsed]
azurerm_virtual_network_gateway_connection.CONN-A: Modifications complete after 43s [id=/subscriptions/XXXXXXXXXXXXX/resourceGroups/myrg/providers/Microsoft.Network/connections/CONN-A]

Apply complete! Resources: 0 added, 1 changed, 0 destroyed.

Expected Behaviour

Shared key for connection shoud be updated

Actual Behaviour

Shared key for connection is not updated.

Steps to Reproduce

  1. terraform apply
  2. Repeat terraform apply, terraform want continously update shared key, but it is not changed.
@andkardas andkardas changed the title shared_key is not updated for existing azurerm_virtual_network_gateway_connection shared_key is not updated for existing azurerm_virtual_network_gateway_connection May 12, 2021
@github-actions
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 17, 2021
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