Skip to content

Commit 59bac5c

Browse files
committed
add options to enable MD5 authentication in BGP peers
1 parent 2f1bd8f commit 59bac5c

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

modules/interface/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
| interconnect\_attachment | The name or resource link to the VLAN interconnect for this interface | `string` | `null` | no |
99
| ip\_range | IP address and range of the interface | `string` | `null` | no |
1010
| name | The name of the interface | `string` | n/a | yes |
11-
| peers | BGP peers for this interface. | <pre>list(object({<br> name = string<br> peer_ip_address = string<br> peer_asn = string<br> advertised_route_priority = optional(number)<br> bfd = object({<br> session_initialization_mode = string<br> min_transmit_interval = optional(number)<br> min_receive_interval = optional(number)<br> multiplier = optional(number)<br> })<br> }))</pre> | `[]` | no |
11+
| peers | BGP peers for this interface. | <pre>list(object({<br> name = string<br> peer_ip_address = string<br> peer_asn = string<br> advertised_route_priority = optional(number)<br> bfd = object({<br> session_initialization_mode = string<br> min_transmit_interval = optional(number)<br> min_receive_interval = optional(number)<br> multiplier = optional(number)<br> })<br> md5_authentication_key = object({<br> name = string<br> key = string<br> })<br> }))</pre> | `[]` | no |
1212
| project | The project ID to deploy to | `string` | n/a | yes |
1313
| region | Region where the interface resides | `string` | n/a | yes |
1414
| router | Name of the router the interface resides | `string` | n/a | yes |

modules/interface/main.tf

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,12 @@ resource "google_compute_router_peer" "peers" {
4848
multiplier = try(each.value.bfd.multiplier, null)
4949
}
5050
}
51+
52+
dynamic "md5_authentication_key" {
53+
for_each = lookup(each.value, "md5_authentication_key", null) == null ? [] : [""]
54+
content {
55+
name = each.value.md5_authentication_key.name
56+
key = each.value.md5_authentication_key.key
57+
}
58+
}
5159
}

modules/interface/variables.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@ variable "peers" {
6464
min_receive_interval = optional(number)
6565
multiplier = optional(number)
6666
})
67+
md5_authentication_key = object({
68+
name = string
69+
key = string
70+
})
6771
}))
6872
description = "BGP peers for this interface."
6973
default = []

0 commit comments

Comments
 (0)