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_virtual_network resource, subnet doesn't recognize delegation block #27298

Closed
1 task done
stan-spotts opened this issue Sep 5, 2024 · 2 comments
Closed
1 task done

Comments

@stan-spotts
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

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 comments along the lines of "+1", "me too" or "any updates", 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 and review the contribution guide to help.

Terraform Version

1.9.2

AzureRM Provider Version

3.115.0

Affected Resource(s)/Data Source(s)

azurerm_virtual_network

Terraform Configuration Files

resource "azurerm_virtual_network" "vnet" {
  name                = var.vnet_name
  location            = var.location
  resource_group_name = var.resource_group_name
  address_space       = var.address_space
  tags                = var.tags

  subnet {
    name = var.subnet_name
    address_prefix = var.subnet_address
    security_group = var.subnet_nsg_name
  }
  
  subnet {
    name           = var.github_subnet_name
    address_prefix = var.github_subnet_cidr
    security_group = var.github_nsg_name

    delegation {
      name = "github_network_delegation"
      service_delegation {
        name    = "GitHub.Network/networkSettings"
        actions = ["Microsoft.Network/virtualNetworks/subnets/action"]
      }
    }
  }
}

Debug Output/Panic Output

Error from terraform plan:
│ Error: Unsupported block type
│
│   on ..\..\modules\vnet\main.tf line 21, in resource "azurerm_virtual_network" "vnet":
│   21:     delegation {
│
│ Blocks of type "delegation" are not expected here.

Debug log after all the provider info:
2024-09-05T12:07:31.579-0400 [DEBUG] provider: using plugin: version=5
2024-09-05T12:07:31.635-0400 [DEBUG] created provider logger: level=debug
2024-09-05T12:07:31.635-0400 [INFO]  provider: configuring client automatic mTLS
2024-09-05T12:07:31.668-0400 [DEBUG] provider: starting plugin: path=.terraform/providers/registry.terraform.io/hashicorp/time/0.12.0/windows_386/terraform-provider-time_v0.12.0_x5.exe args=[".terraform/providers/registry.terraform.io/hashicorp/time/0.12.0/windows_386/terraform-provider-time_v0.12.0_x5.exe"]
2024-09-05T12:07:31.675-0400 [DEBUG] provider: plugin started: path=.terraform/providers/registry.terraform.io/hashicorp/time/0.12.0/windows_386/terraform-provider-time_v0.12.0_x5.exe pid=33992
2024-09-05T12:07:31.675-0400 [DEBUG] provider: waiting for RPC address: plugin=.terraform/providers/registry.terraform.io/hashicorp/time/0.12.0/windows_386/terraform-provider-time_v0.12.0_x5.exe
2024-09-05T12:07:31.715-0400 [INFO]  provider.terraform-provider-time_v0.12.0_x5.exe: configuring server automatic mTLS: timestamp=2024-09-05T12:07:31.713-0400
2024-09-05T12:07:31.807-0400 [DEBUG] provider.terraform-provider-time_v0.12.0_x5.exe: plugin address: address=127.0.0.1:10001 network=tcp timestamp=2024-09-05T12:07:31.807-0400
2024-09-05T12:07:31.807-0400 [DEBUG] provider: using plugin: version=5
2024-09-05T12:07:31.861-0400 [ERROR] vertex "module.shared_vnet.azurerm_virtual_network.vnet" error: Unsupported block type
2024-09-05T12:07:31.868-0400 [DEBUG] provider.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = error reading from server: EOF"
2024-09-05T12:07:31.874-0400 [INFO]  provider: plugin process exited: plugin=.terraform/providers/registry.terraform.io/hashicorp/time/0.12.0/windows_386/terraform-provider-time_v0.12.0_x5.exe id=33992
2024-09-05T12:07:31.874-0400 [DEBUG] provider: plugin exited

Expected Behaviour

Should have created VNET and subnets, with delegation on second subnet.

Actual Behaviour

Failed saying delegation was unsupported/not expected. Documentation specifically identifies delegation block as being supported and describes properties.

Steps to Reproduce

terraform plan

Important Factoids

No response

References

https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/virtual_network#delegation

@neil-yechenwei
Copy link
Contributor

Thanks for raising this issue. Please use latest azurerm provider v4.x for delegation.

@rcskosir
Copy link
Contributor

Thanks for taking the time to submit this issue. @neil-yechenwei is right that this is available in the latest version of the provider. As such, I am going to mark this issue as closed. Please upgrade to a v4.x version of the provider to use the functionality.

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

No branches or pull requests

3 participants