terraform-aws-modules / terraform-aws-eks

Terraform module to create Amazon Elastic Kubernetes (EKS) resources πŸ‡ΊπŸ‡¦
https://registry.terraform.io/modules/terraform-aws-modules/eks/aws
Apache License 2.0
4.46k stars 4.07k forks source link

Call to function "coalescelist" failed: no non-null arguments. #2179

Closed hisashiyamaguchi closed 2 years ago

hisashiyamaguchi commented 2 years ago

I'm trying to create EKS on my AWS account, and getting an error "Call to function "coalescelist" failed: no non-null arguments." Here comes the details. I have been searching the same or similar issues, but have not found any workarounds - if someone gave me specific workarounds of this, that would be appreciated.

$ uname -r
21.6.0

$ terraform --version
Terraform v1.2.5
on darwin_arm64
+ provider registry.terraform.io/hashicorp/aws v4.23.0
+ provider registry.terraform.io/hashicorp/cloudinit v2.2.0
+ provider registry.terraform.io/hashicorp/kubernetes v2.12.1
+ provider registry.terraform.io/hashicorp/tls v3.4.0

$ aws-vault exec default --debug -- terraform init
2022/07/26 10:04:33 aws-vault v6.6.0
2022/07/26 10:04:33 Loading config file /Users/hisashiyamaguchi/.aws/config
2022/07/26 10:04:33 Parsing config file /Users/hisashiyamaguchi/.aws/config
2022/07/26 10:04:33 [keyring] Considering backends: [keychain]
2022/07/26 10:04:33 Using region "us-east-1" from AWS_REGION
2022/07/26 10:04:34 [keyring] Querying keychain for service="aws-vault", keychain="aws-vault.keychain"
2022/07/26 10:04:34 [keyring] Found 2 results
2022/07/26 10:04:34 profile default: using stored credentials
2022/07/26 10:04:34 profile default: using GetSessionToken
2022/07/26 10:04:34 [keyring] Querying keychain for service="aws-vault", keychain="aws-vault.keychain"
2022/07/26 10:04:34 [keyring] Found 2 results
2022/07/26 10:04:34 [keyring] Querying keychain for service="aws-vault", keychain="aws-vault.keychain"
2022/07/26 10:04:34 [keyring] Found 2 results
2022/07/26 10:04:34 [keyring] Querying keychain for service="aws-vault", account="sts.GetSessionToken,ZGVmYXVsdA,,1658800030", keychain="aws-vault.keychain"
2022/07/26 10:04:34 [keyring] Found item "aws-vault session for default (expires 2022-07-26T01:47:10Z)"
2022/07/26 10:04:34 Re-using cached credentials ****************JQHL from sts.GetSessionToken, expires in 42m35.97442s
2022/07/26 10:04:34 Setting subprocess env: AWS_DEFAULT_REGION=us-east-1, AWS_REGION=us-east-1
2022/07/26 10:04:34 Setting subprocess env: AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY
2022/07/26 10:04:34 Setting subprocess env: AWS_SESSION_TOKEN, AWS_SECURITY_TOKEN
2022/07/26 10:04:34 Setting subprocess env: AWS_SESSION_EXPIRATION
2022/07/26 10:04:34 Exec command terraform init
2022/07/26 10:04:34 Found executable /opt/homebrew/bin/terraform
Initializing modules...

Initializing the backend...

Initializing provider plugins...
- Reusing previous version of hashicorp/kubernetes from the dependency lock file
- Reusing previous version of hashicorp/aws from the dependency lock file
- Reusing previous version of hashicorp/tls from the dependency lock file
- Reusing previous version of hashicorp/cloudinit from the dependency lock file
- Using previously-installed hashicorp/cloudinit v2.2.0
- Using previously-installed hashicorp/kubernetes v2.12.1
- Using previously-installed hashicorp/aws v4.23.0
- Using previously-installed hashicorp/tls v3.4.0

Terraform has been successfully initialized!

You may now begin working with Terraform. Try running "terraform plan" to see
any changes that are required for your infrastructure. All Terraform commands
should now work.

If you ever set or change modules or backend configuration for Terraform,
rerun this command to reinitialize your working directory. If you forget, other
commands will detect it and remind you to do so if necessary.

$ aws-vault exec default --debug -- terraform apply
2022/07/26 10:04:53 aws-vault v6.6.0
2022/07/26 10:04:53 Loading config file /Users/hisashiyamaguchi/.aws/config
2022/07/26 10:04:53 Parsing config file /Users/hisashiyamaguchi/.aws/config
2022/07/26 10:04:53 [keyring] Considering backends: [keychain]
2022/07/26 10:04:53 Using region "us-east-1" from AWS_REGION
2022/07/26 10:04:53 [keyring] Querying keychain for service="aws-vault", keychain="aws-vault.keychain"
2022/07/26 10:04:53 [keyring] Found 2 results
2022/07/26 10:04:53 profile default: using stored credentials
2022/07/26 10:04:53 profile default: using GetSessionToken
2022/07/26 10:04:53 [keyring] Querying keychain for service="aws-vault", keychain="aws-vault.keychain"
2022/07/26 10:04:53 [keyring] Found 2 results
2022/07/26 10:04:53 [keyring] Querying keychain for service="aws-vault", keychain="aws-vault.keychain"
2022/07/26 10:04:53 [keyring] Found 2 results
2022/07/26 10:04:53 [keyring] Querying keychain for service="aws-vault", account="sts.GetSessionToken,ZGVmYXVsdA,,1658800030", keychain="aws-vault.keychain"
2022/07/26 10:04:53 [keyring] Found item "aws-vault session for default (expires 2022-07-26T01:47:10Z)"
2022/07/26 10:04:53 Re-using cached credentials ****************JQHL from sts.GetSessionToken, expires in 42m16.670006s
2022/07/26 10:04:53 Setting subprocess env: AWS_DEFAULT_REGION=us-east-1, AWS_REGION=us-east-1
2022/07/26 10:04:53 Setting subprocess env: AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY
2022/07/26 10:04:53 Setting subprocess env: AWS_SESSION_TOKEN, AWS_SECURITY_TOKEN
2022/07/26 10:04:53 Setting subprocess env: AWS_SESSION_EXPIRATION
2022/07/26 10:04:53 Exec command terraform apply
2022/07/26 10:04:53 Found executable /opt/homebrew/bin/terraform
module.kms.data.aws_caller_identity.current: Reading...
module.kms.data.aws_partition.current: Reading...
data.aws_partition.current: Reading...
data.aws_caller_identity.current: Reading...
module.kms.data.aws_partition.current: Read complete after 0s [id=aws]
data.aws_partition.current: Read complete after 0s [id=aws]
data.aws_iam_policy_document.assume_role_policy[0]: Reading...
data.aws_iam_policy_document.assume_role_policy[0]: Read complete after 0s [id=2764486067]
data.aws_caller_identity.current: Read complete after 1s [id=927556698342]
module.kms.data.aws_caller_identity.current: Read complete after 1s [id=927556698342]
β•·
β”‚ Error: Error in function call
β”‚
β”‚   on main.tf line 24, in resource "aws_eks_cluster" "this":
β”‚   24:     subnet_ids              = coalescelist(var.control_plane_subnet_ids, var.subnet_ids)
β”‚     β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚     β”‚ var.control_plane_subnet_ids is empty list of string
β”‚     β”‚ var.subnet_ids is empty list of string
β”‚
β”‚ Call to function "coalescelist" failed: no non-null arguments.
bryantbiggs commented 2 years ago

You need to provide subnets to provision

github-actions[bot] commented 1 year ago

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.