From 86d0a7e3cc1bd445e9fe201d54f4b8fc85fe17dc Mon Sep 17 00:00:00 2001 From: Travis Reed <116005652+travis-reed@users.noreply.github.com> Date: Wed, 25 Sep 2024 16:52:49 -0500 Subject: [PATCH] Set allowed and cache methods as non nullable 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. --- variables.tf | 2 ++ 1 file changed, 2 insertions(+) diff --git a/variables.tf b/variables.tf index a19d3182..41b7fa28 100644 --- a/variables.tf +++ b/variables.tf @@ -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)" }