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

subresource_names attribute on azurerm_private_link_endpoint.private_service_connection does not accept valid data #5110

Closed
geekzter opened this issue Dec 9, 2019 · 3 comments · Fixed by #5118

Comments

@geekzter
Copy link

geekzter commented Dec 9, 2019

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 -v
Terraform v0.12.17
provider "azurerm" {
    version = "= 1.38" 
}

Affected Resource(s)

  • azurerm_private_link_endpoint

Terraform Configuration Files

resource "azurerm_resource_group" "repro" {
  name                         = "${var.prefix}-private-endpoint-issue"
  location                     = var.location
}

resource "azurerm_virtual_network" "network" {
  name                         = "${var.prefix}-vnet"
  address_space                = ["10.0.0.0/16"]
  location                     = azurerm_resource_group.repro.location
  resource_group_name          = azurerm_resource_group.repro.name
}

resource "azurerm_subnet" "subnet" {
  name                         = "${var.prefix}-subnet"
  resource_group_name          = azurerm_resource_group.repro.name
  virtual_network_name         = azurerm_virtual_network.network.name
  address_prefix               = "10.0.1.0/24"
  enforce_private_link_endpoint_network_policies = false
}

resource "random_string" "password" {
  length                       = 12
  upper                        = true
  lower                        = true
  number                       = true
  special                      = true
  override_special             = "." 
}

resource "azurerm_sql_server" "sql_server" {
  name                         = "${var.prefix}sqlserver"
  resource_group_name          = azurerm_resource_group.repro.name
  location                     = azurerm_resource_group.repro.location
  version                      = "12.0"
  administrator_login          = "dbadmin"
  administrator_login_password = random_string.password.result
}

resource "azurerm_private_link_endpoint" "endpoint" {
  name                         = "${var.prefix}-endpoint"
  resource_group_name          = azurerm_resource_group.repro.name
  location                     = azurerm_resource_group.repro.location
  subnet_id                    = azurerm_subnet.subnet.id

  private_service_connection {
    is_manual_connection       = false
    name                       = "${var.prefix}-endpoint-connection"
    private_connection_resource_id = azurerm_sql_server.sql_server.id
    subresource_names          = ["sqlServer"]
  }
}
variable "prefix" {
  description = "The Prefix used for all resources in this example"
}

variable "location" {
  description = "The Azure Region in which all resources in this example should be created."
}

Debug Output

Panic Output

Error: private_service_connection.0.subresource_names.0 must only contain upper or lowercase letters, numbers, underscores, and periods

Expected Behavior

Private Endpoint created for given sqlServer sub resource (GroupId)

Actual Behavior

Error: private_service_connection.0.subresource_names.0 must only contain upper or lowercase letters, numbers, underscores, and periods

Steps to Reproduce

  1. terraform init
  2. terraform apply

Important Factoids

It appears the regex in ValidatePrivateLinkSubResourceName is single character only (^[\w\.]$)

References

@leewilson86
Copy link
Contributor

Hey @WodansSon,

Is this something you are aware of? I understand you created the TF resource for private endpoints.

I have been experiencing this issue too.

Cheers!

@ghost
Copy link

ghost commented Dec 16, 2019

This has been released in version 1.39.0 of the provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. As an example:

provider "azurerm" {
    version = "~> 1.39.0"
}
# ... other configuration ...

@ghost
Copy link

ghost commented Jan 10, 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 Jan 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
4 participants