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

Incorrect attribute value type error when using terraform 0.12 and terraform-aws-eks v5.0.0 #414

Closed
3 tasks
mojochao opened this issue Jun 25, 2019 · 4 comments

Comments

@mojochao
Copy link

I have issues

I am trying to upgrade to use of terraform 0.12.x with terraform-aws-eks module v5.0.0, and am experiencing an error.

I'm submitting a...

  • bug report
  • feature request
  • [X ] support request
  • kudos, thank you, warm fuzzy

What is the current behavior?

After updating terraform to latest 0.12.3 version, changed my use of the module to v5.0.0 of the terraform-aws-eks module as follows:

module "terraform_aws_eks" {
source = "github.com/terraform-aws-modules/terraform-aws-eks?ref=v5.0.0"

cluster_name    = var.identity
cluster_version = var.kubernetes_version
subnets         = var.aws_subnets
tags            = var.tags
vpc_id          = var.aws_vpc

write_kubeconfig   = true
config_output_path = pathexpand("~/.kube/")
kubeconfig_name    = var.identity

worker_groups = [
    {
    asg_desired_capacity           = var.num_workers_desired
    asg_max_size                   = var.num_workers_max
    asg_min_size                   = var.num_workers_min
    autoscaling_enabled            = true
    create_elb_service_linked_role = true
    instance_type                  = var.worker_instance_type
    key_name                       = var.ssh_key_name
    name_prefix                    = "${var.identity}_worker_group"
    public_ip                      = true
    subnets                        = join(",", var.aws_subnets)
    },
]

worker_sg_ingress_from_port = "22"
}

When I run terraform plan I see the following error:

$ terraform-0.12.3 plan
provider.aws.region
The region where AWS operations will take place. Examples
are us-east-1, us-west-2, etc.

Enter a value: us-west-2

Refreshing Terraform state in-memory prior to plan...
The refreshed state will be used to calculate this plan, but will not be
persisted to local or remote state storage.

module.usw2.module.eks.module.coresvcs_eks.module.terraform_aws_eks.data.aws_region.current: Refreshing state...
module.usw2.module.eks.module.coresvcs_eks.module.terraform_aws_eks.data.aws_caller_identity.current: Refreshing state...
module.usw2.module.eks.module.coresvcs_eks.module.terraform_aws_eks.data.aws_ami.eks_worker: Refreshing state...
module.usw2.module.eks.module.coresvcs_eks.module.terraform_aws_eks.data.aws_iam_policy_document.cluster_assume_role_policy: Refreshing state...
module.usw2.module.eks.module.coresvcs_eks.module.terraform_aws_eks.data.aws_iam_policy_document.workers_assume_role_policy: Refreshing state...

------------------------------------------------------------------------

Error: Incorrect attribute value type

on .terraform/modules/usw2.eks.coresvcs_eks.terraform_aws_eks/workers.tf line 37, in resource "aws_autoscaling_group" "workers":
37:   vpc_zone_identifier = lookup(

Inappropriate value for attribute "vpc_zone_identifier": set of string
required.

If this is a bug, how to reproduce? Please include a code sample if relevant.

Create an instance of the terraform-aws-eks module v5.0.0 as shown above and run terraform plan on it.

What's the expected behavior?

Successful creation of the EKS cluster

Are you able to fix this problem and submit a PR? Link here if you have already.

No. Please advise.

Environment details

  • Affected module version: v5.0.0
  • OS: macOS (Mojave)
  • Terraform version: 0.12.3

Any other relevant info

@mojochao mojochao changed the title Incorrect attribute value type when using terraform 0.12 and terraform-aws-eks v5.0.0 Incorrect attribute value type error when using terraform 0.12 and terraform-aws-eks v5.0.0 Jun 25, 2019
@srikanthkodali9
Copy link

Drop the join on var.aws_subnets as the vpc_zone_identifier does the split.
subnets = var.aws_subnets

@mojochao
Copy link
Author

That fixed it. Everything working as expected now. Thanks!

@tyanko1
Copy link

tyanko1 commented May 18, 2020

@srikanthkodali9 you da man

@github-actions
Copy link

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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 26, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants