Yandex Cloud
Search
Contact UsTry it for free
  • Customer Stories
  • Documentation
  • Blog
  • All Services
  • System Status
  • Marketplace
    • Featured
    • Infrastructure & Network
    • Data Platform
    • AI for business
    • Security
    • DevOps tools
    • Serverless
    • Monitoring & Resources
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Center for Technologies and Society
    • Yandex Cloud Partner program
    • Price calculator
    • Pricing plans
  • Customer Stories
  • Documentation
  • Blog
© 2026 Direct Cursus Technology L.L.C.
Yandex Cloud CDN
  • Getting started
    • All guides
      • Creating a resource
      • Copying configuration from one resource to another
      • Updating basic settings of a resource
      • Getting information about a resource
      • Configuring resource caching
      • Configuring log export
      • Prefetching files to CDN servers
      • Purging resource cache
      • Configuring request and response headers
      • Configuring CORS for responses to clients
      • Configuring HTTP methods
      • Setting up an HTTP response
      • Enabling file compression
      • Enabling file segmentation
      • Enabling origin shielding
      • Setting up a request redirect
      • Enabling a resource to follow request redirects
      • Setting up hiding of origin headers
      • Setting up access via a secure token
      • Setting up location rules
      • Setting up a server name for SNI
      • Disabling a resource
      • Managing resource labels
      • Configuring dedicated IP addressing
      • Configuring a TLS profile
      • Deleting a resource
      • Viewing resource statistics
  • Access management
  • Pricing policy
  • Terraform reference
  • Monitoring metrics
  • Request logs
  • Audit Trails events
  • Release notes
  • Troubleshooting

In this article:

  • Creating a resource with a custom server name for SNI
  • Updating a custom server name for SNI
  1. Step-by-step guides
  2. Resources
  3. Setting up a server name for SNI

Configuring a custom server name for SNI

Written by
Yandex Cloud
Updated at April 15, 2026
  • Creating a resource with a custom server name for SNI
  • Updating a custom server name for SNI

You can configure a custom server name for SNI (Server Name Indication) when establishing an HTTPS connection from CDN servers to the origin.

Note

This setting is only available when using an HTTPS connection between the CDN servers and the origin.

Creating a resource with a custom server name for SNICreating a resource with a custom server name for SNI

CLI
Terraform
REST API
gRPC API

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 set a different folder for any specific command using the --folder-name or --folder-id options.

  1. View the description of the CLI command to create a resource:

    yc cdn resource update --help
    
  2. Get a list of all origin groups in the folder:

    yc cdn origin-group list --format yaml
    

    Result:

    - id: "*****"
      folder_id: b1g86q4m5vej********
      name: test-group-1
    ...
        origin_group_id: "*****"
        source: www.a1.com
        enabled: true
    
  3. Create a resource with a custom server name for SNI:

    yc cdn resource create <resource_domain_name> \
      --origin-group-id <origin_group_ID> \
      --origin-protocol HTTPS \
      --custom-server-name <server_name_for_SNI>
    

    Result:

    id: bc8rpzaciiyp********
    folder_id: b1g681qpemb4********
    cname: example.com
    ...
      custom_server_name:
        enabled: true
        value: custom.example.com
    ...
    

With Terraform, you can quickly create a cloud infrastructure in Yandex Cloud and manage it using configuration files. These files store the infrastructure description written in HashiCorp Configuration Language (HCL). If you change the configuration files, Terraform automatically detects which part of your configuration is already deployed, and what should be added or removed.

Terraform is distributed under the Business Source License. The Yandex Cloud provider for Terraform is distributed under the MPL-2.0 license.

For more information about the provider resources, see the relevant documentation on the Terraform website or its mirror.

If you do not have Terraform yet, install it and configure the Yandex Cloud provider.

  1. In the configuration file, describe the properties of the CDN resource to create:

    resource "yandex_cdn_resource" "my_resource" {
        cname               = "<domain_name>"
        active              = true
        origin_protocol     = "https"
        origin_group_id     = <origin_group_ID>
        options {
          custom_server_name  = <server_name_for_SNI>
        }
    }
    

    Where:

    • cname: Primary domain name used for content distribution. This is a required setting.
    • active: Flag for content availability to end users, where true means the CDN content is available to clients, and false means the content not available. The default value is true. This is an optional setting.
    • origin_protocol: Protocol for origins. The default value is http. This is an optional setting.
    • origin_group_id: Origin group ID. This is a required parameter. Use the ID from the description of the origin group in the yandex_cdn_origin_group resource.
    • custom_server_name: Custom server name for SNI.
  2. Create the resources:

    1. In the terminal, go to the directory where you edited the configuration file.

    2. 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.
      
    3. 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.

    4. Apply the changes:

      terraform apply
      
    5. Type yes and press Enter to confirm the changes.

    Terraform will create all the required resources. You can check the new CDN resource using the management console or this CLI command:

    yc cdn resource list
    

