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

AWS iops attribute is only valid for io1 and io2 type EBS volumes, not gp2, sc1 and st1 types. #157

Open
ghost opened this issue Dec 16, 2020 · 0 comments · May be fixed by #163
Open

AWS iops attribute is only valid for io1 and io2 type EBS volumes, not gp2, sc1 and st1 types. #157

ghost opened this issue Dec 16, 2020 · 0 comments · May be fixed by #163
Assignees
Labels
Provider: AWS Issues related to the AWS Provider Type: Bug Something isn't working

Comments

@ghost
Copy link

ghost commented Dec 16, 2020

General information:

Describe the bug:

A clear and concise description of what the bug is.

Description: When TerraCognita generates Terraform code for AWS EBS volume types gp2, sc1 and st1 the output includes an iops attribute which is invalid syntax for using with terraform apply.

https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/ebs_volume
iops - (Optional) The amount of IOPS to provision for the disk. Only valid for type of io1 or io2.

Log message

Here you can paste the log message or paste the link to console logs. If the log message is too big, you can use a tool like https://pastebin.com/.

Additional context

Expected: Import AWS resources using TerraCognita and be able to use the resulting Terraform code without modification with terraform apply.

Actual: TerraCognita will output invalid Terraform code that cannot be used with terraform apply as-is.

Reproducing:

  1. Launch EC2 instance.
  2. Import via TerraCognita (example: terracognita aws -i aws_instance --access-key "$(awk '/aws_access_key_id/ {print $3}' ~/.aws/credentials)" --secret-key "$(awk '/aws_secret_access_key/ {print $3}' ~/.aws/credentials)" --region us-east-2 --hcl instance.tf)
  3. Terminate EC2 instance (or don't, it's not essential).
  4. Run terraform apply
  5. Get Error: error creating resource: iops attribute not supported for root_block_device with volume_type gp2
  6. The error is fatal; terrform apply will not not launched any resources.

Add any other context about the problem here.

Running terraform plan will not report the error in the Terraform code.

The iops = "100" (excerpted from /instance.tf generated above) is invalid syntax for terraform apply:

  root_block_device {
    delete_on_termination = true
    iops                  = 100
    volume_size           = 8
    volume_type           = "gp2"
  }

I tested with Terraform versions v0.12.29 and v0.14.2.

@ghost ghost added the Type: Bug Something isn't working label Dec 16, 2020
@tormath1 tormath1 added the Provider: AWS Issues related to the AWS Provider label Dec 17, 2020
@tormath1 tormath1 self-assigned this Jan 4, 2021
@tormath1 tormath1 linked a pull request Jan 13, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Provider: AWS Issues related to the AWS Provider Type: Bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant