VK Cloud logo

Using SSL Certificates

You can automatically install SSL certificates on the instances of your image-based applications when deploying them on the VK Cloud platform, as well as timely update the installed SSL certificates. This will allow your applications to use the secure HTTPS protocol for exchanging data with users.

The example below shows how to integrate the SSL certificate management system into an image-based application.

Preparatory steps

Register a domain where the instances of the image-based application will reside, if this has not been done yet.

1. Prepare the VM image of the application instance

When preparing the image of the VM where the image-based application is installed:

  1. Create a directory for storing the SSL certificate file and the file with its private key.

    If several applications and SSL certificates for them will be installed on the VM, it is recommended to create a separate directory for each application for better security.

  2. (Optional) Configure access to the SSL certificate files and its private key:

    1. Create a user who will be assigned as the owner of these files.

    2. Create a user group for the SSL certificate files and its private key.

    3. Grant the user and the group access permissions to the SSL certificate files and its private key, as well as to the directory where they will be placed.

      For better security, it is not recommended to grant more permissions than necessary. In this case, it is sufficient to set the access permissions:

      • for the directory — 755 (the owner has unrestricted access, while the group and other users have only read and execute permissions);
      • for the files — 644 (the owner has read and write permissions, while the group and other users have only read permission).
  3. (Optional) Specify which actions need to be performed on the instance VM each time after the SSL certificate is updated:

    1. Prepare a bash script with the required actions and place the script file on the VM image.
    2. If an owner user of the SSL certificate has been created, grant them access permission to the directory where the script is located and the permission to execute the script.
    3. Verify that the script runs correctly.

2. Prepare the application Terraform manifest

Add the ivkcs_cert resource to the Terraform manifest with the description of the infrastructure for deploying the application instance.

Was this article helpful?