Deleting a Let's Encrypt certificate
To delete a Let's Encrypt certificate:
- In the management console
, select the folder the certificate was added to. - In the list of services, select Certificate Manager.
- Find the certificate to be deleted in the list.
- Click
. - In the menu that opens, click Delete.
- In the window that opens, click Delete.
If you do not have the Yandex Cloud CLI 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.
-
View a description of the command:
yc certificate-manager certificates delete --help
-
View the list of certificates:
yc certificate-manager certificate list
Result:
+----------------------+----------------------+-------------+-----------+---------+------------+ | ID | NAME | DOMAINS | NOT AFTER | TYPE | STATUS | +----------------------+----------------------+-------------+-----------+---------+------------+ | fpq6gvvm6piu******** | myupdatedmanagedcert | example.com | | MANAGED | VALIDATING | +----------------------+----------------------+-------------+-----------+---------+------------+
-
Run this command:
yc certificate-manager certificates delete \ --id fpq6gvvm6piu********
Where
--id
is the certificate ID.Result:
id: fpq6gvvm6piu******** folder_id: b1g7gvsi89m3******** created_at: "2020-09-15T08:49:11.533Z" ... - example.com status: VALIDATING updated_at: "2020-09-15T09:10:06.981Z"
With Terraform
Terraform is distributed under the Business Source License
For more information about the provider resources, see the relevant provider reference
If you do not have Terraform yet, install it and configure the Yandex Cloud provider.
-
Open the Terraform configuration file and delete the fragment with the certificate description:
Sample certificate description
... resource "yandex_cm_certificate" "le-certificate" { name = "managed-certificate-for-dns" description = "this is a certificate for tls" domains = ["my-domain.ru"] managed { challenge_type = "DNS_CNAME" } } ...
-
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 validate
If the configuration is correct, you will get this message:
Success! The configuration is valid.
-
Run this command:
terraform plan
You 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
yes
and press Enter to confirm the changes.
-
You can check the certificate deletion using the management console
yc certificate-manager certificate list
To delete a certificate, use the delete REST API method for the Certificate resource or the CertificateService/Delete gRPC API call.