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

Remove Multiple Resource Imports #13408

Closed
breathingdust opened this issue May 20, 2020 · 4 comments
Closed

Remove Multiple Resource Imports #13408

breathingdust opened this issue May 20, 2020 · 4 comments
Assignees
Labels
breaking-change Introduces a breaking change in current functionality; usually deferred to the next major release. technical-debt Addresses areas of the codebase that need refactoring or redesign.
Milestone

Comments

@breathingdust
Copy link
Member

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • 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
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

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

  • Imports will behave differently for the affected resources.

References

@breathingdust breathingdust added breaking-change Introduces a breaking change in current functionality; usually deferred to the next major release. technical-debt Addresses areas of the codebase that need refactoring or redesign. labels May 20, 2020
@breathingdust breathingdust added this to the v3.0.0 milestone May 20, 2020
@bflad
Copy link
Contributor

bflad commented May 20, 2020

Affected Resources

  • aws_dx_gateway_association
  • aws_s3_bucket
  • aws_security_group

bflad added a commit that referenced this issue May 20, 2020
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)
```
bflad added a commit that referenced this issue May 21, 2020
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)
```
adamdecaf pushed a commit to adamdecaf/terraform-provider-aws that referenced this issue May 28, 2020
…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)
```
bflad added a commit that referenced this issue Jul 9, 2020
…import

Reference: #13408

Output from acceptance testing:

```
--- PASS: TestAccAwsDxGateway_basic (54.91s)
--- PASS: TestAccAwsDxGateway_complex (2018.49s)
```
bflad added a commit that referenced this issue Jul 13, 2020
…import (#14124)

Reference: #13408

Output from acceptance testing:

```
--- PASS: TestAccAwsDxGateway_basic (54.91s)
--- PASS: TestAccAwsDxGateway_complex (2018.49s)
```
@anGie44
Copy link
Contributor

anGie44 commented Jul 15, 2020

closing since the referenced resources and their respective PRs are now merged and will be released with v3.0.0 of the Provider

@ghost
Copy link

ghost commented Jul 31, 2020

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!

@ghost
Copy link

ghost commented Aug 15, 2020

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!

@ghost ghost locked and limited conversation to collaborators Aug 15, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
breaking-change Introduces a breaking change in current functionality; usually deferred to the next major release. technical-debt Addresses areas of the codebase that need refactoring or redesign.
Projects
None yet
Development

No branches or pull requests

3 participants