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

Empty tags on root_block_device #219

Closed
andormarkus opened this issue May 12, 2021 · 2 comments · Fixed by #220
Closed

Empty tags on root_block_device #219

andormarkus opened this issue May 12, 2021 · 2 comments · Fixed by #220

Comments

@andormarkus
Copy link

Description

With V2.18.0 if I don't fill out the tags for the root_block_device then I will get the following error:

│ Error: Incorrect attribute value type
│ 
│   on .terraform/modules/ec2_this/main.tf line 38, in resource "aws_instance" "this":
│   38:       tags                  = lookup(root_block_device.value, "tags", null)
│ 
│ Inappropriate value for attribute "tags": map of string required.

My TF file looks like this:

module "ec2_this" {
  source  = "terraform-aws-modules/ec2-instance/aws"
  version = "2.18.0"

  name                        = "this"
  ami                         =  XXXXXXX
  instance_type               = "t3a.xlarge"
  monitoring                  = true
  vpc_security_group_ids      = XXXXXXX
  subnet_id                   = XXXXXXX

  root_block_device = [
    {
      volume_type = "gp2"
      volume_size = 100
    },
  ]
}

If I put there some placeholder tags I got this error:

│ Error: Invalid value for module argument
│ 
│   on ec2.tf line 109, in module "ec2_this":
│  109:   root_block_device = [
│  110:     {
│  111:       volume_type = "gp2"
│  112:       volume_size = 100
│  113:       tags        = {
│  114:         Name = "fooo"
│  115:       }
│  116:     },
│  117:   ]
│ 
│ The given value is not suitable for child module variable
│ "root_block_device" defined at
│ .terraform/modules/ec2_powerbi_gateway_2/variables.tf:154,1-29: element 0:
│ element "tags": string required.
@antonbabenko
Copy link
Member

Thanks for reporting, @andormarkus !

v2.19.0 has been just released.

@github-actions
Copy link

github-actions bot commented Nov 8, 2022

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 8, 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

Successfully merging a pull request may close this issue.

2 participants