-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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
Remove Multiple Resource Imports #13408
Comments
Affected Resources
|
Reference: #13408 While this resource was not actually performing multiple resource import, the commented code was showing up in searches for it (via `.SetType()`). As an added bonus to the dramatically simpler code (since Terraform automatic refresh during import), this removes the legacy `import_` file. Yay! Output from acceptance testing (see #13382 for fixes to _SubnetsChange and _SubnetsDelete tests): ``` --- PASS: TestAccAWSNetworkAcl_espProtocol (34.51s) --- PASS: TestAccAWSNetworkAcl_basic (35.15s) --- PASS: TestAccAWSNetworkAcl_ipv6ICMPRules (36.21s) --- PASS: TestAccAWSNetworkAcl_OnlyEgressRules (37.51s) --- PASS: TestAccAWSNetworkAcl_disappears (37.95s) --- PASS: TestAccAWSNetworkAcl_EgressAndIngressRules (38.20s) --- PASS: TestAccAWSNetworkAcl_ipv6VpcRules (38.68s) --- PASS: TestAccAWSNetworkAcl_ipv6Rules (44.12s) --- PASS: TestAccAWSNetworkAcl_OnlyIngressRules_basic (44.86s) --- PASS: TestAccAWSNetworkAcl_CaseSensitivityNoChanges (45.01s) --- FAIL: TestAccAWSNetworkAcl_SubnetsDelete (55.50s) --- PASS: TestAccAWSNetworkAcl_OnlyIngressRules_update (65.91s) --- PASS: TestAccAWSNetworkAcl_SubnetChange (66.79s) --- PASS: TestAccAWSNetworkAcl_Egress_ConfigMode (74.44s) --- PASS: TestAccAWSNetworkAcl_Subnets (75.89s) --- PASS: TestAccAWSNetworkAcl_Ingress_ConfigMode (76.75s) ```
Reference: #13408 While this resource was not actually performing multiple resource import, the commented code was showing up in searches for it (via `.SetType()`). As an added bonus to the dramatically simpler code (since Terraform automatic refresh during import), this removes the legacy `import_` file. Yay! Output from acceptance testing (see #13382 for fixes to _SubnetsChange and _SubnetsDelete tests): ``` --- PASS: TestAccAWSNetworkAcl_espProtocol (34.51s) --- PASS: TestAccAWSNetworkAcl_basic (35.15s) --- PASS: TestAccAWSNetworkAcl_ipv6ICMPRules (36.21s) --- PASS: TestAccAWSNetworkAcl_OnlyEgressRules (37.51s) --- PASS: TestAccAWSNetworkAcl_disappears (37.95s) --- PASS: TestAccAWSNetworkAcl_EgressAndIngressRules (38.20s) --- PASS: TestAccAWSNetworkAcl_ipv6VpcRules (38.68s) --- PASS: TestAccAWSNetworkAcl_ipv6Rules (44.12s) --- PASS: TestAccAWSNetworkAcl_OnlyIngressRules_basic (44.86s) --- PASS: TestAccAWSNetworkAcl_CaseSensitivityNoChanges (45.01s) --- FAIL: TestAccAWSNetworkAcl_SubnetsDelete (55.50s) --- PASS: TestAccAWSNetworkAcl_OnlyIngressRules_update (65.91s) --- PASS: TestAccAWSNetworkAcl_SubnetChange (66.79s) --- PASS: TestAccAWSNetworkAcl_Egress_ConfigMode (74.44s) --- PASS: TestAccAWSNetworkAcl_Subnets (75.89s) --- PASS: TestAccAWSNetworkAcl_Ingress_ConfigMode (76.75s) ```
…p#13419) Reference: hashicorp#13408 While this resource was not actually performing multiple resource import, the commented code was showing up in searches for it (via `.SetType()`). As an added bonus to the dramatically simpler code (since Terraform automatic refresh during import), this removes the legacy `import_` file. Yay! Output from acceptance testing (see hashicorp#13382 for fixes to _SubnetsChange and _SubnetsDelete tests): ``` --- PASS: TestAccAWSNetworkAcl_espProtocol (34.51s) --- PASS: TestAccAWSNetworkAcl_basic (35.15s) --- PASS: TestAccAWSNetworkAcl_ipv6ICMPRules (36.21s) --- PASS: TestAccAWSNetworkAcl_OnlyEgressRules (37.51s) --- PASS: TestAccAWSNetworkAcl_disappears (37.95s) --- PASS: TestAccAWSNetworkAcl_EgressAndIngressRules (38.20s) --- PASS: TestAccAWSNetworkAcl_ipv6VpcRules (38.68s) --- PASS: TestAccAWSNetworkAcl_ipv6Rules (44.12s) --- PASS: TestAccAWSNetworkAcl_OnlyIngressRules_basic (44.86s) --- PASS: TestAccAWSNetworkAcl_CaseSensitivityNoChanges (45.01s) --- FAIL: TestAccAWSNetworkAcl_SubnetsDelete (55.50s) --- PASS: TestAccAWSNetworkAcl_OnlyIngressRules_update (65.91s) --- PASS: TestAccAWSNetworkAcl_SubnetChange (66.79s) --- PASS: TestAccAWSNetworkAcl_Egress_ConfigMode (74.44s) --- PASS: TestAccAWSNetworkAcl_Subnets (75.89s) --- PASS: TestAccAWSNetworkAcl_Ingress_ConfigMode (76.75s) ```
…import Reference: #13408 Output from acceptance testing: ``` --- PASS: TestAccAwsDxGateway_basic (54.91s) --- PASS: TestAccAwsDxGateway_complex (2018.49s) ```
closing since the referenced resources and their respective PRs are now merged and will be released with |
This has been released in version 3.0.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template for triage. Thanks! |
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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks! |
Community Note
Description
The Terraform Plugin SDK supports importing the state of multiple resources in
helper/schema.Resource.Importer.State
functions. These new additional resources imported cannot have their state references controlled by the practitioner, risking API deletion in the next Terraform run unless the Terraform configuration is carefully updated to match the secondary resource import structure. This is a tedious and error prone process, especially for newer practitioners. Terraform may also not have access to these secondary resources during import, returning unexpected and unavoidable errors. Given all this, practitioners have come to expect that Terraform resource imports only do the resource given.Practitioner Impact
References
The text was updated successfully, but these errors were encountered: