strongdm / terraform-sdm-onboarding

Create your strongDM onboarding environment in AWS
MIT License
5 stars 13 forks source link

EKS "count" error during terraform init with Terraform 1.2.0 #9

Closed perezjc closed 2 years ago

perezjc commented 2 years ago

Terraform v1.2.0 on darwin_arm64

When running a terraform init after cloning the repo during setup, the following error populates:

╷
│ Error: Module is incompatible with count, for_each, and depends_on
│ 
│   on onboarding/eks_cluster/main.tf line 125, in module "configmap":
│  125:   count       = var.create_eks ? 1 : 0
│ 
│ The module at module.strongdm_onboarding.module.eks is a
│ legacy module which contains its own local provider
│ configurations, and so calls to it may not use the count,
│ for_each, or depends_on arguments.
│ 
│ If you also control the module "./eks_cluster", consider
│ updating this module to instead expect provider
│ configurations to be passed by its caller.
╵
wrenhunter commented 2 years ago

I reproduced the error with TF 1.2.0. It doesn't occur with TF 1.1.2, so something has changed in the binary rather than the EKS module.

wrenhunter commented 2 years ago

I just tested terraform init with TF 1.2.1, and the error doesn't occur. Can you please try this @perezjc, and let us know if the project builds OK also?

perezjc commented 2 years ago

thanks @wrenhunter terraform init was successful with TF 1.2.1

turner-strongdm commented 2 years ago

!workhereisdone

perezjc commented 2 years ago

Worth noting this warning once we run the TF apply

╷
│ Warning: Redundant ignore_changes element
│ 
│   on .terraform/modules/strongdm_onboarding.eks.eks/main.tf line 305, in resource "aws_eks_addon" "this":
│  305: resource "aws_eks_addon" "this" {
│ 
│ Adding an attribute name to ignore_changes tells Terraform to
│ ignore future changes to the argument in configuration after the
│ object has been created, retaining the value originally configured.
│ 
│ The attribute modified_at is decided by the provider alone and
│ therefore there can be no configured value to compare with.
│ Including this attribute in ignore_changes has no effect. Remove
│ the attribute from ignore_changes to quiet this warning.
perezjc commented 2 years ago

Looks like that warning for redundant changes is already being addressed here: https://github.com/terraform-aws-modules/terraform-aws-rds/issues/401