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

AWS Workspaces fix for issue 13558 #13976

Merged
merged 3 commits into from
Sep 1, 2020

Conversation

ianbinder
Copy link
Contributor

@ianbinder ianbinder commented Jun 28, 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 OR Closes #13558

Release note for CHANGELOG:

This is my first submission to any project, ever. Please forgive sloppiness. I appreciate any feedback. I just made some small changes to the existing document to allow workspaces with the ALWAYS_ON to be created and updated. These changes include skipping updating the running_mode_auto_stop_timeout_in_minutes property if the running_mode is set to ALWAYS_ON and removing running_mode_auto_stop_timeout_in_minutes from the extended properties used in creation if the running_mode is set to ALWAYS_ON.

Test results:

ian@UbuntuNUC:~/development/terraform-providers/terraform-provider-aws$ make testacc TEST=./aws TESTARGS='-run=TestAccAwsWorkspacesWorkspace*'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAwsWorkspacesWorkspace* -timeout 120m
=== RUN TestAccAwsWorkspacesWorkspace_basic
=== PAUSE TestAccAwsWorkspacesWorkspace_basic
=== RUN TestAccAwsWorkspacesWorkspace_tags
=== PAUSE TestAccAwsWorkspacesWorkspace_tags
=== RUN TestAccAwsWorkspacesWorkspace_workspaceProperties
=== PAUSE TestAccAwsWorkspacesWorkspace_workspaceProperties
=== RUN TestAccAwsWorkspacesWorkspace_validateRootVolumeSize
=== PAUSE TestAccAwsWorkspacesWorkspace_validateRootVolumeSize
=== RUN TestAccAwsWorkspacesWorkspace_validateUserVolumeSize
=== PAUSE TestAccAwsWorkspacesWorkspace_validateUserVolumeSize
=== CONT TestAccAwsWorkspacesWorkspace_basic
=== CONT TestAccAwsWorkspacesWorkspace_validateRootVolumeSize
=== CONT TestAccAwsWorkspacesWorkspace_workspaceProperties
=== CONT TestAccAwsWorkspacesWorkspace_validateUserVolumeSize
=== CONT TestAccAwsWorkspacesWorkspace_tags
--- PASS: TestAccAwsWorkspacesWorkspace_validateRootVolumeSize (2.83s)
--- PASS: TestAccAwsWorkspacesWorkspace_validateUserVolumeSize (2.84s)
--- PASS: TestAccAwsWorkspacesWorkspace_tags (1820.33s)
--- PASS: TestAccAwsWorkspacesWorkspace_basic (1833.78s)
--- PASS: TestAccAwsWorkspacesWorkspace_workspaceProperties (1928.77s)
PASS
ok github.com/terraform-providers/terraform-provider-aws/aws 1928.844s

@ianbinder ianbinder requested a review from a team June 28, 2020 17:53
@ghost ghost added size/XS Managed by automation to categorize the size of a PR. needs-triage Waiting for first response or review from a maintainer. service/workspaces Issues and PRs that pertain to the workspaces service. labels Jun 28, 2020
expandWorkspaceProperties now leaves out auto stop timeout in minutes if instance should be always on. Updates for running_mode_auto_stop_timeout_in_minutes changes don't apply if running mode is always on.
@breathingdust breathingdust added bug Addresses a defect in current functionality. and removed needs-triage Waiting for first response or review from a maintainer. labels Jul 3, 2020
@cwebster2
Copy link
Contributor

cwebster2 commented Aug 4, 2020

Any word on when this will be merged? Just ran into this bug and is blocking our use of terraform to manage workspaces.

This is 100% a bug, without this code, you cannot make aws workspaces with ALWAYS_ON using terraform.

Copy link
Contributor

@anGie44 anGie44 left a comment

Choose a reason for hiding this comment

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

Hi @ianbinder, thank you for this contribution! it's off to a great start :) i've added a couple comments for review. also, since the changes affect resource creation behavior, do you mind also adding a new acceptance test to the suite of tests found in aws/resource_aws_workspaces_workspace_test.go? a good example is covered in the TestAccAwsWorkspacesWorkspace_workspaceProperties test such that the second step there, defined @ L173, references a test configuration (testAccWorkspacesWorkspaceConfig_WorkspacePropertiesB) that would illustrate resource creation with the running_mode set to ALWAYS_ON. you could re-use that config in a separate test with a structure similar to TestAccAwsWorkspacesWorkspace_basic. Please let me know if you have any questions regarding testing or if I can assist in any way. also feel free to refer to this guide for more info regarding best practices https://github.com/terraform-providers/terraform-provider-aws/blob/master/docs/contributing/running-and-writing-acceptance-tests.md#resource-acceptance-testing

