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

fix: update comparison #40953

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

stefanfreitag
Copy link
Contributor

@stefanfreitag stefanfreitag commented Jan 15, 2025

Description

As described in #40580 updates to the value of running_mode_auto_stop_timeout_in_minutes in the resource aws_workspaces_workspace are not forwarded to the AWS Go SDK v2.

Example configuration of the resource:

resource "aws_workspaces_workspace" "workspace" {
  directory_id = "d-2783a367e8"
  bundle_id    = "wsb-8ry31mu7v"
  user_name    = "john.johnson"

  root_volume_encryption_enabled = true
  user_volume_encryption_enabled = true
  volume_encryption_key          = "arn:aws:kms:us-east-1:012345678912:key/05e668b8-debd-9829-8e18-ad62a787863f"

  workspace_prooperties {
    compute_type_name                 = STANDARD
    root_volume_size_gib              = 80
    user_volume_size_gib              = 10
    running_mode                      = "AUTO_STOP"
    running_mode_auto_stop_in_minutes = 120
  }
}

running_mode is set to "AUTO_STOP", so that the provider should allow updated to running_mode_auto_stop_in_minutes.

In the debug logs of a terraform apply one can actually find below line

2025-01-02T19:35:22.800+0100 [DEBUG] provider.terraform-provider-aws_v5.81.0_x5: [DEBUG] Property running_mode_auto_stop_timeout_in_minutes makes sense only for AUTO_STOP running mode

originating from this source code.

It seems to be the case that a type conversion to string is missing in this code snippet

if d.Get("workspace_properties.0.running_mode") != types.RunningModeAutoStop {
	log.Printf("[DEBUG] Property running_mode_auto_stop_timeout_in_minutes makes sense only for AUTO_STOP running mode")
	return nil
}

types.RunningModeAutoStop should read string(types.RunningModeAutoStop)

Relations

Closes #40580

References

Output from Acceptance Testing

I am not 100% sure what to add here. I think it should be something like below for running all tests related to workspaces

% make testacc TESTS=TestAccWorkSpaces_serial PKG=workspaces

On my end I executed the test testAccWorkspace_workspaceProperties_runningModeAutoStopTimeoutInMinutes, but not other tests/ the whole "suite" because of costs.
Please let me know if that`s fine from your end.

Copy link

Community Note

Voting for Prioritization

  • Please vote on this pull request by adding a 👍 reaction to the original post to help the community and maintainers prioritize this pull request.
  • Please see our prioritization guide for information on how we prioritize.
  • 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.

For Submitters

  • Review the contribution guide relating to the type of change you are making to ensure all of the necessary steps have been taken.
  • For new resources and data sources, use skaff to generate scaffolding with comments detailing common expectations.
  • Whether or not the branch has been rebased will not impact prioritization, but doing so is always a welcome surprise.

@github-actions github-actions bot added service/workspaces Issues and PRs that pertain to the workspaces service. needs-triage Waiting for first response or review from a maintainer. labels Jan 15, 2025
@justinretzolk justinretzolk added bug Addresses a defect in current functionality. and removed needs-triage Waiting for first response or review from a maintainer. labels Jan 16, 2025
@github-actions github-actions bot added the tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. label Jan 21, 2025
@stefanfreitag stefanfreitag marked this pull request as ready for review January 21, 2025 19:08
@stefanfreitag stefanfreitag requested a review from a team as a code owner January 21, 2025 19:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Addresses a defect in current functionality. service/workspaces Issues and PRs that pertain to the workspaces service. 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.

[Bug]: aws_workspaces_workspace running_mode_auto_stop_timeout_in_minutes not updating
2 participants