-
Notifications
You must be signed in to change notification settings - Fork 170
Description
General information:
- Operating System: Arch Linux
- Terracognita version / tag: v0.5.1
- Did you build Terracognita from sources or did you use the Docker image: I downloaded https://github.com/cycloidio/terracognita/releases/download/v0.5.1/terracognita-linux-amd64.tar.gz
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:
- Launch EC2 instance.
- 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
) - Terminate EC2 instance (or don't, it's not essential).
- Run
terraform apply
- Get
Error: error creating resource: iops attribute not supported for root_block_device with volume_type gp2
- 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.