scholzj / terraform-aws-kubernetes

Terraform module for Kubernetes setup on AWS
Apache License 2.0
200 stars 129 forks source link

Error: Attribute redefined - The argument "tags" was already set #26

Closed cmrust closed 5 years ago

cmrust commented 5 years ago

I'm receiving the following error on module version 1.6.1:

Error: Attribute redefined

  on .terraform/modules/kubernetes/scholzj-terraform-aws-kubernetes-6fb01f4/main.tf line 371, in resource "aws_autoscaling_group" "nodes":
 371:   tags = [{

The argument "tags" was already set at
.terraform/modules/kubernetes/scholzj-terraform-aws-kubernetes-6fb01f4/main.tf:365,3-7.
Each argument may be set only once.

Error: Attribute redefined

  on .terraform/modules/kubernetes/scholzj-terraform-aws-kubernetes-6fb01f4/main.tf line 377, in resource "aws_autoscaling_group" "nodes":
 377:   tags = ["${var.tags2}"]

The argument "tags" was already set at
.terraform/modules/kubernetes/scholzj-terraform-aws-kubernetes-6fb01f4/main.tf:365,3-7.
Each argument may be set only once.

It seems the tags attribute shouldn't be redeclared over and over here:

https://github.com/scholzj/terraform-aws-kubernetes/blob/7e4342ca7491cff178c8f265bef0f5d8d7639ba9/main.tf#L356-L382

scholzj commented 5 years ago

This seems to work fine for me with Terraform 0.11.11. What version of Terraform are you using?

cmrust commented 5 years ago

Hey @scholzj. Yep, looks like this error is specific to 0.12.0, which was just released. Rolled back to 0.11.14 and it's working fine again. To clarify above, this error was generated during a terraform init.

scholzj commented 5 years ago

Hmm, I will have a look if there is some workaround.

scholzj commented 5 years ago

FYI: I'm thinking about moving to Terraform 0.12.0 from Kubernetes 1.15. So that should be the timeframe I will look at this.

scholzj commented 5 years ago

@cmrust I finally found some time to upgrade to Kubernetes 1.15.x and Terraform 0.12.x. Please give try to the last release.