Yandex Cloud
Search
Contact UsGet started
  • Blog
  • Pricing
  • Documentation
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • ML & AI
    • Business tools
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Customer Stories
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Education and Science
    • Yandex Cloud Partner program
  • Blog
  • Pricing
  • Documentation
© 2025 Direct Cursus Technology L.L.C.
Yandex Cloud CDN
  • Getting started
    • All guides
    • Connecting to a Cloud CDN provider
      • Creating an origin group
      • Editing an origin group
      • Connecting an origin group to a resource
      • Getting information about origins
      • Deleting an origin group
  • Access management
  • Pricing policy
  • Terraform reference
  • Monitoring metrics
  • Audit Trails events
  • Release notes
  • Troubleshooting
  1. Step-by-step guides
  2. Origin groups
  3. Creating an origin group

Creating an origin group

Written by
Yandex Cloud
Updated at May 13, 2025

To create an origin group:

Management console
CLI
Terraform
API
  1. In the management console, select the folder to host your origin group.
  2. Select Cloud CDN.
  3. If the CDN provider is not activated yet, click Activate provider. A connection will be established automatically.

    If you do not see the Activate provider button and you can create resources and origin groups, it means that the provider is already activated. Proceed to the next step.

  4. In the left-hand panel, select Origin groups.
  5. Click Create origin group.
  6. Enter a name for the origin group.
  7. Configure Origin:
    • Specify the Origin type: Server, Bucket, or L7 load balancer. For more information about types, see Origins and origin groups.
    • Specify an origin.
    • Select the Priority: Active or Backup. For more information about priorities, see Origin groups.
    • Add other origins if needed.
  8. Click Create.

If you do not have the Yandex Cloud (CLI) command line interface yet, install and initialize it.

The folder specified when creating the CLI profile is used by default. To change the default folder, use the yc config set folder-id <folder_ID> command. You can specify a different folder using the --folder-name or --folder-id parameter.

  1. If you have not created origin groups before, connect to the provider first:

    yc cdn provider activate --type gcore
    
  2. View a description of the CLI command to create an origin group:

    yc cdn origin-group create --help
    
  3. Create an origin group in the default folder:

    yc cdn origin-group create --name <origin_group_name> \
      --origin source=<origin_IP_address_or_domain_name>,enabled=true \
      --origin source=<origin_IP_address_or_domain_name>,enabled=true,backup=true
    

    Where --origin is the origin specification:

    • source: Origin IP address or domain name.
    • enabled: Flag showing whether the origin is enabled.
    • backup: Flag showing whether the origin as a backup one. For more information about priorities, see Origin groups.

    Result:

    id: "89018"
    folder_id: b1g86q4m5vej********
    name: test-group
    use_next: true
    origins:
    - id: "559295"
      origin_group_id: "89018"
      source: www.example2.com
      enabled: true
      backup: true
    - id: "559294"
      origin_group_id: "89018"
      source: www.example1.com
      enabled: true
    

    For more information about the yc cdn origin-group create command, see the CLI reference.

Make sure to activate the CDN provider before creating an origin group. You can activate it in the management console or using this CLI command:

yc cdn provider activate \
  --folder-id <folder_ID> \
  --type gcore

Where:

  • --folder-id: ID of the folder where you want to activate the CDN provider.
  • --type: Provider type. The only possible value is gcore.

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 documentation on the Terraform website or mirror website.

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

  1. Describe the parameters of the yandex_cdn_origin_group resource in the configuration file.

    Here is an example of the configuration file structure:

    resource "yandex_cdn_origin_group" "my_group" {
      name = "<origin_group_name>"
      use_next = true
      origin {
       source = "<origin_1_IP_address_or_domain_name>"
      }
      origin {
       source = "<origin_2_IP_address_or_domain_name>"
      }
      origin {
       source = "<origin_3_IP_address_or_domain_name>"
       backup = false
      }
    }
    

    Where:

    • name: Origin group name.
    • use_next: Indicates whether to use the next origin on the list.
    • origin: Origin specification:
      • source: Origin IP address or domain name.
      • enabled: Flag showing whether the origin is enabled.
      • backup: Flag showing whether the origin as a backup one. For more information about priorities, see Origin groups.

    For more information about the resources you can create with Terraform, see the provider documentation.

  2. Create resources:

    1. In the terminal, change to the folder where you edited the configuration file.

    2. Make sure the configuration file is correct using the command:

      terraform validate
      

      If the configuration is correct, the following message is returned:

      Success! The configuration is valid.
      
    3. Run the command:

      terraform plan
      

      The terminal will display a list of resources with parameters. No changes are made at this step. If the configuration contains errors, Terraform will point them out.

    4. Apply the configuration changes:

      terraform apply
      
    5. Confirm the changes: type yes in the terminal and press Enter.

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

    yc cdn origin-group list
    

If you have not created any origin groups before, connect to the CDN provider. To do this, use the activate REST API method for the Provider resource or the ProviderService/Activate gRPC API call.

Use the create REST API method for the OriginGroup resource or the OriginGroupService/Create gRPC API call.

Was the article helpful?

Previous
Viewing resource statistics
Next
Editing an origin group
© 2025 Direct Cursus Technology L.L.C.