Backing up certificates
Saving a certificate
To save a certificate:
-
Get the certificate ID.
Management consoleCLIAPI- In the management console
, select the folder with your certificate. - Navigate to Certificate Manager.
- Copy the ID field data for the certificate you want to save.
If you do not have the Yandex Cloud CLI yet, install and initialize it.
The folder used by default is the one specified when creating 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-nameor--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.-
View the description of the CLI command for getting a list of certificates:
yc cm certificate list --help -
Run this command:
yc cm certificate list
To get the certificate ID, use the list REST API method for the Certificate resource or the CertificateService/List gRPC API call.
- In the management console
-
Get the certificate contents.
CLIAPIIf you do not have the Yandex Cloud CLI yet, install and initialize it.
The folder used by default is the one specified when creating 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-nameor--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.-
View the description of the CLI command for getting certificate contents:
yc cm certificate content --help -
Run this command:
yc cm certificate content \ --id <certificate_ID> \ --chain <path_to_certificate_chain_file> \ --key <path_to_private_key_file> ...
To get the certificate contents, use the get REST API method for the CertificateContent resource or the CertificateContentService/Get gRPC API call.
Put the resulting files in a secure long-term storage.
-
-
Repeat the steps for each certificate you want to back up.
Restoring a certificate
Note
You cannot restore an expired certificate.
To restore a user certificate from the certificate chain and key files:
-
Prepare the files with the certificate contents.
-
Import the certificate.
Management consoleCLIAPI- In the management console
, select the folder the certificate will be restored to. - Navigate to Certificate Manager.
- Click Add certificate.
- In the menu that opens, select User certificate.
- In the window that opens, enter a name for your certificate in the Name field.
- Optionally, in the Description field, describe the certificate.
- In the Intermediate certificate chain field, click Add chain.
- Choose how to add it:
File. - Click Attach file and specify the certificate chain file.
- Click Add.
- Choose how to add it:
- In the Private key field, click Add private key.
- Choose how to add it:
FileorText. - Click Attach file and specify the private key file.
- Click Add.
- Choose how to add it:
- Click Create.
If you do not have the Yandex Cloud CLI yet, install and initialize it.
The folder used by default is the one specified when creating 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-nameor--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.-
View the command description:
yc cm certificate create --help -
Run this command:
yc cm certificate create \ --name <certificate_name> \ --chain <path_to_certificate_chain_file> \ --key <path_to_private_key_file> ...
To import a certificate, use the create REST API method for the Certificate resource or the CertificateService/Create gRPC API call.
The ID of the restored certificate will be different from the ID the certificate had upon saving.
- In the management console
-
Repeat the steps for each certificate you want to restore.
If you restore a saved Let's Encrypt certificate, it becomes a custom one. To renew this certificate, download its latest version yourself.