[Yandex Cloud documentation](../../../index.md) > [Yandex Managed Service for GitLab](../../index.md) > [Step-by-step guides](../index.md) > Updating instance settings

# Updating instance settings

After creating a [GitLab instance](../../concepts/index.md#instance), you can update the general and advanced instance settings yourself.

## Updating general and advanced instance settings {#change-settings}

{% note warning %}

During [instance type](../../concepts/index.md#config) or disk size update, your GitLab instance will be temporarily unavailable.

{% endnote %}

{% list tabs group=instructions %}

- Management console {#console}

  1. In the management console, select the [folder](../../../resource-manager/concepts/resources-hierarchy.md#folder) with your [GitLab instance](../../concepts/index.md#instance).
  1. Navigate to **Managed Service for&nbsp;GitLab**.
  1. Select the instance and click ![image](../../../_assets/console-icons/pencil.svg) **Edit** at the top of the page.
  1. At the top of the page:

      * Specify a new instance name and description.
      * Add [labels](../../../resource-manager/concepts/labels.md) to break instances into logical groups.
      * Enable or disable instance protection against accidental deletion by users.

  1. Under **Configuration**:

      * Change the instance type. From the current instance type, you can only upgrade to a higher-performance type, e.g., from `s2.micro` to `s2.small`. You cannot downgrade to a lower-performance instance type.
      * Select another [security group](../../../vpc/concepts/security-groups.md) or create a new one:

        * Click **Create group**.
        * Enter a name and description for the security group. You can add rules for the security group later in Virtual Private Cloud.
        * Click **Create**.

        If you do not specify a separate security group, the [default security group](../../../vpc/concepts/security-groups.md#default-security-group) created in the instance network will apply.
        
        [Configure](../configure-security-group.md) your security group so that its rules allow incoming and outgoing traffic on the specified ports and IP addresses.
              
        {% note warning %}
        
        The security group's setup determines the Managed Service for GitLab instance performance and availability.
        
        {% endnote %}
        
        If you have issues with setting up a security group, contact [support](https://center.yandex.cloud/support).

      * Specify the disk size. You can increase the disk size or leave it as is. Reducing the disk size is not supported.
      * Change the automatic backup retention period, in days.
      * Select the appropriate [configuration](../../concepts/approval-rules.md#packages) for approval rules.

          {% note warning %}
          
          In Managed Service for GitLab, you pay for approval rules depending on your [configuration](../../concepts/approval-rules.md#packages). For more information, see [Yandex Managed Service for GitLab pricing policy](../../pricing.md).
          
          {% endnote %}

      * To activate the approval rules, provide the [GitLab token](../approval-rules.md#gitlab-token).

  1. Under **Advanced settings**, enable or disable deletion of untagged images. This setting affects the amount of free disk space on the instance.
  1. Click **Save**.

- CLI {#cli}

  If you do not have the Yandex Cloud CLI yet, [install and initialize it](../../../cli/quickstart.md#install).

  The folder used by default is the one specified when [creating](../../../cli/operations/profile/profile-create.md) the CLI profile. To change the default folder, use the `yc config set folder-id <folder_ID>` command. You can also specify a different folder for any command using `--folder-name` or `--folder-id`. If you access a resource by its name, the search will be limited to the default folder. If you access a resource by its ID, the search will be global, i.e., through all folders based on access permissions.

  1. View the description of the [CLI](../../../cli/index.md) command for updating Managed Service for GitLab instance settings:

      ```bash
      yc managed-gitlab instance update --help
      ```

  1. Update the GitLab instance settings (this example does not use all available parameters):

      ```bash
      yc managed-gitlab instance update <instance_name_or_ID> \
        --new-name <new_instance_name> \
        --resource-preset-id <host_class> \
        --disk-size <disk_size_in_GB> \
        --deletion-protection \
        --approval-rules <approval_rule_configuration>
      ```

      Where:

      * `--new-name`: New instance name, unique within Yandex Cloud. Follow these naming requirements:

          * Length: between 3 and 63 characters.
          * It can only contain lowercase Latin letters, numbers, and hyphens.
          * It must start with a letter and cannot end with a hyphen.

      * `--resource-preset-id`: Host class. It determines the configuration of the VM to host the GitLab instance. The possible values are:

          * `s2.micro`: 2 vCPUs, 8 GB RAM
          * `s2.small`: 4 vCPUs, 16 GB RAM
          * `s2.medium`: 8 vCPUs, 32 GB RAM
          * `s2.large`: 16 vCPUs, 64 GB RAM

      * `--disk-size`: Disk size, in GB.
      * `--deletion-protection`: Instance protection against accidental deletion by users.

          {% note info %}

          You can use the CLI to enable but not disable the accidental deletion protection.

          {% endnote %}

      * `--approval-rules`: [Approval rule](../../concepts/approval-rules.md) configuration. The possible values are:

          * `BASIC`
          * `STANDARD`
          * `ADVANCED`

          {% note warning %}
          
          In Managed Service for GitLab, you pay for approval rules depending on your [configuration](../../concepts/approval-rules.md#packages). For more information, see [Yandex Managed Service for GitLab pricing policy](../../pricing.md).
          
          {% endnote %}

      Result:

      ```text
      id: c17c60tpadua********
      folder_id: b1g2slt7p9ug********
      created_at: "2025-07-20T18:34:16.078Z"
      updated_at: "2025-07-20T18:54:49.829961285Z"
      name: test-cli
      resource_preset_id: s2.small
      disk_size: "107374182400"
      status: RUNNING
      admin_login: admin-gl
      admin_email: user@example.com
      domain: test-domain-user.gitlab.yandexcloud.net
      subnet_id: e9b4rrpuu2a********
      backup_retain_period_days: "7"
      deletion_protection: true
      approval_rules_id: BASIC
      gitlab_version: 17.11.6
      ```

      For more information about this command, see the [CLI reference](../../cli-ref/instance/update.md).

- Terraform {#tf}

  1. Open the current Terraform configuration file with the infrastructure plan.

      For information on how to create this file, see [Creating a GitLab instance](instance-create.md#create).

  1. Change the parameter values in the GitLab instance description:

      ```hcl
      resource "yandex_gitlab_instance" "my_gitlab_instance" {
        ...
        resource_preset_id        = "<host_class>"
        disk_size                 = <disk_size_in_GB>
        approval_rules_id         = "<approval_rule_configuration>"
        backup_retain_period_days = <backup_retention_period>
        deletion_protection       = <true_or_false>
        ...
      }
      ```

      Where:

      * `resource_preset_id`: Host class. It determines the configuration of the VM to host the GitLab instance. The possible values are:
          * `s2.micro`: 2 vCPUs, 8 GB RAM
          * `s2.small`: 4 vCPUs, 16 GB RAM
          * `s2.medium`: 8 vCPUs, 32 GB RAM
          * `s2.large`: 16 vCPUs, 64 GB RAM

      * `disk_size`: Disk size, in GB.
      * `approval_rules_id`: [Approval rule](../../concepts/approval-rules.md) configuration. The possible values are:

          * `BASIC`
          * `STANDARD`
          * `ADVANCED`

          {% note warning %}
          
          In Managed Service for GitLab, you pay for approval rules depending on your [configuration](../../concepts/approval-rules.md#packages). For more information, see [Yandex Managed Service for GitLab pricing policy](../../pricing.md).
          
          {% endnote %}

      * `backup_retain_period_days`: Automatic backup retention period, in days.
      * `deletion_protection`: Instance protection against accidental deletion by users. The possible values are `true` or `false`.

      For more on the properties of the `yandex_gitlab_instance` resource, see [this provider guide](../../../terraform/resources/gitlab_instance.md).

  1. Make sure the settings are correct.

      1. In the command line, navigate to the directory that contains the current Terraform configuration files defining the infrastructure.
      1. Run this command:
      
         ```bash
         terraform validate
         ```
      
         Terraform will show any errors found in your configuration files.

  1. Confirm updating the resources.

      1. Run this command to view the planned changes:
      
         ```bash
         terraform plan
         ```
      
         If you described the configuration correctly, the terminal will display a list of the resources to update and their parameters. This is a verification step that does not apply changes to your resources.
      
      1. If everything looks correct, apply the changes:
         1. Run this command:
      
            ```bash
            terraform apply
            ```
      
         1. Confirm updating the resources.
         1. Wait for the operation to complete.

      Terraform will update all the required resources. You can check the update using the [management console](https://console.yandex.cloud) or this [CLI](../../../cli/index.md) command:

      ```bash
      yc managed-gitlab instance list
      ```

  For more information, see [this Terraform provider guide](../../../terraform/resources/gitlab_instance.md).

- API {#api}

  Use the [Update](../../api-ref/Instance/update.md) REST API method for the [Instance](../../api-ref/Instance/index.md) resource or the [InstanceService/Update](../../api-ref/grpc/Instance/update.md) gRPC API call.

{% endlist %}