Skip to content

Commit

Permalink
fix(TF >= 1.3)!: allow optional vars in firewall rules module (#438)
Browse files Browse the repository at this point in the history
Co-authored-by: Zackary Maupin <[email protected]>
  • Loading branch information
zmaupin and zmaupin authored Apr 11, 2023
1 parent ab42e14 commit b188d37
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion modules/firewall-rules/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ module "firewall_rules" {
|------|-------------|------|---------|:--------:|
| network\_name | Name of the network this set of firewall rules applies to. | `string` | n/a | yes |
| project\_id | Project id of the project that holds the network. | `string` | n/a | yes |
| rules | List of custom rule definitions (refer to variables file for syntax). | <pre>list(object({<br> name = string<br> description = string<br> direction = string<br> priority = number<br> ranges = list(string)<br> source_tags = list(string)<br> source_service_accounts = list(string)<br> target_tags = list(string)<br> target_service_accounts = list(string)<br> allow = list(object({<br> protocol = string<br> ports = list(string)<br> }))<br> deny = list(object({<br> protocol = string<br> ports = list(string)<br> }))<br> log_config = object({<br> metadata = string<br> })<br> }))</pre> | `[]` | no |
| rules | List of custom rule definitions (refer to variables file for syntax). | <pre>list(object({<br> name = string<br> description = optional(string)<br> direction = optional(string)<br> priority = optional(number)<br> ranges = optional(list(string))<br> source_tags = optional(list(string))<br> source_service_accounts = optional(list(string))<br> target_tags = optional(list(string))<br> target_service_accounts = optional(list(string))<br> allow = optional(list(object({<br> protocol = string<br> ports = optional(list(string))<br> })))<br> deny = optional(list(object({<br> protocol = string<br> ports = optional(list(string))<br> })))<br> log_config = optional(object({<br> metadata = string<br> }))<br> }))</pre> | `[]` | no |

## Outputs

Expand Down
32 changes: 16 additions & 16 deletions modules/firewall-rules/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -29,24 +29,24 @@ variable "rules" {
default = []
type = list(object({
name = string
description = string
direction = string
priority = number
ranges = list(string)
source_tags = list(string)
source_service_accounts = list(string)
target_tags = list(string)
target_service_accounts = list(string)
allow = list(object({
description = optional(string)
direction = optional(string)
priority = optional(number)
ranges = optional(list(string))
source_tags = optional(list(string))
source_service_accounts = optional(list(string))
target_tags = optional(list(string))
target_service_accounts = optional(list(string))
allow = optional(list(object({
protocol = string
ports = list(string)
}))
deny = list(object({
ports = optional(list(string))
})))
deny = optional(list(object({
protocol = string
ports = list(string)
}))
log_config = object({
ports = optional(list(string))
})))
log_config = optional(object({
metadata = string
})
}))
}))
}
2 changes: 1 addition & 1 deletion modules/firewall-rules/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/

terraform {
required_version = ">= 0.13.0"
required_version = ">= 1.3.0"

required_providers {
google = {
Expand Down

0 comments on commit b188d37

Please sign in to comment.