Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AWS EKS Introduction - Incorrect attribute value type #8974

Closed
jonigl opened this issue Jun 12, 2019 · 4 comments
Closed

AWS EKS Introduction - Incorrect attribute value type #8974

jonigl opened this issue Jun 12, 2019 · 4 comments
Labels
documentation Introduces or discusses updates to documentation. service/autoscaling Issues and PRs that pertain to the autoscaling service. service/eks Issues and PRs that pertain to the eks service.

Comments

@jonigl
Copy link

jonigl commented Jun 12, 2019

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform Version

Terraform v0.12.1

  • provider.aws v2.14.0
  • provider.http v1.1.1

Affected Resource(s)

  • aws_eks_cluster
  • aws_autoscaling_group

Terraform Configuration Files

resource "aws_autoscaling_group" "demo" {
  desired_capacity     = 2
  launch_configuration = "${aws_launch_configuration.demo.id}"
  max_size             = 5
  min_size             = 1
  name                 = "terraform-eks-demo"
  vpc_zone_identifier  = ["${aws_subnet.demo.*.id}"] #<--- Here it's one error

  tag {
    key                 = "Name"
    value               = "terraform-eks-demo"
    propagate_at_launch = true
  }

  tag {
    key                 = "kubernetes.io/cluster/${var.cluster-name}"
    value               = "owned"
    propagate_at_launch = true
  }
}
resource "aws_eks_cluster" "demo" {
  name     = "${var.cluster-name}"
  role_arn = "${aws_iam_role.demo-cluster.arn}"

  vpc_config {
    security_group_ids = ["${aws_security_group.demo-cluster.id}"]
    subnet_ids         = ["${aws_subnet.demo.*.id}"] #<--- Here it's the other error
  }

  depends_on = [
    "aws_iam_role_policy_attachment.demo-cluster-AmazonEKSClusterPolicy",
    "aws_iam_role_policy_attachment.demo-cluster-AmazonEKSServicePolicy",
  ]
}

Expected Behavior

Apply without any errors

Actual Behavior

Error: Incorrect attribute value type
  on eks-cluster.tf line 80, in resource "aws_eks_cluster" "demo":
  80:     subnet_ids         = ["${aws_subnet.demo.*.id}"]
Inappropriate value for attribute "subnet_ids": element 0: string required.
Error: Incorrect attribute value type
  on eks-worker-nodes.tf line 132, in resource "aws_autoscaling_group" "demo":
 132:   vpc_zone_identifier  = ["${aws_subnet.demo.*.id}"]
Inappropriate value for attribute "vpc_zone_identifier": element 0: string
required.

Steps to Reproduce

Try this example: https://github.com/terraform-providers/terraform-provider-aws/tree/master/examples/eks-getting-started

  1. terraform apply

References

Possible Solution

I used flatten () as @marcincuber suggested in terraform-aws-modules/terraform-aws-vpc#271 to resolve these errors and it worked:

flatten(["${aws_subnet.demo.*.id}"])
flatten(["${aws_subnet.demo.*.id}"])

@aeschright aeschright added needs-triage Waiting for first response or review from a maintainer. service/eks Issues and PRs that pertain to the eks service. service/autoscaling Issues and PRs that pertain to the autoscaling service. labels Jun 19, 2019
@bflad bflad added documentation Introduces or discusses updates to documentation. and removed needs-triage Waiting for first response or review from a maintainer. labels Aug 1, 2019
@bflad
Copy link
Member

bflad commented Sep 27, 2019

Related #8950

@dev-e
Copy link

dev-e commented Oct 8, 2019

Related #401 and #414

@bflad
Copy link
Member

bflad commented Jul 7, 2020

Hi folks 👋 This issue was resolved as part of work we did to begin automatically verifying all configurations against Terraform 0.12 in the examples/ directory of the repository. Please open a new issue if there are any continuing issues. 👍

@bflad bflad closed this as completed Jul 7, 2020
@ghost
Copy link

ghost commented Aug 6, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators Aug 6, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Introduces or discusses updates to documentation. service/autoscaling Issues and PRs that pertain to the autoscaling service. service/eks Issues and PRs that pertain to the eks service.
Projects
None yet
Development

No branches or pull requests

4 participants