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

Refactor WorkSpaces resources to use keyvaluetags package #11645

Merged
merged 2 commits into from
Mar 6, 2020

Conversation

ewbankkit
Copy link
Contributor

@ewbankkit ewbankkit commented Jan 17, 2020

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" or other comments that do not add relevant new information or questions, they generate extra noise for pull request followers and do not help prioritize the request

Relates #10688.

Release note for CHANGELOG:

NONE

Output from acceptance testing:

$ make testacc TEST=./aws/ TESTARGS='-run=TestAccAwsWorkspacesIpGroup_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws/ -v -count 1 -parallel 20 -run=TestAccAwsWorkspacesIpGroup_ -timeout 120m
=== RUN   TestAccAwsWorkspacesIpGroup_basic
=== PAUSE TestAccAwsWorkspacesIpGroup_basic
=== CONT  TestAccAwsWorkspacesIpGroup_basic
--- PASS: TestAccAwsWorkspacesIpGroup_basic (44.39s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	44.423s
$ make testacc TEST=./aws/ TESTARGS='-run=TestAccAwsWorkspacesDirectory'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws/ -v -count 1 -parallel 20 -run=TestAccAwsWorkspacesDirectory -timeout 120m
=== RUN   TestAccAwsWorkspacesDirectory
=== RUN   TestAccAwsWorkspacesDirectory/basic
=== RUN   TestAccAwsWorkspacesDirectory/subnetIds
--- PASS: TestAccAwsWorkspacesDirectory (1464.50s)
    --- PASS: TestAccAwsWorkspacesDirectory/basic (852.48s)
    --- PASS: TestAccAwsWorkspacesDirectory/subnetIds (612.02s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	1464.541s

@ewbankkit ewbankkit requested a review from a team January 17, 2020 19:37
@ghost ghost added size/M Managed by automation to categorize the size of a PR. needs-triage Waiting for first response or review from a maintainer. service/iam Issues and PRs that pertain to the iam service. service/workspaces Issues and PRs that pertain to the workspaces service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels Jan 17, 2020
@ewbankkit

This comment has been minimized.

@ewbankkit ewbankkit changed the title Refactor WorkSpaces resources to use keyvaluetags package [WIP] Refactor WorkSpaces resources to use keyvaluetags package Jan 22, 2020
@ghost ghost added size/L Managed by automation to categorize the size of a PR. and removed size/M Managed by automation to categorize the size of a PR. labels Feb 8, 2020
@ghost ghost added size/XL Managed by automation to categorize the size of a PR. and removed size/L Managed by automation to categorize the size of a PR. labels Feb 9, 2020
@ewbankkit ewbankkit changed the title [WIP] Refactor WorkSpaces resources to use keyvaluetags package Refactor WorkSpaces resources to use keyvaluetags package Feb 9, 2020
@ewbankkit
Copy link
Contributor Author

ewbankkit commented Feb 9, 2020

Tested with ignore_tags functionality to verify that tag updating works when there are ignored tags.

Acceptance tests:

$ make testacc TEST=./aws/ TESTARGS='-run=TestAccAwsWorkspacesIpGroup_ignoreTags'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws/ -v -count 1 -parallel 20 -run=TestAccAwsWorkspacesIpGroup_ignoreTags -timeout 120m
=== RUN   TestAccAwsWorkspacesIpGroup_ignoreTags
=== PAUSE TestAccAwsWorkspacesIpGroup_ignoreTags
=== CONT  TestAccAwsWorkspacesIpGroup_ignoreTags
--- PASS: TestAccAwsWorkspacesIpGroup_ignoreTags (37.95s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	38.002s
$ make testacc TEST=./aws/ TESTARGS='-run=TestAccAwsWorkspacesDirectory/ignoreTags'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws/ -v -count 1 -parallel 20 -run=TestAccAwsWorkspacesDirectory/ignoreTags -timeout 120m
=== RUN   TestAccAwsWorkspacesDirectory
=== RUN   TestAccAwsWorkspacesDirectory/ignoreTags
--- PASS: TestAccAwsWorkspacesDirectory (947.18s)
    --- PASS: TestAccAwsWorkspacesDirectory/ignoreTags (947.18s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	947.249s

@@ -140,6 +140,8 @@ func resourceAwsWorkspacesDirectoryCreate(d *schema.ResourceData, meta interface

func resourceAwsWorkspacesDirectoryRead(d *schema.ResourceData, meta interface{}) error {
conn := meta.(*AWSClient).workspacesconn
ignoreTags := meta.(*AWSClient).ignoreTags
Copy link
Contributor

Choose a reason for hiding this comment

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

Hi @ewbankkit 👋 We would prefer to not add resources/logic to the ignore_tags preview at this time. We are finishing up a round of feedback on the functionality, so the implementation may change.

Copy link
Contributor Author

@ewbankkit ewbankkit Feb 11, 2020

Choose a reason for hiding this comment

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

@bflad I was using the ignore_tags functionality to test the claim of the CreateTags API:

If you want to add new tags to a set of existing tags, you must submit all of the existing tags along with the new ones.

by having tags that are not managed by Terraform and seeing if they get removed when updating tags via Terraform (it turns out they don't, so the API in fact doesn't overwrite any existing tags).
I'll change this PR to WIP and remove the ignore_tags stuff.
I'll use the same approach to test the S3 object tagging functionality in #11964 but again not leave the changes in the final PR.

@ewbankkit ewbankkit changed the title Refactor WorkSpaces resources to use keyvaluetags package [WIP] Refactor WorkSpaces resources to use keyvaluetags package Feb 11, 2020
@ghost ghost added size/L Managed by automation to categorize the size of a PR. and removed size/XL Managed by automation to categorize the size of a PR. labels Feb 12, 2020
@ewbankkit ewbankkit changed the title [WIP] Refactor WorkSpaces resources to use keyvaluetags package Refactor WorkSpaces resources to use keyvaluetags package Feb 12, 2020
@ewbankkit
Copy link
Contributor Author

OK, removed the ignore_tags changes as mentioned in the review comments above.
Re-ran acceptance tests:

$ make testacc TEST=./aws/ TESTARGS='-run=TestAccAwsWorkspacesIpGroup_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws/ -v -count 1 -parallel 20 -run=TestAccAwsWorkspacesIpGroup_ -timeout 120m
=== RUN   TestAccAwsWorkspacesIpGroup_basic
=== PAUSE TestAccAwsWorkspacesIpGroup_basic
=== CONT  TestAccAwsWorkspacesIpGroup_basic
--- PASS: TestAccAwsWorkspacesIpGroup_basic (44.64s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	44.684s
$ make testacc TEST=./aws/ TESTARGS='-run=TestAccAwsWorkspacesDirectory'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws/ -v -count 1 -parallel 20 -run=TestAccAwsWorkspacesDirectory -timeout 120m
=== RUN   TestAccAwsWorkspacesDirectory
=== RUN   TestAccAwsWorkspacesDirectory/basic
=== RUN   TestAccAwsWorkspacesDirectory/subnetIds
--- PASS: TestAccAwsWorkspacesDirectory (1398.14s)
    --- PASS: TestAccAwsWorkspacesDirectory/basic (788.30s)
    --- PASS: TestAccAwsWorkspacesDirectory/subnetIds (609.84s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	1398.189s

Removing WIP.

@ewbankkit
Copy link
Contributor Author

Rebased to remove merge conflicts.
Re-ran acceptance tests:

$ make testacc TEST=./aws/ TESTARGS='-run=TestAccAwsWorkspacesIpGroup_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws/ -v -count 1 -parallel 20 -run=TestAccAwsWorkspacesIpGroup_ -timeout 120m
=== RUN   TestAccAwsWorkspacesIpGroup_basic
=== PAUSE TestAccAwsWorkspacesIpGroup_basic
=== CONT  TestAccAwsWorkspacesIpGroup_basic
--- PASS: TestAccAwsWorkspacesIpGroup_basic (45.06s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	45.101s
$ make testacc TEST=./aws/ TESTARGS='-run=TestAccAwsWorkspacesDirectory'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws/ -v -count 1 -parallel 20 -run=TestAccAwsWorkspacesDirectory -timeout 120m
=== RUN   TestAccAwsWorkspacesDirectory
=== RUN   TestAccAwsWorkspacesDirectory/basic
=== RUN   TestAccAwsWorkspacesDirectory/disappears
=== RUN   TestAccAwsWorkspacesDirectory/subnetIds
--- PASS: TestAccAwsWorkspacesDirectory (1847.66s)
    --- PASS: TestAccAwsWorkspacesDirectory/basic (651.98s)
    --- PASS: TestAccAwsWorkspacesDirectory/disappears (596.50s)
    --- PASS: TestAccAwsWorkspacesDirectory/subnetIds (599.17s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	1847.706s

… that doesn't change across update.

$ make testacc TEST=./aws/ TESTARGS='-run=TestAccAwsWorkspacesIpGroup_basic'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws/ -v -count 1 -parallel 20 -run=TestAccAwsWorkspacesIpGroup_basic -timeout 120m
=== RUN   TestAccAwsWorkspacesIpGroup_basic
=== PAUSE TestAccAwsWorkspacesIpGroup_basic
=== CONT  TestAccAwsWorkspacesIpGroup_basic
--- PASS: TestAccAwsWorkspacesIpGroup_basic (45.42s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	45.454s
…sion.

Acceptance test output:

$ make testacc TEST=./aws/ TESTARGS='-run=TestAccAwsWorkspacesDirectory/basic'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws/ -v -count 1 -parallel 20 -run=TestAccAwsWorkspacesDirectory/basic -timeout 120m
=== RUN   TestAccAwsWorkspacesDirectory
=== RUN   TestAccAwsWorkspacesDirectory/basic
--- PASS: TestAccAwsWorkspacesDirectory (661.39s)
    --- PASS: TestAccAwsWorkspacesDirectory/basic (661.39s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	661.429s
@ewbankkit
Copy link
Contributor Author

Rebased to include ef098db and pass linting.

@bflad bflad removed the needs-triage Waiting for first response or review from a maintainer. label Mar 6, 2020
@bflad bflad self-assigned this Mar 6, 2020
@bflad bflad added this to the v2.53.0 milestone Mar 6, 2020
Copy link
Contributor

@bflad bflad left a comment

Choose a reason for hiding this comment

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

Looks great, thanks @ewbankkit 🚀

Output from acceptance testing:

--- PASS: TestAccAwsWorkspacesIpGroup_basic (14.01s)
--- PASS: TestAccAwsWorkspacesDirectory (1809.78s)
    --- PASS: TestAccAwsWorkspacesDirectory/disappears (662.61s)
    --- PASS: TestAccAwsWorkspacesDirectory/subnetIds (561.97s)
    --- PASS: TestAccAwsWorkspacesDirectory/basic (585.20s)

@bflad bflad merged commit 02cdaf9 into hashicorp:master Mar 6, 2020
@ewbankkit ewbankkit deleted the workspaces-keyvaluetags branch March 6, 2020 20:22
@ghost
Copy link

ghost commented Mar 12, 2020

This has been released in version 2.53.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 Apr 6, 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 Apr 6, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
service/iam Issues and PRs that pertain to the iam service. service/workspaces Issues and PRs that pertain to the workspaces service. size/L Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants