Skip to content

Latest commit

 

History

History
81 lines (55 loc) · 5.6 KB

restricting-the-idle-timeout-period.md

File metadata and controls

81 lines (55 loc) · 5.6 KB
title shortTitle intro permissions versions type topics product
Restricting the idle timeout period
Restrict timeout periods
You can set a maximum timeout period for any codespaces owned by your organization.
To manage timeout constraints for an organization's codespaces, you must be an owner of the organization.
fpt ghec
*
*
how_to
Codespaces
{% data reusables.gated-features.codespaces-org %}

Overview

By default, codespaces time out after 30 minutes of inactivity. When a codespace times out it is stopped and will no longer incur charges for compute usage.

The personal settings of a {% data variables.product.prodname_dotcom %} user allow them to define their own timeout period for codespaces they create. This may be longer than the default 30-minute period. For more information, see AUTOTITLE.

As an organization owner, you may want to configure constraints on the maximum idle timeout period for codespaces created for repositories owned by your organization. This can help you to limit costs associated with codespaces that are left to timeout after long periods of inactivity. You can set a maximum timeout for the codespaces for all repositories owned by your organization, or for the codespaces of specific repositories.

Note

Maximum idle timeout constraints only apply to codespaces that are owned by your organization.

For more information about pricing for {% data variables.product.prodname_github_codespaces %} compute usage, see AUTOTITLE.

Inactivity defined

{% data reusables.codespaces.inactivity-definition %}

Behavior when you set a maximum idle timeout constraint

If someone sets the default idle timeout to 90 minutes in their personal settings and they then start a codespace for a repository that has a maximum idle timeout constraint of 60 minutes, the codespace will time out after 60 minutes of inactivity. When codespace creation completes, a message explaining this will be displayed:

Idle timeout for this codespace is set to 60 minutes in compliance with your organization’s policy.

Setting organization-wide and repository-specific policies

When you create a policy, you choose whether it applies to all repositories in your organization, or only to specified repositories. If you create an organization-wide policy with a timeout constraint, then the timeout constraints in any policies that are targeted at specific repositories must fall within the restriction configured for the entire organization. The shortest timeout period - in an organization-wide policy, a policy targeted at specified repositories, or in someone's personal settings - is applied.

If you add an organization-wide policy with a timeout constraint, you should set the timeout to the longest acceptable period. You can then add separate policies that set the maximum timeout to a shorter period for specific repositories in your organization.

{% data reusables.codespaces.codespaces-org-policies-note %}

Adding a policy to set a maximum idle timeout period

{% data reusables.profile.access_org %} {% data reusables.profile.org_settings %} {% data reusables.codespaces.codespaces-org-policies %}

  1. Click Add constraint and choose Maximum idle timeout.

  2. Click {% octicon "pencil" aria-label="Edit policy" %} to edit the constraint.

  3. Enter the maximum number of minutes codespaces can remain inactive before they time out, then click Save.

    Screenshot of a dropdown with a field labeled "Maximum value" set to 60 minutes. To the right of the field is a "Save" button.

{% data reusables.codespaces.codespaces-policy-targets %}

  1. If you want to add another constraint to the policy, click Add constraint and choose another constraint. For information about other constraints, see:

  2. After you've finished adding constraints to your policy, click Save.

The policy will be applied to all new codespaces that are billable to your organization. The timeout constraint is also applied to existing codespaces the next time they are started.

Editing a policy

You can edit an existing policy. For example, you may want to add or remove constraints to or from a policy.

  1. Display the "Codespaces policies" page. For more information, see Adding a policy to set a maximum idle timeout period.
  2. Click the name of the policy you want to edit.
  3. Beside the "Maximum idle timeout" constraint, click {% octicon "pencil" aria-label="Edit policy" %}.
  4. Make the required changes then click Save.

Deleting a policy

  1. Display the "Codespaces policies" page. For more information, see Adding a policy to set a maximum idle timeout period. {% data reusables.codespaces.delete-codespace-policy %}