Skip to content

Commit

Permalink
Set allowed and cache methods as non nullable
Browse files Browse the repository at this point in the history
Setting nullable to false ensures that the variable value will never be null within the module. If nullable is false and the variable has a default value, then Terraform uses the default when a module input argument is null.
  • Loading branch information
travis-reed authored Sep 25, 2024
1 parent d6971c2 commit 86d0a7e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -196,12 +196,14 @@ variable "viewer_protocol_policy" {
variable "allowed_methods" {
type = list(string)
default = ["DELETE", "GET", "HEAD", "OPTIONS", "PATCH", "POST", "PUT"]
nullable = false
description = "List of allowed methods (e.g. GET, PUT, POST, DELETE, HEAD) for AWS CloudFront"
}

variable "cached_methods" {
type = list(string)
default = ["GET", "HEAD"]
nullable = false
description = "List of cached methods (e.g. GET, PUT, POST, DELETE, HEAD)"
}

Expand Down

0 comments on commit 86d0a7e

Please sign in to comment.