aws/resource_aws_workspaces_workspace.go Outdated Show resolved Hide resolved
aws/resource_aws_workspaces_workspace.go Outdated Show resolved Hide resolved
@anGie44 anGie44 added the waiting-response Maintainers are waiting on response from community or contributor. label Aug 12, 2020
@ghost ghost added tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. size/S Managed by automation to categorize the size of a PR. and removed size/XS Managed by automation to categorize the size of a PR. labels Aug 26, 2020
@anGie44
Copy link
Contributor

anGie44 commented Aug 26, 2020

Hi @ianbinder 👋 thanks again for this PR! Just dropping a note here that I've added a commit to continue the work here, as our general response time from community PRs is 2 weeks, and hope to get these changes into an upcoming release of the provider :) if you have any questions, please let us know!

@anGie44 anGie44 removed the waiting-response Maintainers are waiting on response from community or contributor. label Aug 26, 2020
@anGie44
Copy link
Contributor

anGie44 commented Aug 26, 2020

Output of new acceptance test:

--- PASS: TestAccAwsWorkspacesWorkspace_workspaceProperties_runningModeAlwaysOn (1824.24s)

@anGie44 anGie44 requested a review from a team August 26, 2020 20:34
@ianbinder
Copy link
Contributor Author

ianbinder commented Aug 27, 2020 via email

@bflad bflad self-assigned this Aug 31, 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 good to me 🚀

Output from acceptance testing (test failure unrelated and bounces between tests -- we probably should ensure there's an issue to fix it):

--- FAIL: TestAccAwsWorkspacesWorkspace_workspaceProperties_runningModeAlwaysOn (1881.40s)
TestAccAwsWorkspacesWorkspace_workspaceProperties_runningModeAlwaysOn: testing_new.go:22: WARNING: destroy failed, so remote objects may still exist and be subject to billing
TestAccAwsWorkspacesWorkspace_workspaceProperties_runningModeAlwaysOn: testing_new.go:22: failed to destroy: terraform failed: exit status 1
stderr:
Error: workspace "ws-043rdz79f" was not terminated: couldn't find resource (21 retries)

--- PASS: TestAccAwsWorkspacesWorkspace_validateRootVolumeSize (2.34s)
--- PASS: TestAccAwsWorkspacesWorkspace_validateUserVolumeSize (2.54s)
--- PASS: TestAccAwsWorkspacesWorkspace_basic (1399.75s)
--- PASS: TestAccAwsWorkspacesWorkspace_tags (1963.69s)
--- PASS: TestAccAwsWorkspacesWorkspace_workspaceProperties (1976.76s)

--- FAIL: TestAccAwsWorkspacesWorkspace_workspaceProperties (1726.72s)
TestAccAwsWorkspacesWorkspace_workspaceProperties: testing_new.go:22: WARNING: destroy failed, so remote objects may still exist and be subject to billing
TestAccAwsWorkspacesWorkspace_workspaceProperties: testing_new.go:22: failed to destroy: terraform failed: exit status 1
stderr:
Error: workspace "ws-8zr606r8v" was not terminated: couldn't find resource (21 retries)

--- PASS: TestAccAwsWorkspacesWorkspace_validateRootVolumeSize (2.26s)
--- PASS: TestAccAwsWorkspacesWorkspace_validateUserVolumeSize (2.64s)
--- PASS: TestAccAwsWorkspacesWorkspace_basic (1692.54s)
--- PASS: TestAccAwsWorkspacesWorkspace_workspaceProperties_runningModeAlwaysOn (1729.15s)
--- PASS: TestAccAwsWorkspacesWorkspace_tags (1761.36s)

@bflad bflad assigned anGie44 and unassigned bflad Sep 1, 2020
@anGie44
Copy link
Contributor

anGie44 commented Sep 1, 2020

Related: #14950

@anGie44 anGie44 added this to the v3.5.0 milestone Sep 1, 2020
@anGie44 anGie44 merged commit 509a1e9 into hashicorp:master Sep 1, 2020
anGie44 added a commit that referenced this pull request Sep 1, 2020
@ghost
Copy link

ghost commented Sep 3, 2020

This has been released in version 3.5.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 Oct 1, 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 as resolved and limited conversation to collaborators Oct 1, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. service/workspaces Issues and PRs that pertain to the workspaces service. size/S 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.

aws_workspaces_workspace can't apply with "ALWAYS_ON" running_mode
5 participants