-
Notifications
You must be signed in to change notification settings - Fork 9.5k
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_network_security_rule, rule name not resource name must be unique? #13773
Comments
In addition, it doesn't look like Terraform is actually enforcing Name to be 'required', it'll happily try to provision without a Name, and die with
|
Hi @abdelhegazi Thanks for reporting this issue. I've taken the partial configuration that you've posted, and filled in the missing pieces to get this config:
However I'm having a hard time replicating this issue on either TF 0.8.8 or TF 0.9.3 - would it be possible for you to post a full reproduceable TF config so that we can investigate this further? Thanks!
I've opened PR #13900 to fix this (and a couple of other issues with this resource) 😄 Thanks! |
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. |
Terraform Version
I know that 0.9.3 is out but for some backward compatibility I have to use 0.8.x version
Affected Resource(s)
Please list the resources as a list, for example:
Terraform Configuration Files
Expected Behavior
As I make sure the resource name sshRule, httpRule, httpsRule ...etc should be unique which I made sure it is, regardless the name of each rule is unique or not as I use it as a tag to classify all related rules with the same name. So the expected behavior is to create all the mentioned rules in order with no issues
Actual Behavior
Terraform basically creates only one of the rules have same name for example httpRule resource has name of "HTTP" and consulRule resource has also the same name of "HTTP". Also "httpsrule" which allows inboud for 443 has same value of "httpsrule2" which allows inbound for 8080 and both rules had same name value "HTTPS", what happens is terraform only creates one of them and when running
terrafrom plan is shows that it needs to add some more resources and when terraform apply it deletes for example the rule of 443 and adds the rule for 8080 or vice versa
It took me some time till I tried to make everything unique which made it succeed, I guess this needs to be added clearly to the documentation (https://www.terraform.io/docs/providers/azurerm/r/network_security_rule.html#name) in addition it is REQUIRED it also needs to be unique value for each rule we add into out hcl code.
The text was updated successfully, but these errors were encountered: