hashicorp / terraform-provider-aws

The AWS Provider enables Terraform to manage AWS resources.
https://registry.terraform.io/providers/hashicorp/aws
Mozilla Public License 2.0
9.84k stars 9.19k forks source link

[Enhancement]: aws_sagemaker_domain add idle shutdown options for JupyterLab and CodeEditor #39521

Closed jmeisele closed 4 weeks ago

jmeisele commented 1 month ago

Description

AWS Announced the ability to natively set idle timeout options for both JupyterLab and CodeEditor. Can be a value between integer 60 - 525600. This is time measured in minutes

Affected Resource(s) and/or Data Source(s)

aws_sagemaker_domain

Potential Terraform Configuration

resource "aws_sagemaker_domain" "example" {
  // ...

  default_space_settings {
    jupyter_lab_app_settings {
      app_lifecycle_management {
        idle_settings {
          lifecycle_management = "ENABLED"
          idle_timeout_in_minutes = 60
          min_idle_timeout_in_minutes = 45
          max_idle_timeout_in_minutes = 90
          }
       }
    }  
  }

  default_user_settings {
    // ...

    jupyter_lab_app_settings {
      app_lifecycle_management {
        idle_settings {
          lifecycle_management = "ENABLED"
          idle_timeout_in_minutes = 60
          min_idle_timeout_in_minutes = 45
          max_idle_timeout_in_minutes = 90
          }
       }
    }  

    code_editor_app_settings {
      app_lifecycle_management {
        idle_settings {
          lifecycle_management = "ENABLED"
          idle_timeout_in_minutes = 60
          min_idle_timeout_in_minutes = 45
          max_idle_timeout_in_minutes = 90
        }
     }
    }
  }
}

References

https://aws.amazon.com/about-aws/whats-new/2024/09/amazon-sagemaker-studio-automatic-shutdown-idle-applications/

https://docs.aws.amazon.com/sagemaker/latest/dg/studio-updated-idle-shutdown-setup.html

https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_IdleSettings.html

Would you like to implement a fix?

No

github-actions[bot] commented 1 month ago

Community Note

Voting for Prioritization

Volunteering to Work on This Issue

philipgebus commented 1 month ago

Hi @jmeisele,

thank you for creating this feature request!

According to the Sagemaker CreateDomain API, there are also two additional attributes MinIdleTimeoutInMinutes, MaxIdleTimeoutInMinutes, which could be implemented in the same go. The idle config is nested within a AppLifecycleManagement block and it would be awesome to have this feature for jupyterlab shared spaces as well. As all of the previously mentioned aspects affect the same resource (aws_sagemaker_domain) and the same feature, would you mind adjusting the potential terraform config section of your issue as follows:

resource "aws_sagemaker_domain" "example" {
  // ...

  default_space_settings {
    jupyter_lab_app_settings {
      app_lifecycle_management {
        idle_settings {
          lifecycle_management = "ENABLED"
          idle_timeout_in_minutes = 60
          min_idle_timeout_in_minutes = 45
          max_idle_timeout_in_minutes = 90
          }
       }
    }  
  }

  default_user_settings {
    // ...

    jupyter_lab_app_settings {
      app_lifecycle_management {
        idle_settings {
          lifecycle_management = "ENABLED"
          idle_timeout_in_minutes = 60
          min_idle_timeout_in_minutes = 45
          max_idle_timeout_in_minutes = 90
          }
       }
    }  

    code_editor_app_settings {
      app_lifecycle_management {
        idle_settings {
          lifecycle_management = "ENABLED"
          idle_timeout_in_minutes = 60
          min_idle_timeout_in_minutes = 45
          max_idle_timeout_in_minutes = 90
        }
     }
    }
  }
}
jmeisele commented 1 month ago

@philipgebus absolutely, thank you for the second set of eyes on the potential TF resource config. Updated the proposed terraform configuration 🤝

DrFaust92 commented 4 weeks ago

Ill take a crack at this

github-actions[bot] commented 4 weeks ago

[!WARNING] This issue has been closed, meaning that any additional comments are hard for our team to see. Please assume that the maintainers will not see them.

Ongoing conversations amongst community members are welcome, however, the issue will be locked after 30 days. Moving conversations to another venue, such as the AWS Provider forum, is recommended. If you have additional concerns, please open a new issue, referencing this one where needed.

github-actions[bot] commented 3 weeks ago

This functionality has been released in v5.73.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. Thank you!