terraform version
Terraform v1.8.3
on darwin_amd64
+ provider registry.terraform.io/hashicorp/aws v5.50.0
Terraform Configuration Files
$ cat import.tf
import {
id = "vpc-81939bxx" # Resource ID in the cloud
to = aws_vpc.this# Resource address in OpenTofu configuration
}
Debug Output
$ terraform plan -generate-config-out=generated_resources.tf
aws_vpc.this: Preparing import... [id=vpc-81939bxx]
aws_vpc.this: Refreshing state... [id=vpc-81939bxx]
Planning failed. Terraform encountered an error while generating this plan.
╷
│ Warning: Config generation is experimental
│
│ Generating configuration during import is currently experimental, and the generated configuration format may change in future versions.
╵
╷
│ Error: Missing required argument
│
│ with aws_vpc.this,
│ on generated_resources.tf line 12:
│ (source code not available)
│
│ "ipv6_netmask_length": all of `ipv6_ipam_pool_id,ipv6_netmask_length` must be specified
Expected Behavior
No error
Actual Behavior
get error
╷
│ Error: Missing required argument
│
│ with aws_vpc.this,
│ on generated_resources.tf line 12:
│ (source code not available)
│
│ "ipv6_netmask_length": all of `ipv6_ipam_pool_id,ipv6_netmask_length` must be specified
Steps to Reproduce
$ cat import.tf
import {
id = "vpc-81939bxx" # Resource ID in the cloud
to = aws_vpc.this# Resource address in OpenTofu configuration
}
$ terraform plan -generate-config-out=generated_resources.tf
Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.
Volunteering to Work on This Issue
If you are interested in working on this issue, please leave a comment.
If this would be your first contribution, please review the contribution guide.
Description
Terraform Version
Terraform Configuration Files
Debug Output
Expected Behavior
No error
Actual Behavior
get error
Steps to Reproduce
Additional Context
No response
References
No response
References
https://developer.hashicorp.com/terraform/language/import/generating-configuration
Would you like to implement a fix?
None
ref: https://github.com/hashicorp/terraform/issues/35227#issuecomment-2164961766