yandex_cdn_origin_group (Resource)
Written by
Updated at October 20, 2025
Allows management of Yandex Cloud CDN Origin Groups.
Example usage
//
// Create a new CDN Origin Group
//
resource "yandex_cdn_origin_group" "my_group" {
name = "My Origin group"
use_next = true
origin {
source = "ya.ru"
}
origin {
source = "yandex.ru"
}
origin {
source = "goo.gl"
}
origin {
source = "amazon.com"
backup = false
}
}
Schema
Required
name(String) The resource name.origin(Block Set, Min: 1) A set of available origins, an origins group must contain at least one enabled origin with fields below. (see below for nested schema)
Optional
folder_id(String) The folder identifier that resource belongs to. If it is not provided, the default providerfolder-idis used.provider_type(String) CDN provider is a content delivery service provider. Possible values: "ourcdn" (default) or "gcore"timeouts(Block, Optional) (see below for nested schema)use_next(Boolean) If the option is active (has true value), in case the origin responds with 4XX or 5XX codes, use the next origin from the list.
Read-Only
id(String) The ID of this resource.
Nested Schema for origin
Required:
source(String) IP address or Domain name of your origin and the port.
Optional:
backup(Boolean) Specifies whether the origin is used in its origin group as backup. A backup origin is used when one of active origins becomes unavailable.enabled(Boolean) The origin is enabled and used as a source for the CDN. Defaultenabled.
Read-Only:
origin_group_id(String) The ID of a specific origin group.
Nested Schema for timeouts
Optional:
create(String) A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).delete(String) A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.update(String) A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
Import
The resource can be imported by using their resource ID. For getting the resource ID you can use Yandex Cloud Web Console
# terraform import yandex_cdn_origin_group.<resource Name> <resource Id>
terraform import yandex_cdn_origin_group.my_cdn_group ...