The method for incorporating multiple address prefixes within a single admin rule when utilizing Terraform AzureRm is to define the address prefix as a list and use the "any" function to apply the rule to all of the listed prefixes.
For example, the code would look like this:
resource "azurerm_network_security_group" "example" {
name = "example-nsg"
location = "East US"
resource_group_name = azurerm_resource_group.example.name
security_rule {
name = "allow-admin-access"
priority = 100
direction = "Inbound"
access = "Allow"
protocol = "Tcp"
source_port_range = "*"
destination_port_range = "3389"
source_address_prefix = "*"
destination_address_prefix = any(azurerm_subnet.backend.*.address_prefix)
}
}
In this example, the "destinationaddressprefix" is defined as "any(azurermsubnet.backend.*.addressprefix)", which applies the rule to all of the address prefixes listed in the "azurerm_subnet.backend" resource.
Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss
Asked: 2021-09-03 11:00:00 +0000
Seen: 9 times
Last updated: Oct 08 '21
How can I customize the validation for file uploads in Episerver forms?
How can the precise CSS specificity be viewed in Chrome Dev Tools?
Why isn't my CodePipeline pipeline triggered by my CloudWatch Event rule?
How can the ThingsBoard Rule Chain be utilized to gather all the email addresses of customer users?
How do you create a Sentinel Analytics Rule using two tables?