diff --git a/assets/images/help/codespaces/add-constraint-dropdown-retention.png b/assets/images/help/codespaces/add-constraint-dropdown-retention.png new file mode 100644 index 000000000000..f53a802aa375 Binary files /dev/null and b/assets/images/help/codespaces/add-constraint-dropdown-retention.png differ diff --git a/assets/images/help/codespaces/maximum-days-retention.png b/assets/images/help/codespaces/maximum-days-retention.png new file mode 100644 index 000000000000..1e105aec941f Binary files /dev/null and b/assets/images/help/codespaces/maximum-days-retention.png differ diff --git a/assets/images/help/codespaces/retention-deletion-message.png b/assets/images/help/codespaces/retention-deletion-message.png new file mode 100644 index 000000000000..2dfc7958b952 Binary files /dev/null and b/assets/images/help/codespaces/retention-deletion-message.png differ diff --git a/assets/images/help/codespaces/setting-default-retention.png b/assets/images/help/codespaces/setting-default-retention.png new file mode 100644 index 000000000000..6d0eaffa9766 Binary files /dev/null and b/assets/images/help/codespaces/setting-default-retention.png differ diff --git a/assets/images/help/codespaces/vscode-deleting-in-5-days.png b/assets/images/help/codespaces/vscode-deleting-in-5-days.png new file mode 100644 index 000000000000..eac20029c239 Binary files /dev/null and b/assets/images/help/codespaces/vscode-deleting-in-5-days.png differ diff --git a/content/codespaces/customizing-your-codespace/changing-the-machine-type-for-your-codespace.md b/content/codespaces/customizing-your-codespace/changing-the-machine-type-for-your-codespace.md index 58f34d1465ac..1c81797f0843 100644 --- a/content/codespaces/customizing-your-codespace/changing-the-machine-type-for-your-codespace.md +++ b/content/codespaces/customizing-your-codespace/changing-the-machine-type-for-your-codespace.md @@ -10,6 +10,7 @@ redirect_from: - /codespaces/developing-in-codespaces/changing-the-machine-type-for-your-codespace topics: - Codespaces +type: how_to --- ## About machine types diff --git a/content/codespaces/customizing-your-codespace/configuring-automatic-deletion-of-your-codespaces.md b/content/codespaces/customizing-your-codespace/configuring-automatic-deletion-of-your-codespaces.md new file mode 100644 index 000000000000..eec4a59424e4 --- /dev/null +++ b/content/codespaces/customizing-your-codespace/configuring-automatic-deletion-of-your-codespaces.md @@ -0,0 +1,104 @@ +--- +title: Configuring automatic deletion of your codespaces +shortTitle: Configure automatic deletion +intro: 'Unused codespaces are automatically deleted. You can choose how long your stopped codespaces are retained, up to a maximum of 30 days.' +product: '{% data reusables.gated-features.codespaces %}' +versions: + fpt: '*' + ghec: '*' +topics: + - Codespaces +type: how_to +--- + +By default, {% data variables.product.prodname_codespaces %} are automatically deleted after they have been stopped and have remained inactive for 30 days. + +However, because {% data variables.product.prodname_codespaces %} incur storage charges, you may prefer to reduce the retention period by changing your default period in your personal settings for {% data variables.product.prodname_github_codespaces %}. For more information about storage charges, see "[About billing for Codespaces](/billing/managing-billing-for-github-codespaces/about-billing-for-codespaces#codespaces-pricing)." + +{% note %} + +**Note**: Whether or not you have set a personal codespace retention period, it's a good idea to get into the habit of deleting codespaces that you no longer need. For more information, see "[Deleting a codespace](/codespaces/developing-in-codespaces/deleting-a-codespace)." + +{% endnote %} + +Automatic deletion happens irrespective of whether a codespace contains unpushed changes. To prevent automatic deletion of a codespace, just open the codespace again. The retention period is reset every time you connect to a codespace, and the retention countdown restarts when the codespace is stopped. + +If a repository belongs to an organization, the organization admin may have set a retention period for the whole organization. If this period is less than the default retention period in your personal settings then the organization retention period will apply to codespaces you create for this repository. For more information, see "[Restricting the retention period for codespaces](/codespaces/managing-codespaces-for-your-organization/restricting-the-retention-period-for-codespaces)." + +Each codespace has its own retention period. You may, therefore, have codespaces with different rentention periods. For example, if: +* You created a codespace, changed your default retention period, then created another codespace. +* You created a codespace from an organization-owned repository that has a retention period configured for the organization. + +{% note %} + +**Note**: The retention period is specified in days. A day represents a 24-hour period, beginning at the time of day when you stop a codespace. + +{% endnote %} + +{% webui %} + +## Setting a default retention period for your codespaces + +{% data reusables.user-settings.access_settings %} +{% data reusables.user-settings.codespaces-tab %} +1. Under "Default retention period", enter the number of days for which you want your codespaces to be retained, by default, after they have been stopped. + + ![Selecting your retention period](/assets/images/help/codespaces/setting-default-retention.png) + + You can set your default retention period between `0` and `30` days. + + {% warning %} + + **Warning**: Setting the period to `0` will result in your codespaces being immediately deleted when you stop them, or when they timeout due to inactivity. For more information, see "[Setting your timeout period for Codespaces](/codespaces/customizing-your-codespace/setting-your-timeout-period-for-codespaces)." + + {% endwarning %} + +1. Click **Save**. + +This default setting may be superseded by a shorter organization-level retention period. + +If you set a retention period of more than a day, you'll be sent an email notification one day prior to its deletion. + + +## Checking the remaining time until autodeletion + +You can check whether a codespace is due to be automatically deleted soon. + +When an inactive codespace is approaching the end of its retention period, this is indicated in your list of codespaces on {% data variables.product.prodname_dotcom %} at [https://github.com/codespaces](https://github.com/codespaces). + +![The pre-deletion message in the codespaces list on {% data variables.product.prodname_dotcom %}](/assets/images/help/codespaces/retention-deletion-message.png) + + +{% endwebui %} + + + +{% cli %} + +## Setting a retention period for a codespace + +You can set your default retention period in your web browser, on {% data variables.product.prodname_dotcom_the_website %}. For more information, click the "Web browser" tab at the top of this article. + +{% data reusables.cli.cli-learn-more %} + +{% endcli %} + +{% vscode %} + +## Setting the retention period + +You can set your default retention period in your web browser, on {% data variables.product.prodname_dotcom_the_website %}. For more information, click the "Web browser" tab at the top of this article. + +## Checking whether codespaces will be autodeleted soon + +You can check, in the {% data variables.product.prodname_vscode %} desktop application, whether a codespace is due to be automatically deleted soon. + +{% data reusables.codespaces.click-remote-explorer-icon-vscode %} +1. Choose **{% data variables.product.prodname_github_codespaces %}** from the drop-down menu at the top right of the Remote Explorer, if it is not already selected. +1. Under "GITHUB CODESPACES," position the mouse pointer over the codespace that you're interested in. A pop-up box is displayed showing you information about the codespace. + + If the codespace is nearing the end of its retention period, a line is included telling you when the codespace will be deleted. + + ![Codespace information showing the time until deletion](/assets/images/help/codespaces/vscode-deleting-in-5-days.png) + +{% endvscode %} \ No newline at end of file diff --git a/content/codespaces/customizing-your-codespace/index.md b/content/codespaces/customizing-your-codespace/index.md index 426cf1c278e5..f9b94977d535 100644 --- a/content/codespaces/customizing-your-codespace/index.md +++ b/content/codespaces/customizing-your-codespace/index.md @@ -15,5 +15,6 @@ children: - /setting-your-default-editor-for-codespaces - /setting-your-default-region-for-codespaces - /setting-your-timeout-period-for-codespaces + - /configuring-automatic-deletion-of-your-codespaces --- diff --git a/content/codespaces/customizing-your-codespace/personalizing-codespaces-for-your-account.md b/content/codespaces/customizing-your-codespace/personalizing-codespaces-for-your-account.md index 8072baad5e85..e8f16c2e6efc 100644 --- a/content/codespaces/customizing-your-codespace/personalizing-codespaces-for-your-account.md +++ b/content/codespaces/customizing-your-codespace/personalizing-codespaces-for-your-account.md @@ -1,5 +1,6 @@ --- title: Personalizing Codespaces for your account +shortTitle: Personalize your codespaces intro: 'You can personalize {% data variables.product.prodname_codespaces %} by using a `dotfiles` repository on {% data variables.product.product_name %} or by using Settings Sync.' redirect_from: - /github/developing-online-with-github-codespaces/personalizing-github-codespaces-for-your-account @@ -14,7 +15,6 @@ topics: - Set up - Fundamentals product: '{% data reusables.gated-features.codespaces %}' -shortTitle: Personalize your codespaces --- diff --git a/content/codespaces/customizing-your-codespace/setting-your-default-editor-for-codespaces.md b/content/codespaces/customizing-your-codespace/setting-your-default-editor-for-codespaces.md index e25a09d3c5c7..bd388b43d500 100644 --- a/content/codespaces/customizing-your-codespace/setting-your-default-editor-for-codespaces.md +++ b/content/codespaces/customizing-your-codespace/setting-your-default-editor-for-codespaces.md @@ -1,5 +1,6 @@ --- title: Setting your default editor for Codespaces +shortTitle: Set the default editor intro: 'You can set your default editor for {% data variables.product.prodname_codespaces %} in your personal settings page.' product: '{% data reusables.gated-features.codespaces %}' versions: @@ -9,7 +10,7 @@ redirect_from: - /codespaces/managing-your-codespaces/setting-your-default-editor-for-codespaces topics: - Codespaces -shortTitle: Set the default editor +type: how_to --- On the settings page, you can set your editor preference so that any newly created codespaces are opened automatically in either {% data variables.product.prodname_vscode %} for Web or the {% data variables.product.prodname_vscode %} desktop application. diff --git a/content/codespaces/customizing-your-codespace/setting-your-default-region-for-codespaces.md b/content/codespaces/customizing-your-codespace/setting-your-default-region-for-codespaces.md index a04e2eb9ccd2..7ed458b225f8 100644 --- a/content/codespaces/customizing-your-codespace/setting-your-default-region-for-codespaces.md +++ b/content/codespaces/customizing-your-codespace/setting-your-default-region-for-codespaces.md @@ -1,5 +1,6 @@ --- title: Setting your default region for Codespaces +shortTitle: Set the default region intro: 'You can set your default region in the {% data variables.product.prodname_github_codespaces %} profile settings page to personalize where your data is held.' product: '{% data reusables.gated-features.codespaces %}' versions: @@ -9,7 +10,7 @@ redirect_from: - /codespaces/managing-your-codespaces/setting-your-default-region-for-codespaces topics: - Codespaces -shortTitle: Set the default region +type: how_to --- You can manually select the region that your codespaces will be created in, allowing you to meet stringent security and compliance requirements. By default, your region is set automatically, based on your location. diff --git a/content/codespaces/customizing-your-codespace/setting-your-timeout-period-for-codespaces.md b/content/codespaces/customizing-your-codespace/setting-your-timeout-period-for-codespaces.md index 0e53f35f94f4..8655d421fd30 100644 --- a/content/codespaces/customizing-your-codespace/setting-your-timeout-period-for-codespaces.md +++ b/content/codespaces/customizing-your-codespace/setting-your-timeout-period-for-codespaces.md @@ -1,5 +1,6 @@ --- title: Setting your timeout period for Codespaces +shortTitle: Set the timeout intro: 'You can set your default timeout for {% data variables.product.prodname_codespaces %} in your personal settings page.' product: '{% data reusables.gated-features.codespaces %}' versions: @@ -7,7 +8,7 @@ versions: ghec: '*' topics: - Codespaces -shortTitle: Set the timeout +type: how_to --- A codespace will stop running after a period of inactivity. You can specify the length of this timeout period. The updated setting will apply to any newly created codespace. @@ -22,7 +23,7 @@ Some organizations may have a maximum idle timeout policy. If an organization po {% webui %} -## Setting your default timeout +## Setting your default timeout period {% data reusables.user-settings.access_settings %} {% data reusables.user-settings.codespaces-tab %} @@ -33,7 +34,7 @@ Some organizations may have a maximum idle timeout policy. If an organization po {% cli %} -## Setting your timeout period +## Setting the timeout period for a codespace {% data reusables.cli.cli-learn-more %} @@ -46,3 +47,11 @@ gh codespace create --idle-timeout 90m If you don't specify a timeout period when you create a codespace, then the default timeout period will be used. For information about setting a default timeout period, click the "Web browser" tab on this page. You can't currently specify a default timeout period through {% data variables.product.prodname_cli %}. {% endcli %} + +{% vscode %} + +## Setting a timeout period + +You can set your default timeout period in your web browser, on {% data variables.product.prodname_dotcom_the_website %}. Alternatively, if you use {% data variables.product.prodname_cli %} to create a codespace you can set a timeout period for that particular codespace. For more information, click the appropriate tab above. + +{% endvscode %} \ No newline at end of file diff --git a/content/codespaces/guides.md b/content/codespaces/guides.md index 5607e64f4d54..48891ee2763b 100644 --- a/content/codespaces/guides.md +++ b/content/codespaces/guides.md @@ -26,16 +26,26 @@ includeGuides: - /codespaces/developing-in-codespaces/using-source-control-in-your-codespace - /codespaces/developing-in-codespaces/using-codespaces-for-pull-requests - /codespaces/developing-in-codespaces/changing-the-machine-type-for-your-codespace + - /codespaces/customizing-your-codespace/changing-the-machine-type-for-your-codespace + - /codespaces/customizing-your-codespace/configuring-automatic-deletion-of-your-codespaces + - /codespaces/customizing-your-codespace/personalizing-codespaces-for-your-account + - /codespaces/customizing-your-codespace/setting-your-default-editor-for-codespaces + - /codespaces/customizing-your-codespace/setting-your-default-region-for-codespaces + - /codespaces/customizing-your-codespace/setting-your-timeout-period-for-codespaces - /codespaces/managing-your-codespaces/managing-encrypted-secrets-for-your-codespaces - /codespaces/managing-your-codespaces/managing-repository-access-for-your-codespaces - /codespaces/managing-your-codespaces/managing-gpg-verification-for-codespaces - /codespaces/managing-your-codespaces/setting-your-default-editor-for-codespaces - /codespaces/managing-your-codespaces/setting-your-default-region-for-codespaces - - /codespaces/managing-codespaces-for-your-organization/managing-repository-access-for-your-organizations-codespaces - /codespaces/managing-codespaces-for-your-organization/enabling-codespaces-for-your-organization - - /codespaces/managing-codespaces-for-your-organization/reviewing-your-organizations-audit-logs-for-codespaces - /codespaces/managing-codespaces-for-your-organization/managing-billing-for-codespaces-in-your-organization - /codespaces/managing-codespaces-for-your-organization/managing-encrypted-secrets-for-your-repository-and-organization-for-codespaces + - /codespaces/managing-codespaces-for-your-organization/managing-repository-access-for-your-organizations-codespaces + - /codespaces/managing-codespaces-for-your-organization/restricting-access-to-machine-types + - /codespaces/managing-codespaces-for-your-organization/retricting-the-idle-timeout-period + - /codespaces/managing-codespaces-for-your-organization/restricting-the-retention-period-for-codespaces + - /codespaces/managing-codespaces-for-your-organization/restricting-the-visibility-of-forwarded-ports + - /codespaces/managing-codespaces-for-your-organization/reviewing-your-organizations-audit-logs-for-codespaces - /codespaces/codespaces-reference/understanding-billing-for-codespaces - /codespaces/codespaces-reference/using-the-command-palette-in-codespaces - /codespaces/codespaces-reference/disaster-recovery-for-codespaces diff --git a/content/codespaces/managing-codespaces-for-your-organization/index.md b/content/codespaces/managing-codespaces-for-your-organization/index.md index a906ea1613a8..512c9272b0dd 100644 --- a/content/codespaces/managing-codespaces-for-your-organization/index.md +++ b/content/codespaces/managing-codespaces-for-your-organization/index.md @@ -16,6 +16,7 @@ children: - /restricting-access-to-machine-types - /restricting-the-visibility-of-forwarded-ports - /restricting-the-idle-timeout-period + - /restricting-the-retention-period-for-codespaces shortTitle: Managing your organization --- diff --git a/content/codespaces/managing-codespaces-for-your-organization/restricting-access-to-machine-types.md b/content/codespaces/managing-codespaces-for-your-organization/restricting-access-to-machine-types.md index a5f09ce7d268..e17fb7101217 100644 --- a/content/codespaces/managing-codespaces-for-your-organization/restricting-access-to-machine-types.md +++ b/content/codespaces/managing-codespaces-for-your-organization/restricting-access-to-machine-types.md @@ -57,8 +57,8 @@ If you add an organization-wide policy, you should set it to the largest choice ![Edit the machine type constraint](/assets/images/help/codespaces/edit-machine-constraint.png) {% 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 "[Restricting the visibility of forwarded ports](/codespaces/managing-codespaces-for-your-organization/restricting-the-visibility-of-forwarded-ports)" and "[Restricting the idle timeout period](/codespaces/managing-codespaces-for-your-organization/restricting-the-idle-timeout-period)." -1. After you have finished adding constraints to your policy, click **Save**. +1. If you want to add another constraint to the policy, click **Add constraint** and choose another constraint. For information about other constraints, see "[Restricting the visibility of forwarded ports](/codespaces/managing-codespaces-for-your-organization/restricting-the-visibility-of-forwarded-ports)," "[Restricting the idle timeout period](/codespaces/managing-codespaces-for-your-organization/restricting-the-idle-timeout-period)," and "[Restricting the retention period for codespaces](/codespaces/managing-codespaces-for-your-organization/restricting-the-retention-period-for-codespaces)." +1. After you've finished adding constraints to your policy, click **Save**. ## Editing a policy You can edit an existing policy. For example, you may want to add or remove constraints to or from a policy. diff --git a/content/codespaces/managing-codespaces-for-your-organization/restricting-the-idle-timeout-period.md b/content/codespaces/managing-codespaces-for-your-organization/restricting-the-idle-timeout-period.md index 2a2faa2f2f81..4266d62bca5f 100644 --- a/content/codespaces/managing-codespaces-for-your-organization/restricting-the-idle-timeout-period.md +++ b/content/codespaces/managing-codespaces-for-your-organization/restricting-the-idle-timeout-period.md @@ -18,7 +18,7 @@ By default, codespaces time out after 30 minutes of inactivity. When a codespace 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 "[Setting your timeout period for Codespaces](/codespaces/customizing-your-codespace/setting-your-timeout-period-for-codespaces)." -As an organization owner, you may want to configure constraints on the maximum idle timeout period for codespaces owned by your organization. This can help you limit costs associated with codespaces that are left to timeout after long periods of inactivity. You can set a maximum timeout for all codespaces owned by your organization, or for the codespaces of specific repositories. +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 %} @@ -55,11 +55,11 @@ If you add an organization-wide policy with a timeout constraint, you should set 1. Enter the maximum number of minutes codespaces can remain inactive before they time out, then click **Save**. - ![Choose the port visibility options](/assets/images/help/codespaces/maximum-minutes-timeout.png) + ![Set the maximum timeout in minutes](/assets/images/help/codespaces/maximum-minutes-timeout.png) {% 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 "[Restricting access to machine types](/codespaces/managing-codespaces-for-your-organization/restricting-access-to-machine-types)" and "[Restricting the visibility of forwarded ports](/codespaces/managing-codespaces-for-your-organization/restricting-the-visibility-of-forwarded-ports)." -1. After you have finished adding constraints to your policy, click **Save**. +1. If you want to add another constraint to the policy, click **Add constraint** and choose another constraint. For information about other constraints, see "[Restricting access to machine types](/codespaces/managing-codespaces-for-your-organization/restricting-access-to-machine-types)," "[Restricting the visibility of forwarded ports](/codespaces/managing-codespaces-for-your-organization/restricting-the-visibility-of-forwarded-ports)," and "[Restricting the retention period for codespaces](/codespaces/managing-codespaces-for-your-organization/restricting-the-retention-period-for-codespaces)." +1. After you've finished adding constraints to your policy, click **Save**. The policy will be applied to all new codespaces that are created, and to existing codespaces the next time they are started. diff --git a/content/codespaces/managing-codespaces-for-your-organization/restricting-the-retention-period-for-codespaces.md b/content/codespaces/managing-codespaces-for-your-organization/restricting-the-retention-period-for-codespaces.md new file mode 100644 index 000000000000..fa58497c7a94 --- /dev/null +++ b/content/codespaces/managing-codespaces-for-your-organization/restricting-the-retention-period-for-codespaces.md @@ -0,0 +1,78 @@ +--- +title: Restricting the retention period for codespaces +shortTitle: Restrict the retention period +intro: 'You can set a maximum retention period for any codespaces owned by your organization.' +product: '{% data reusables.gated-features.codespaces %}' +permissions: 'To manage retention constraints for an organization''s codespaces, you must be an owner of the organization.' +versions: + fpt: '*' + ghec: '*' +type: how_to +topics: + - Codespaces +--- + +## Overview + +{% data variables.product.prodname_codespaces %} are automatically deleted after they have been stopped and have remained inactive for a defined number of days. The retention period for each codespace is set when the codespace is created and does not change. + +Everyone who has access to {% data variables.product.prodname_github_codespaces %} can configure a retention period for the codespaces they create. The initial setting for this retention period is 30 days. Individual users can set this period within the range 0-30 days. For more information, see "[Configuring automatic deletion of your codespaces](/codespaces/customizing-your-codespace/configuring-automatic-deletion-of-your-codespaces)." + +As an organization owner, you may want to configure constraints on the maximum retention period for codespaces created for the repositories owned by your organization. This can help you to limit the storage costs associated with codespaces that are stopped and then left unused until they are automatically deleted. For more information about storage charges, see "[About billing for Codespaces](/billing/managing-billing-for-github-codespaces/about-billing-for-codespaces#codespaces-pricing)." You can set a maximum retention period for all, or for specific, repositories owned by your organization. + +### 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 codespace retention constraint, then the retention constraints in any policies that are targeted at specific repositories should be shorter than the restriction configured for the entire organization, or they will have no effect. The shortest retention 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 retention constraint, you should set the retention period to the longest acceptable period. You can then add separate policies that set the maximum retention to a shorter period for specific repositories in your organization. + +## Adding a policy to set a maximum codespace retention period + +{% data reusables.profile.access_org %} +{% data reusables.profile.org_settings %} +{% data reusables.codespaces.codespaces-org-policies %} +1. Click **Add constraint** and choose **Retention period**. + + ![Add a constraint for retention periods](/assets/images/help/codespaces/add-constraint-dropdown-retention.png) + +1. Click {% octicon "pencil" aria-label="The edit icon" %} to edit the constraint. + + ![Edit the timeout constraint](/assets/images/help/codespaces/edit-timeout-constraint.png) + +1. Enter the maximum number of days codespaces can remain stopped before they are automatically deleted, then click **Save**. + + ![Set the retention period in days](/assets/images/help/codespaces/maximum-days-retention.png) + + {% note %} + + **Notes**: + * A day, in this context, is a 24-hour period, beginning at the time of day when the codespace was stopped. + * The valid range is 0-30 days. + * Setting the period to `0` will result in codespaces being immediately deleted when they are stopped, or when they timeout due to inactivity. + + {% endnote %} + +{% 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 "[Restricting access to machine types](/codespaces/managing-codespaces-for-your-organization/restricting-access-to-machine-types)," "[Restricting the visibility of forwarded ports](/codespaces/managing-codespaces-for-your-organization/restricting-the-visibility-of-forwarded-ports)," and "[Restricting the idle timeout period](/codespaces/managing-codespaces-for-your-organization/restricting-the-idle-timeout-period)." +1. After you've finished adding constraints to your policy, click **Save**. + +The policy will be applied to all new codespaces that are created. + +## Editing a policy + +You can edit an existing policy. For example, you may want to add or remove constraints to or from a policy. + +The retention period constraint is only applied to codespaces when they are created. Editing a policy has no effect on existing codespaces. + +1. Display the "Codespace policies" page. For more information, see "[Adding a policy to set a maximum codespace retention period](#adding-a-policy-to-set-a-maximum-codespace-retention-period)." +1. Click the name of the policy you want to edit. +1. Make the required changes then click **Save**. + +## Deleting a policy + +You can delete a policy at any time. Deleting a policy has no effect on existing codespaces. + +1. Display the "Codespace policies" page. For more information, see "[Adding a policy to set a maximum codespace retention period](#adding-a-policy-to-set-a-maximum-codespace-retention-period)." +1. Click the delete button to the right of the policy you want to delete. + + ![The delete button for a policy](/assets/images/help/codespaces/policy-delete.png) diff --git a/content/codespaces/managing-codespaces-for-your-organization/restricting-the-visibility-of-forwarded-ports.md b/content/codespaces/managing-codespaces-for-your-organization/restricting-the-visibility-of-forwarded-ports.md index fd2d92acf5ed..85920055fed5 100644 --- a/content/codespaces/managing-codespaces-for-your-organization/restricting-the-visibility-of-forwarded-ports.md +++ b/content/codespaces/managing-codespaces-for-your-organization/restricting-the-visibility-of-forwarded-ports.md @@ -54,8 +54,8 @@ If you add an organization-wide policy, you should set it to the most lenient vi ![Choose the port visibility options](/assets/images/help/codespaces/choose-port-visibility-options.png) {% 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 "[Restricting access to machine types](/codespaces/managing-codespaces-for-your-organization/restricting-access-to-machine-types)" and "[Restricting the idle timeout period](/codespaces/managing-codespaces-for-your-organization/restricting-the-idle-timeout-period)." -1. After you have finished adding constraints to your policy, click **Save**. +1. If you want to add another constraint to the policy, click **Add constraint** and choose another constraint. For information about other constraints, see "[Restricting access to machine types](/codespaces/managing-codespaces-for-your-organization/restricting-access-to-machine-types)," "[Restricting the idle timeout period](/codespaces/managing-codespaces-for-your-organization/restricting-the-idle-timeout-period)," and "[Restricting the retention period for codespaces](/codespaces/managing-codespaces-for-your-organization/restricting-the-retention-period-for-codespaces)." +1. After you've finished adding constraints to your policy, click **Save**. ## Editing a policy You can edit an existing policy. For example, you may want to add or remove constraints to or from a policy. diff --git a/content/education/manage-coursework-with-github-classroom/integrate-github-classroom-with-an-ide/using-github-codespaces-with-github-classroom.md b/content/education/manage-coursework-with-github-classroom/integrate-github-classroom-with-an-ide/using-github-codespaces-with-github-classroom.md index a3093aea42b2..f3f626efa98f 100644 --- a/content/education/manage-coursework-with-github-classroom/integrate-github-classroom-with-an-ide/using-github-codespaces-with-github-classroom.md +++ b/content/education/manage-coursework-with-github-classroom/integrate-github-classroom-with-an-ide/using-github-codespaces-with-github-classroom.md @@ -17,6 +17,12 @@ Setting {% data variables.product.prodname_codespaces %} as the preferred editor For assignments with complex setup environments, teachers can customize the dev container configuration for a repository's codespaces. This ensures that when a student creates a codespace, it automatically opens with the development environment configured by the teacher. For more information on dev containers, see "[Introduction to dev containers](/codespaces/setting-up-your-project-for-codespaces/introduction-to-dev-containers)." +{% note %} + +**Note**: Individual codespaces are automatically deleted if they are stopped and left unused for a prolonged period. For more information, see "[Configuring automatic deletion of your codespaces](/codespaces/customizing-your-codespace/configuring-automatic-deletion-of-your-codespaces)." + +{% endnote %} + ## About the {% data variables.product.prodname_codespaces %} Education benefit for verified teachers The {% data variables.product.prodname_codespaces %} Education benefit gives verified teachers a free monthly allowance of {% data variables.product.prodname_codespaces %} hours to use in {% data variables.product.prodname_classroom %}. The free allowance is estimated to be enough for a class of 50 with 5 assignments per month, on a 2 core machine with 1 codespace stored per student.