From b0a7d1a2717d8e49d10c5aa00509c01520eb1b3c Mon Sep 17 00:00:00 2001 From: Novikov Sergey Date: Thu, 2 Feb 2023 13:42:34 +0100 Subject: [PATCH] Update to TF-1.3 (#14) --- Makefile | 2 +- README.md | 14 +++++++------- locals.tf | 7 ++----- modules/membership/README.md | 2 +- modules/membership/versions.tf | 3 +-- modules/team/README.md | 2 +- modules/team/versions.tf | 3 +-- tests/Makefile | 2 +- tests/versions.tf | 2 +- variables.tf | 12 ++++++------ versions.tf | 3 +-- 11 files changed, 23 insertions(+), 29 deletions(-) diff --git a/Makefile b/Makefile index aa50d4d..23bf9da 100644 --- a/Makefile +++ b/Makefile @@ -11,7 +11,7 @@ TF_MODULES = $(sort $(dir $(wildcard $(CURRENT_DIR)modules/*/))) # ------------------------------------------------------------------------------------------------- # Container versions # ------------------------------------------------------------------------------------------------- -TF_VERSION = 1.2.9 +TF_VERSION = 1.3.7 TFDOCS_VERSION = 0.16.0-0.31 FL_VERSION = 0.4 JL_VERSION = 1.6.0-0.5 diff --git a/README.md b/README.md index da6c8d4..c413f3b 100644 --- a/README.md +++ b/README.md @@ -104,7 +104,7 @@ No providers. | Name | Version | |------|---------| -| [terraform](#requirement\_terraform) | >= 1.0 | +| [terraform](#requirement\_terraform) | >= 1.3 | | [github](#requirement\_github) | 5.13.0-fl.1 | @@ -122,12 +122,12 @@ Type: ```hcl list(object({ - ident = string # Unique identifier for each item to guarantee no re-create during list change - name = string # Name of the team as displayed on GitHub - description = optional(string) # Description of the team - privacy = optional(string) # Privacy (closed or secret), default is closed - parent_name = optional(string) # Name of the Parent team - members = optional(list(string)) # List of GitHub usernames to assign to a team + ident = string # Unique identifier for each item to guarantee no re-create during list change + name = string # Name of the team as displayed on GitHub + description = optional(string) # Description of the team + privacy = optional(string, "closed") # Privacy (closed or secret), default is closed + parent_name = optional(string) # Name of the Parent team + members = optional(list(string), []) # List of GitHub usernames to assign to a team })) ``` diff --git a/locals.tf b/locals.tf index def4606..7d517c8 100644 --- a/locals.tf +++ b/locals.tf @@ -3,15 +3,12 @@ locals { teams = { for index, team in var.teams : - # Cannot use defaults function with list because of issue in terraform - # https://github.com/hashicorp/terraform/issues/28406 - # TODO: use defaults() function after issue is resolved team.ident => { name = team.name description = team.description - privacy = team.privacy != null ? team.privacy : "closed" + privacy = team.privacy parent_name = team.parent_name - members = team.members != null ? team.members : tolist([]) + members = team.members } } } diff --git a/modules/membership/README.md b/modules/membership/README.md index d1944c2..385a719 100644 --- a/modules/membership/README.md +++ b/modules/membership/README.md @@ -5,7 +5,7 @@ | Name | Version | |------|---------| -| [terraform](#requirement\_terraform) | >= 1.0 | +| [terraform](#requirement\_terraform) | >= 1.3 | | [github](#requirement\_github) | 5.13.0-fl.1 | ## Providers diff --git a/modules/membership/versions.tf b/modules/membership/versions.tf index e685769..d59fe59 100644 --- a/modules/membership/versions.tf +++ b/modules/membership/versions.tf @@ -1,6 +1,5 @@ terraform { - required_version = ">= 1.0" - + required_version = ">= 1.3" required_providers { # https://github.com/integrations/terraform-provider-github # https://github.com/flaconi/terraform-provider-github diff --git a/modules/team/README.md b/modules/team/README.md index c80f98b..08acb77 100644 --- a/modules/team/README.md +++ b/modules/team/README.md @@ -6,7 +6,7 @@ | Name | Version | |------|---------| -| [terraform](#requirement\_terraform) | >= 1.0 | +| [terraform](#requirement\_terraform) | >= 1.3 | | [github](#requirement\_github) | 5.13.0-fl.1 | ## Providers diff --git a/modules/team/versions.tf b/modules/team/versions.tf index e685769..d59fe59 100644 --- a/modules/team/versions.tf +++ b/modules/team/versions.tf @@ -1,6 +1,5 @@ terraform { - required_version = ">= 1.0" - + required_version = ">= 1.3" required_providers { # https://github.com/integrations/terraform-provider-github # https://github.com/flaconi/terraform-provider-github diff --git a/tests/Makefile b/tests/Makefile index 69988d6..5168996 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -22,7 +22,7 @@ CURRENT_GID := $(shell id -g) # ------------------------------------------------------------------------------------------------- # Terraform configuration # ------------------------------------------------------------------------------------------------- -TF_VERSION = 1.2.9 +TF_VERSION = 1.3.7 TF_LOG = WARN LOCK_TIMEOUT = 60s LOCK_FILE = .terraform.lock.hcl diff --git a/tests/versions.tf b/tests/versions.tf index a75155a..16991ed 100644 --- a/tests/versions.tf +++ b/tests/versions.tf @@ -1,5 +1,5 @@ terraform { - required_version = ">= 1.0" + required_version = ">= 1.3" required_providers { github = { source = "flaconi/github" diff --git a/variables.tf b/variables.tf index a8355e2..aa45efa 100644 --- a/variables.tf +++ b/variables.tf @@ -1,11 +1,11 @@ variable "teams" { description = "GitHub teams to manage." type = list(object({ - ident = string # Unique identifier for each item to guarantee no re-create during list change - name = string # Name of the team as displayed on GitHub - description = optional(string) # Description of the team - privacy = optional(string) # Privacy (closed or secret), default is closed - parent_name = optional(string) # Name of the Parent team - members = optional(list(string)) # List of GitHub usernames to assign to a team + ident = string # Unique identifier for each item to guarantee no re-create during list change + name = string # Name of the team as displayed on GitHub + description = optional(string) # Description of the team + privacy = optional(string, "closed") # Privacy (closed or secret), default is closed + parent_name = optional(string) # Name of the Parent team + members = optional(list(string), []) # List of GitHub usernames to assign to a team })) } diff --git a/versions.tf b/versions.tf index b610228..d59fe59 100644 --- a/versions.tf +++ b/versions.tf @@ -1,6 +1,5 @@ terraform { - experiments = [module_variable_optional_attrs] - required_version = ">= 1.0" + required_version = ">= 1.3" required_providers { # https://github.com/integrations/terraform-provider-github # https://github.com/flaconi/terraform-provider-github