Add the customServerName section when using the create method for a Resource:

"originProtocol": "HTTPS",
"options": {
  "customServerName": {
    "enabled": "<true_or_false>",
    "value": "string"
  }
}

Where:

  • customServerName.enabled: Enabling the option:

    • true enables the option.
    • false disables the option.
  • customServerName.value: Custom server name for SNI.

  • originProtocol: Connection protocol between CDN servers and the origin.

Add the custom_server_name section when using the ResourceService/Create call:

"origin_protocol": "HTTPS",
"options": {
  "custom_server_name": {
    "enabled": "<true_or_false>",
    "value": "string"
  }
}

Where:

  • custom_server_name.enabled: Enabling the option:

    • true enables the option.
    • false disables the option.
  • custom_server_name.value: New custom server name for SNI.

  • origin_protocol: Connection protocol between CDN servers and the origin.

Updating a custom server name for SNIUpdating a custom server name for SNI

CLI
Terraform
REST API
gRPC API

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 set a different folder for any specific command using the --folder-name or --folder-id options.

  1. View the description of the CLI command to update a resource:

    yc cdn resource update --help
    
  2. Get a list of all resources in the folder:

    yc cdn resource list --format yaml
    

    Result:

    - id: bc8rpzaciiyp********
      folder_id: b1g681qpemb4********
      cname: example.com
      ...
        custom_server_name:
          enabled: true
          value: custom.example.com
      ...
    
  3. Update a custom server name for SNI:

    yc cdn resource update <resource_ID> \
      --origin-protocol HTTPS \
      --custom-server-name <new_server_name_for_SNI>
    

    Result:

    - id: bc8rpzaciiyp********
      folder_id: b1g681qpemb4********
      cname: example.com
      ...
        custom_server_name:
          enabled: true
          value: new.example.com
      ...
    

    To delete a custom server name for SNI, use the --clear-custom-server-name flag:

    yc cdn resource update <resource_ID> \
      --clear-custom-server-name
    

If you do not have Terraform yet, install it and configure the Yandex Cloud provider.

To update the parameters of a CDN resource created using Terraform:

  1. Open the Terraform configuration file and edit the fragment with the resource description:

    resource "yandex_cdn_resource" "my_resource" {
        cname               = "<domain_name>"
        active              = true
        origin_protocol     = "https"
        origin_group_id     = <origin_group_ID>
        options {
          custom_server_name  = <new_server_name_for_SNI>
        }
    }
    

    Where:

    • cname: Primary domain name used for content distribution. This is a required setting.
    • active: Flag for content availability to end users, where true means the CDN content is available to clients, and false means the content not available. The default value is true. This is an optional setting.
    • origin_protocol: Protocol for origins. The default value is http. This is an optional setting.
    • origin_group_id: Origin group ID. This is a required parameter. Use the ID from the description of the origin group in the yandex_cdn_origin_group resource.
    • custom_server_name: New custom server name for SNI.
  2. Apply the changes:

    1. In the terminal, go to the directory where you edited the configuration file.

    2. 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.
      
    3. 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.

    4. Apply the changes:

      terraform apply
      
    5. Type yes and press Enter to confirm the changes.

    Terraform will update all the required resources. You can check the CDN resource update in the management console or using this CLI command:

    yc cdn resource list
    

Add the customServerName section when using the update method for a Resource:

"originProtocol": "HTTPS",
"options": {
  "customServerName": {
    "enabled": "<true_or_false>",
    "value": "string"
  }
}

Where:

  • customServerName.enabled: Enabling the option:

    • true enables the option.
    • false disables the option.
  • customServerName.value: Custom server name for SNI.

  • originProtocol: Connection protocol between CDN servers and the origin.

Add the custom_server_name section when using the ResourceService/Update call:

"origin_protocol": "HTTPS",
"options": {
  "custom_server_name": {
    "enabled": "<true_or_false>",
    "value": "string"
  }
}

Where:

  • custom_server_name.enabled: Enabling the option:

    • true enables the option.
    • false disables the option.
  • custom_server_name.value: New custom server name for SNI.

  • origin_protocol: Connection protocol between CDN servers and the origin.

Was the article helpful?

Previous
Setting up location rules
Next
Disabling a resource
© 2026 Direct Cursus Technology L.L.C.