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

resource/aws_vpc: Refactor to use keyvaluetags and call Read after Create #10315

Merged
merged 3 commits into from
Oct 7, 2019

Conversation

bflad
Copy link
Contributor

@bflad bflad commented Oct 1, 2019

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" comments, they generate extra noise for pull request followers and do not help prioritize the request

Reference: #7926

Release note for CHANGELOG:

NONE

First things first, generated the keyvaluetags.Ec2UpdateTags function, which was different enough from the rest of the services to warrant some additional logic in the generator.

In preparation for provider-wide ignore and default tag logic, here we refactor this resource to use the consistent keyvaluetags handling. The previous setTags() logic was always performing retries only necessary for resource creation and not following recommended practices to call the Read function after Create.

Output from acceptance testing:

--- PASS: TestAccAWSVpc_disappears (16.21s)
--- PASS: TestAccAWSVpc_coreMismatchedDiffs (23.55s)
--- PASS: TestAccAWSVpc_DisabledDnsSupport (28.46s)
--- PASS: TestAccAWSVpc_classiclinkOptionSet (28.64s)
--- PASS: TestAccAWSVpc_bothDnsOptionsSet (28.66s)
--- PASS: TestAccAWSVpc_classiclinkDnsSupportOptionSet (29.10s)
--- PASS: TestAccAWSVpc_basic (29.31s)
--- PASS: TestAccAWSVpc_update (40.02s)
--- PASS: TestAccAWSVpc_tags (45.37s)
--- PASS: TestAccAWSVpc_AssignGeneratedIpv6CidrBlock (62.90s)
--- PASS: TestAccAWSVpc_Tenancy (62.94s)

Updated via:

```console
$ make gen
```
…eate

Reference: #7926

In preparation for provider-wide ignore and default tag logic, here we refactor this resource to use the consistent keyvaluetags handling. The previous `setTags()` logic was always performing retries only necessary for resource creation and not following recommended practices to call the `Read` function after `Create`.

Output from acceptance testing:

```
--- PASS: TestAccAWSVpc_disappears (16.21s)
--- PASS: TestAccAWSVpc_coreMismatchedDiffs (23.55s)
--- PASS: TestAccAWSVpc_DisabledDnsSupport (28.46s)
--- PASS: TestAccAWSVpc_classiclinkOptionSet (28.64s)
--- PASS: TestAccAWSVpc_bothDnsOptionsSet (28.66s)
--- PASS: TestAccAWSVpc_classiclinkDnsSupportOptionSet (29.10s)
--- PASS: TestAccAWSVpc_basic (29.31s)
--- PASS: TestAccAWSVpc_update (40.02s)
--- PASS: TestAccAWSVpc_tags (45.37s)
--- PASS: TestAccAWSVpc_AssignGeneratedIpv6CidrBlock (62.90s)
--- PASS: TestAccAWSVpc_Tenancy (62.94s)
```
@bflad bflad added service/ec2 Issues and PRs that pertain to the ec2 service. technical-debt Addresses areas of the codebase that need refactoring or redesign. labels Oct 1, 2019
@bflad bflad requested a review from a team October 1, 2019 02:04
@ghost ghost added the size/L Managed by automation to categorize the size of a PR. label Oct 1, 2019
@ryndaniels ryndaniels self-assigned this Oct 7, 2019
Copy link
Contributor

@ryndaniels ryndaniels left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

Test output:

--- PASS: TestAccAWSVpc_disappears (12.30s)
--- PASS: TestAccAWSVpc_coreMismatchedDiffs (16.61s)
--- PASS: TestAccAWSVpc_classiclinkDnsSupportOptionSet (17.17s)
--- PASS: TestAccAWSVpc_classiclinkOptionSet (17.16s)
--- PASS: TestAccAWSVpc_bothDnsOptionsSet (18.32s)
--- PASS: TestAccAWSVpc_DisabledDnsSupport (20.36s)
--- PASS: TestAccAWSVpc_basic (21.37s)
--- PASS: TestAccAWSVpc_update (24.12s)
--- PASS: TestAccAWSVpc_tags (24.07s)
--- PASS: TestAccAWSVpc_Tenancy (29.81s)
--- PASS: TestAccAWSVpc_AssignGeneratedIpv6CidrBlock (33.69s)

@bflad bflad added this to the v2.32.0 milestone Oct 7, 2019
@bflad bflad merged commit 007e56e into master Oct 7, 2019
@bflad bflad deleted the td-vpc-keyvaluetags branch October 7, 2019 14:03
bflad added a commit that referenced this pull request Oct 7, 2019
…ad after Create

Reference: #7926
Similar in nature to: #10315

In preparation for provider-wide ignore and default tag logic, here we refactor this resource to use the consistent `keyvaluetags` handling. The previous `setTags()` logic was always performing retries only necessary for resource creation and the resource itself was not following recommended practices to call the Read function after Create.

Ouput from acceptance testing:

```
--- PASS: TestAccAWSSubnet_availabilityZoneId (25.22s)
--- PASS: TestAccAWSSubnet_basic (25.66s)
--- PASS: TestAccAWSSubnet_enableIpv6 (41.83s)
--- PASS: TestAccAWSSubnet_ipv6 (66.62s)
```
@ghost
Copy link

ghost commented Oct 10, 2019

This has been released in version 2.32.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!

bflad added a commit that referenced this pull request Oct 25, 2019
…ad after Create (#10411)

Reference: #7926
Similar in nature to: #10315

In preparation for provider-wide ignore and default tag logic, here we refactor this resource to use the consistent `keyvaluetags` handling. The previous `setTags()` logic was always performing retries only necessary for resource creation and the resource itself was not following recommended practices to call the Read function after Create.

Ouput from acceptance testing:

```
--- PASS: TestAccAWSSubnet_availabilityZoneId (25.22s)
--- PASS: TestAccAWSSubnet_basic (25.66s)
--- PASS: TestAccAWSSubnet_enableIpv6 (41.83s)
--- PASS: TestAccAWSSubnet_ipv6 (66.62s)
```
@ghost
Copy link

ghost commented Nov 6, 2019

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 Nov 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
service/ec2 Issues and PRs that pertain to the ec2 service. size/L Managed by automation to categorize the size of a PR. technical-debt Addresses areas of the codebase that need refactoring or redesign.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants