Skip to content

Commit

Permalink
Fixed auto stop timeout issue
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ianbinder authored Jun 30, 2020
1 parent b59584c commit 29a5c0b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions aws/resource_aws_workspaces_workspace.go
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ func resourceAwsWorkspacesWorkspaceUpdate(d *schema.ResourceData, meta interface
}
}

if d.HasChange("workspace_properties.0.running_mode_auto_stop_timeout_in_minutes") || (d.Get("workspace_properties.0.running_mode") != "ALWAYS_ON") {
if d.HasChange("workspace_properties.0.running_mode_auto_stop_timeout_in_minutes") || (d.Get("workspace_properties.0.running_mode") != workspaces.RunningModeAlwaysOn) {
if err := workspacePropertyUpdate("running_mode_auto_stop_timeout_in_minutes", conn, d); err != nil {
return err
}
Expand Down Expand Up @@ -366,7 +366,7 @@ func expandWorkspaceProperties(properties []interface{}) *workspaces.WorkspacePr

p := properties[0].(map[string]interface{})

if p["running_mode"] == "ALWAYS_ON" {
if p["running_mode"] == workspaces.RunningModeAlwaysOn {
return &workspaces.WorkspaceProperties{
ComputeTypeName: aws.String(p["compute_type_name"].(string)),
RootVolumeSizeGib: aws.Int64(int64(p["root_volume_size_gib"].(int))),
Expand Down

0 comments on commit 29a5c0b

Please sign in to comment.