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

error importing aws_instance with ebs_volume #337

Closed
tparvu opened this issue Feb 16, 2023 · 1 comment · Fixed by #373
Closed

error importing aws_instance with ebs_volume #337

tparvu opened this issue Feb 16, 2023 · 1 comment · Fixed by #373
Labels
Type: Bug Something isn't working

Comments

@tparvu
Copy link

tparvu commented Feb 16, 2023

General information:

  • Operating System:

Archlinux

  • Terracognita version / tag:

v0.8.1

  • Did you build Terracognita from sources or did you use the Docker image:

Built from source, but docker image will error as well.

Describe the bug:

When importing a aws_instance resource that has an attached EBS volume Terracognita writes;

tags { instead of tags = {

Running a Terraform plan on results....
Using region = us-east-2
,╷
│ Error: Unsupported block type
│ 
│   on ec2_elastic_compute_cloud.tf line 37, in resource "aws_instance" "testbed":
│   37:     tags {
│ 
│ Blocks of type "tags" are not expected here. Did you mean to define argument "tags"? If so, use the equals sign to assign it a value.
╵
➜  terracognita git:(update-provider) ✗ 

Additional context

Original HCL;

resource "aws_instance" "testbed" {
  ami                         = data.aws_ami.debian.id
  instance_type               = var.instance_type
  subnet_id                   = aws_subnet.testbed_subnet.id
  associate_public_ip_address = true
  key_name                    = var.key_name
  vpc_security_group_ids      = [aws_security_group.allow_tests.id]

  tags = {
    Name        = var.instance_name
    Project     = var.project
    Desc        = var.description
    Contact     = var.contact
    Environment = var.environment
  }

  # root disk
  root_block_device {
    volume_size           = "16"
    volume_type           = "gp2"
    encrypted             = true
    delete_on_termination = true

    tags = {
      Name = "root disk"
      Desc = "Root disk for testbed"
    }
  }

  # data disk
  ebs_block_device {
    volume_size = "64"
    volume_type = "gp2"
    encrypted   = true
    device_name = "/dev/sdf"

    tags = {
      Name   = "testbed data disk"
      Desc   = "Inspire11 DevOps testbed data disk"
      Backup = "false"
    }
  }

}

Add any other context about the problem here.

Other maps are working fine, no idea what the issue is the ebs_block_device map.

@xescugc
Copy link
Member

xescugc commented Apr 19, 2023

This has been solved in #373 :) Thanks for the report

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants