Deleting a GitLab instance
If the instance has deletion protection enabled, disable it first, and then delete the instance.
- In the management console, select the folder to delete a GitLab instance from.
- Select Managed Service for GitLab.
- Click
for the instance and select Delete. - In the window that opens, click Delete.
If you do not have the Yandex Cloud CLI installed yet, install and initialize it.
By default, the CLI uses the folder specified when creating the profile. To change the default folder, use the yc config set folder-id <folder_ID> command. You can also set a different folder for any specific command using the --folder-name or --folder-id parameter.
To delete a GitLab instance, run this command:
yc managed-gitlab instance delete <instance_name_or_ID>
You can request the instance ID or name with the list of instances in the folder.
Result:
done (3m14s)
For more information about this command, see the CLI reference.
With Terraform
Terraform is distributed under the Business Source License
For more information about the provider resources, see the relevant documentation on the Terraform
If you do not have Terraform yet, install it and configure the Yandex Cloud provider.
To delete a GitLab instance created using Terraform:
-
Open the Terraform configuration file and delete the fragment with the
yandex_gitlab_instanceresource description:Example of a GitLab instance description in the Terraform configuration:
resource "yandex_gitlab_instance" "my_gitlab_instance" { name = "gl-instance" resource_preset_id = "s2.micro" disk_size = 100 admin_login = "gitlab-user" admin_email = "gitlab-user@example.com" domain = "gitlab-terraform.gitlab.yandexcloud.net" subnet_id = "e9bsdv4iunrv********" approval_rules_id = "BASIC" backup_retain_period_days = 7 deletion_protection = true } -
Apply the changes:
-
In the terminal, go to the directory where you edited the configuration file.
-
Make sure the configuration file is correct using this command:
terraform validateIf the configuration is correct, you will get this message:
Success! The configuration is valid. -
Run this command:
terraform planYou will see a detailed list of resources. No changes will be made at this step. If the configuration contains any errors, Terraform will show them.
-
Apply the changes:
terraform apply -
Type
yesand press Enter to confirm the changes.
-
You can check the updates in the management console
yc managed-gitlab instance list
Use the Delete REST API method for the Instance resource or the InstanceService/Delete gRPC API call.
If you have deleted a GitLab instance but want to restore it, contact support