Skip to content

Commit

Permalink
Fix vpc module
Browse files Browse the repository at this point in the history
  • Loading branch information
posquit0 committed Oct 22, 2023
1 parent 0de8810 commit ed9d2a1
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
2 changes: 1 addition & 1 deletion modules/vpc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ This module creates following resources.
| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.6 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 4.58 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.3 |

## Providers

Expand Down
17 changes: 17 additions & 0 deletions modules/vpc/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,23 @@ variable "default_network_acl" {
})
default = {}
nullable = false

validation {
condition = alltrue([
for rule in var.default_network_acl.ingress_rules :
contains(["ALLOW", "DENY"], rule.action)
if var.default_network_acl.ingress_rules != null
])
error_message = "Valid values for `action` of each rules are `ALLOW` and `DENY`."
}
validation {
condition = alltrue([
for rule in var.default_network_acl.egress_rules :
contains(["ALLOW", "DENY"], rule.action)
if var.default_network_acl.egress_rules != null
])
error_message = "Valid values for `action` of each rules are `ALLOW` and `DENY`."
}
}

variable "default_security_group" {
Expand Down
2 changes: 1 addition & 1 deletion modules/vpc/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 4.58"
version = ">= 5.3"
}
}
}

0 comments on commit ed9d2a1

Please sign in to comment.