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

Hyphens not allowed in Azure Bastion ip configuration name #4807

Closed
arestarh opened this issue Nov 5, 2019 · 7 comments · Fixed by #4814
Closed

Hyphens not allowed in Azure Bastion ip configuration name #4807

arestarh opened this issue Nov 5, 2019 · 7 comments · Fixed by #4814

Comments

@arestarh
Copy link
Contributor

arestarh commented Nov 5, 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

1.36.1

Affected Resource(s)

azurerm_bastion_host

Terraform Configuration Files

resource "azurerm_bastion_host" "bastion" {
  name                = "myname-bastion-myenvironment"
  location            = "${azurerm_resource_group.rg.location}"
  resource_group_name = "${azurerm_resource_group.rg.name}"

  ip_configuration {
    name                 = "myname-bastion-myenvironment-configuration"
    subnet_id            = "${azurerm_subnet.bastion.id}"
    public_ip_address_id = "${azurerm_public_ip.bhpip.id}"
  }
}

Debug Output

Panic Output

Expected Behavior

Resource ip configuration name should be myname-bastion-myenvironment-configuration.

Actual Behavior

This error is generated: Error: lowercase letters, highercase letters numbers only are allowed in "ip_configuration.0.name": "myname-bastion-myenvironment-configuration"

Steps to Reproduce

Create a bastion that contains hyphens as part of the ip configuration name

Important Factoids

References

@arestarh
Copy link
Contributor Author

arestarh commented Nov 5, 2019

Pretty similar issue #4759 that related to bastion host name was resolved by PR #4766

Seems like we have bastion ip configuration name constraints as well according to https://github.com/terraform-providers/terraform-provider-azurerm/blob/94cf18b287d634ee16aa5e37d3a73d3e8a356fa4/azurerm/resource_arm_bastion_host.go#L211

Unfortunately I didn't find info about bastion ip configuration name constraints neither in
https://docs.microsoft.com/en-us/azure/templates/microsoft.network/2019-06-01/bastionhosts nor in https://docs.microsoft.com/en-us/rest/api/virtualnetwork/bastionhosts/createorupdate

@tombuildsstuff

This comment has been minimized.

@arestarh
Copy link
Contributor Author

arestarh commented Nov 5, 2019

@tombuildsstuff Seems like issue reported in #4762 and #4759 was related to bastion name itself and it was fixed by #4766 in function validateAzureRMBastionHostName in https://github.com/terraform-providers/terraform-provider-azurerm/blob/94cf18b287d634ee16aa5e37d3a73d3e8a356fa4/azurerm/resource_arm_bastion_host.go#L194

I've reported issue related to bastion ip configuration name constraints that related to https://github.com/terraform-providers/terraform-provider-azurerm/blob/94cf18b287d634ee16aa5e37d3a73d3e8a356fa4/azurerm/resource_arm_bastion_host.go#L211 and function validateAzureRMBastionIPConfigName and was not covered by #4766

@tombuildsstuff
Copy link
Contributor

tombuildsstuff commented Nov 5, 2019

🤦‍♂ sorry @arestarh missed that critical ("ip configuration") - reopening

@aqche
Copy link
Contributor

aqche commented Nov 6, 2019

Tested applying an ARM template with an invalid ip configuration name and looks like the naming requirements are the same as the bastion host names. I can have a PR for this open soon. :)

Screen Shot 2019-11-05 at 4 39 47 PM

@ghost
Copy link

ghost commented Nov 26, 2019

This has been released in version 1.37.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.37.0"
}
# ... other configuration ...

@ghost
Copy link

ghost commented Mar 29, 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 Mar 29, 2020
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