Closed johnathon-b closed 1 year ago
Have you tried to replace [""] with [] when optional are empty? ref: https://www.terraform.io/language/attr-as-blocks
Thanks for opening this issue. This was a problem in the 2.x version of the provider which is no longer actively maintained. If this is still an issue with the 3.x version of the provider please do let us know by opening a new issue, 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.
Community Note
Terraform (and AzureRM Provider) Version
Affected Resource(s)
azurerm_network_security_group
Terraform Configuration Files
I am creating Network Security Groups using dynamic blocks like this:
The NSG Rules variable is setup as following:
Debug Output
Panic Output
Expected Behaviour
Create Network Security Group with the following Security Rules. That is what the plan states it is going to do.
Actual Behaviour
Steps to Reproduce
create variable block
create Network Security Group using dynamic security_rules
Terraform Apply
Important Factoids
Deploying from modules.
References
Where Error originates: https://github.com/terraform-providers/terraform-provider-azurerm/blob/76a112f5c206835e0b945305022112ffe8e939de/azurerm/internal/services/network/network_security_group_resource.go#L494-L497
I've noticed this doesn't have the same error for destination_address_prefixes and destination_address_prefix even though they are identical in the source code.