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
Terraform 0.12 + vpc module v2.2 (Inappropriate value for attribute "subnet_ids": element 0: string required.) #271
Comments
Found the solution to be |
We are facing the same issue, is it related to any particular terraform version or the OS of the system where we run the "terraform plan/apply"? |
It can be also like this - |
I'm getting the same error doing something like this:
Anyone have any idea how to resolve this? |
@sonianara You can always unwrap value between subnet_ids = "${aws_subnet.priv_subnet.*.id}" |
@antonbabenko it worked like a charm |
@antonbabenko You saved me hours... |
|
--- antonbabenko commented Nov 8, 2019 |
OMG! i cannot say thank you enough for this page! |
Should the docs be updated? I was running into the same error trying to create a NLB: https://www.terraform.io/docs/providers/aws/r/lb.html This worked: resource "aws_lb" "node_port" {
...
subnets = data.aws_subnet_ids.private.ids
... |
I needed a combination of the answers above.
|
I tried like this. resource "aws_db_subnet_group" "dbsubnet" { |
Try this syntax: |
Error still prevalent in v0.14.5 with aws_vpc_endpoint |
Removing the brackets has done the trick, but I'm still wondering why one is a list here but the other is a string. Shouldn't they both be stings? This code does work...but why does security_group_ids need the square brackets but subnet_ids doesn't? |
i really want to found this problem, thank a lot. |
Hello, #terraform provider 3.55.0 resource "aws_vpc_endpoint" "example" { With subnet_ids i need to choose one subnet only - gateway load balancer requirement. Example error: Error: Incorrect attribute value type Anyone can help ? |
I encountered similar issue. You can try this: subnet_ids = toset([element(module.vpc.natgwsub_subnets.*.id,0)]) |
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. |
I am trying to upgrade my terraform but I am stuck at the following;
I am getting the error
Inappropriate value for attribute "subnet_ids": element 0: string required.
Could someone advise what is the current way of referencing all subnets and passing them into subnet_ids variable?
Thanks
The text was updated successfully, but these errors were encountered: