hashicorp / terraform-provider-azurerm

Terraform provider for Azure Resource Manager
https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs
Mozilla Public License 2.0
4.51k stars 4.6k forks source link

Terraform hanging with more than two azurerm_vpn_server_configuration_policy_group #25326

Closed florentvaldelievre closed 5 months ago

florentvaldelievre commented 5 months ago

Is there an existing issue for this?

Community Note

Terraform Version

1.4.6

AzureRM Provider Version

3.96.0

Affected Resource(s)/Data Source(s)

azurerm_vpn_server_configuration_policy_group

Terraform Configuration Files

resource "azurerm_vpn_server_configuration_policy_group" "noaccess-policy-cfg" {
  name                        = "noaccess"
  vpn_server_configuration_id = "<your_vpn_server_config_id>"
  is_default  = true
  priority = 0
  policy {
    name  = "p2s-noaccess"
    type  = "AADGroupId"
    value =  "<your-ad-group-id>"
  }
}

resource "azurerm_vpn_server_configuration_policy_group" "admins-policy-cfg" {
  name                        = "admins"
  vpn_server_configuration_id = "<your_vpn_server_config_id>"
  is_default  = false
  priority = 1
  policy {
    name  = "p2s-admins"
    type  = "AADGroupId"
    value =  "<your-ad-group-id>"
  }
}

resource "azurerm_vpn_server_configuration_policy_group" "restricted-policy-cfg" {
  name                        = "restricted"
  vpn_server_configuration_id = "<your_vpn_server_config_id>"
  is_default  = false
  priority = 2
  policy {
    name  = "p2s-restricted-flo"
    type  = "AADGroupId"
    value =  "<your-ad-group-id>"
  }
}

Debug Output/Panic Output

Plan: 3 to add, 0 to change, 0 to destroy.
azurerm_vpn_server_configuration_policy_group.restricted-policy-cfg: Creating...
azurerm_vpn_server_configuration_policy_group.noaccess-policy-cfg: Creating...
azurerm_vpn_server_configuration_policy_group.admins-policy-cfg: Creating...
azurerm_vpn_server_configuration_policy_group.restricted-policy-cfg: Still creating... [10s elapsed]
azurerm_vpn_server_configuration_policy_group.noaccess-policy-cfg: Still creating... [10s elapsed]
azurerm_vpn_server_configuration_policy_group.admins-policy-cfg: Still creating... [10s elapsed]
azurerm_vpn_server_configuration_policy_group.restricted-policy-cfg: Still creating... [20s elapsed]
azurerm_vpn_server_configuration_policy_group.noaccess-policy-cfg: Still creating... [20s elapsed]
azurerm_vpn_server_configuration_policy_group.restricted-policy-cfg: Creation complete after 23s [id=/<disclosed>/providers/Microsoft.Network/vpnServerConfigurations/<disclosed>/configurationPolicyGroups/restricted]
azurerm_vpn_server_configuration_policy_group.noaccess-policy-cfg: Still creating... [30s elapsed]
azurerm_vpn_server_configuration_policy_group.noaccess-policy-cfg: Still creating... [40s elapsed]
azurerm_vpn_server_configuration_policy_group.noaccess-policy-cfg: Still creating... [50s elapsed]
azurerm_vpn_server_configuration_policy_group.noaccess-policy-cfg: Still creating... [1m0s elapsed]
azurerm_vpn_server_configuration_policy_group.noaccess-policy-cfg: Still creating... [1m10s elapsed]
azurerm_vpn_server_configuration_policy_group.noaccess-policy-cfg: Still creating... [1m20s elapsed]
azurerm_vpn_server_configuration_policy_group.noaccess-policy-cfg: Still creating... [1m30s elapsed]
azurerm_vpn_server_configuration_policy_group.noaccess-policy-cfg: Still creating... [1m40s elapsed]
azurerm_vpn_server_configuration_policy_group.noaccess-policy-cfg: Still creating... [1m50s elapsed]
azurerm_vpn_server_configuration_policy_group.noaccess-policy-cfg: Still creating... [2m0s elapsed]
...
azurerm_vpn_server_configuration_policy_group.noaccess-policy-cfg: Still creating... [30m0s elapsed]

Expected Behaviour

It should create 3 Policy groups

Actual Behaviour

No response

Steps to Reproduce

Really simple to reproduce

When we have more than 2 azurerm_vpn_server_configuration_policy_group to create, terraform hangs and never create the third policy group. It is working fine with two or one policy group.

I have noticed the following in the activity logs

 "statusMessage": "{\"status\":\"Failed\",\"error\":{\"code\":\"ResourceOperationFailure\",\"message\":\"The resource operation completed with terminal provisioning state 'Failed'.\",\"details\":[{\"code\":\"ConflictError\",\"message\":\"The current operation could not be executed because it is already in progress.\",\"details\":[]}]}}",

Important Factoids

No response

References

No response

github-actions[bot] commented 4 months ago

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.