A bug in Terraform

Hello,

I just created a module for aws_security_group and after terraform apply, I got this message:
Error: configuration for module.aws_security_group_test.aws_security_group.security_group still contains unknown values during apply (this is a bug in Terraform; please report it!)

resource “aws_security_group” “security_group” {
name = var.security_group_name
description = var.security_group_description
vpc_id = var.vpc_id
tags = {
“Name” = var.security_group_tag_name
}
}


Below is the main tf file to add all modules

module “aws_security_group_test” {
source = “…/modules/security_groups”
vpc_id = module.aws_vpc[0].vpc_id
security_group_name = var.security_group_name
security_group_description = var.security_group_description
security_group_tag_name = var.security_group_tag_name
}

Terraform v0.12.25

  • provider.aws v3.0.0

Please help me to fix it.
Thanks,
NAT

Hi @mytuanZ

Welcome to the forum.

Try removing the double quotes " " in the tag Name:

tags = {
 Name = var.security_group_tag_name
}

Hi @javierruizjimenez,
I removed the double quotes but I got the same error message.
It worked in v0.11 (of course I need to add ${} )
Maybe I need to check the variables type carefully.
Thanks,

Hi @mytuanZ,

That does indeed seem like a bug in Terraform… what you’ve encountered here is a situation that shouldn’t be possible if Terraform is behaving correctly.

What you’ve seen here seems similar to what was reported in this GitHub issue:

If you’d be willing, it’d be helpful if you could add a comment on that issue describing what you saw here. Although you’d be leaving a comment rather than creating a new issue, it’d be most helpful if you could copy our new issue template, paste it into the GitHub issue comment box, and then fill in as much information as you can that is requested in the comments in the template – in particular, we’d like to see the full trace log that the issue template requests. That way the team will have the best chance of being able to reproduce the issue and see if it has the same root cause as the original report.

Thanks!

Hi @apparentlymart ,
I updated to Terraform v0.13.0 and not see this error. I will comment on Github for this issue.
Thanks,