Skip to content

Commit

Permalink
Comment for regex
Browse files Browse the repository at this point in the history
  • Loading branch information
QBY-MarkusMaring authored Apr 9, 2024
1 parent 198e7ee commit 616d585
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ resource "azurerm_firewall_policy_rule_collection_group" "this" {
dynamic "rule" {
for_each = var.bastion_config.ipg_rdp_access_ids
content {
# Generate rule name from the IP group name to avoid conflicts. The name is captured from the resource ID
name = "allow-bastion-to-${regex(".+\\/(.+)?", rule.value)[0]}-rdp"
protocols = ["TCP"]
source_ip_groups = [network_rule_collection.value]
Expand All @@ -104,6 +105,7 @@ resource "azurerm_firewall_policy_rule_collection_group" "this" {
dynamic "rule" {
for_each = var.bastion_config.ipg_ssh_access_ids
content {
# Generate rule name from the IP group name to avoid conflicts. The name is captured from the resource ID
name = "allow-bastion-to-${regex(".+\\/(.+)?", rule.value)[0]}-ssh"
protocols = ["TCP"]
source_ip_groups = [network_rule_collection.value]
Expand Down

0 comments on commit 616d585

Please sign in to comment.