Yandex Cloud
Поиск
Связаться с намиПодключиться
  • Истории успеха
  • Документация
  • Блог
  • Все сервисы
  • Статус работы сервисов
    • Доступны в регионе
    • Инфраструктура и сеть
    • Платформа данных
    • Контейнеры
    • Инструменты разработчика
    • Бессерверные вычисления
    • Безопасность
    • Мониторинг и управление ресурсами
    • ИИ для бизнеса
    • Бизнес-инструменты
  • Все решения
    • По отраслям
    • По типу задач
    • Экономика платформы
    • Безопасность
    • Техническая поддержка
    • Каталог партнёров
    • Обучение и сертификация
    • Облако для стартапов
    • Облако для крупного бизнеса
    • Центр технологий для общества
    • Партнёрская программа
    • Поддержка IT-бизнеса
    • Облако для фрилансеров
    • Обучение и сертификация
    • Блог
    • Документация
    • Мероприятия и вебинары
    • Контакты, чаты и сообщества
    • Идеи
    • Тарифы Yandex Cloud
    • Промоакции и free tier
    • Правила тарификации
  • Истории успеха
  • Документация
  • Блог
Проект Яндекса
© 2025 ТОО «Облачные Сервисы Казахстан»
Terraform в Yandex Cloud
  • Начало работы
  • Библиотека решений
    • Обзор
    • История изменений (англ.)
          • compute_disk
          • compute_disk_placement_group
          • compute_filesystem
          • compute_gpu_cluster
          • compute_image
          • compute_instance
          • compute_instance_group
          • compute_placement_group
          • compute_snapshot
          • compute_snapshot_schedule

В этой статье:

  • Example usage
  • Schema
  • Required
  • Read-Only
  • Nested Schema for allocation_policy
  • Nested Schema for allocation_policy.instance_tags_pool
  • Nested Schema for application_balancer_state
  • Nested Schema for application_load_balancer
  • Nested Schema for deploy_policy
  • Nested Schema for health_check
  • Nested Schema for health_check.http_options
  • Nested Schema for health_check.tcp_options
  • Nested Schema for instance_template
  • Nested Schema for instance_template.boot_disk
  • Nested Schema for instance_template.boot_disk.initialize_params
  • Nested Schema for instance_template.filesystem
  • Nested Schema for instance_template.metadata_options
  • Nested Schema for instance_template.network_interface
  • Nested Schema for instance_template.network_interface.dns_record
  • Nested Schema for instance_template.network_interface.ipv6_dns_record
  • Nested Schema for instance_template.network_interface.nat_dns_record
  • Nested Schema for instance_template.network_settings
  • Nested Schema for instance_template.placement_policy
  • Nested Schema for instance_template.resources
  • Nested Schema for instance_template.scheduling_policy
  • Nested Schema for instance_template.secondary_disk
  • Nested Schema for instance_template.secondary_disk.initialize_params
  • Nested Schema for instances
  • Nested Schema for instances.network_interface
  • Nested Schema for load_balancer
  • Nested Schema for load_balancer_state
  • Nested Schema for scale_policy
  • Nested Schema for scale_policy.auto_scale
  • Nested Schema for scale_policy.auto_scale.custom_rule
  • Nested Schema for scale_policy.fixed_scale
  • Nested Schema for scale_policy.test_auto_scale
  • Nested Schema for scale_policy.test_auto_scale.custom_rule
  1. Справочник Terraform
  2. Ресурсы (англ.)
  3. Compute Cloud
  4. Data Sources
  5. compute_instance_group

yandex_compute_instance_group (Data Source)

Статья создана
Yandex Cloud
Обновлена 7 августа 2025 г.
  • Example usage
  • Schema
    • Required
    • Read-Only
    • Nested Schema for allocation_policy
    • Nested Schema for allocation_policy.instance_tags_pool
    • Nested Schema for application_balancer_state
    • Nested Schema for application_load_balancer
    • Nested Schema for deploy_policy
    • Nested Schema for health_check
    • Nested Schema for health_check.http_options
    • Nested Schema for health_check.tcp_options
    • Nested Schema for instance_template
    • Nested Schema for instance_template.boot_disk
    • Nested Schema for instance_template.boot_disk.initialize_params
    • Nested Schema for instance_template.filesystem
    • Nested Schema for instance_template.metadata_options
    • Nested Schema for instance_template.network_interface
    • Nested Schema for instance_template.network_interface.dns_record
    • Nested Schema for instance_template.network_interface.ipv6_dns_record
    • Nested Schema for instance_template.network_interface.nat_dns_record
    • Nested Schema for instance_template.network_settings
    • Nested Schema for instance_template.placement_policy
    • Nested Schema for instance_template.resources
    • Nested Schema for instance_template.scheduling_policy
    • Nested Schema for instance_template.secondary_disk
    • Nested Schema for instance_template.secondary_disk.initialize_params
    • Nested Schema for instances
    • Nested Schema for instances.network_interface
    • Nested Schema for load_balancer
    • Nested Schema for load_balancer_state
    • Nested Schema for scale_policy
    • Nested Schema for scale_policy.auto_scale
    • Nested Schema for scale_policy.auto_scale.custom_rule
    • Nested Schema for scale_policy.fixed_scale
    • Nested Schema for scale_policy.test_auto_scale
    • Nested Schema for scale_policy.test_auto_scale.custom_rule

Get information about a Yandex Compute instance group.

Example usageExample usage

//
// Get information about existing Compute Instance Group (IG)
//
data "yandex_compute_instance_group" "my_group" {
  instance_group_id = "some_instance_group_id"
}

output "instance_external_ip" {
  value = data.yandex_compute_instance_group.my_group.instances.*.network_interface.0.nat_ip_address
}

SchemaSchema

RequiredRequired

  • instance_group_id (String) The ID of a specific instance group.

Read-OnlyRead-Only

  • allocation_policy (List of Object) (see below for nested schema)
  • application_balancer_state (List of Object) (see below for nested schema)
  • application_load_balancer (List of Object) (see below for nested schema)
  • created_at (String) The creation timestamp of the resource.
  • deletion_protection (Boolean) The true value means that resource is protected from accidental deletion.
  • deploy_policy (List of Object) (see below for nested schema)
  • description (String) The resource description.
  • folder_id (String) The folder identifier that resource belongs to. If it is not provided, the default provider folder-id is used.
  • health_check (List of Object) (see below for nested schema)
  • id (String) The ID of this resource.
  • instance_template (List of Object) (see below for nested schema)
  • instances (List of Object) (see below for nested schema)
  • labels (Map of String) A set of key/value label pairs which assigned to resource.
  • load_balancer (List of Object) (see below for nested schema)
  • load_balancer_state (List of Object) (see below for nested schema)
  • max_checking_health_duration (Number) Timeout for waiting for the VM to become healthy. If the timeout is exceeded, the VM will be turned off based on the deployment policy. Specified in seconds.
  • name (String) The resource name.
  • scale_policy (List of Object) (see below for nested schema)
  • service_account_id (String) Service account which linked to the resource.
  • status (String) The status of the instance.
  • variables (Map of String) A set of key/value variables pairs to assign to the instance group.

Nested Schema for Nested Schema for allocation_policy

Read-Only:

  • instance_tags_pool (Block List) Array of availability zone IDs with list of instance tags. (see below for nested schema)

  • zones (Set of String) A list of availability zones.

Nested Schema for Nested Schema for allocation_policy.instance_tags_pool

Read-Only:

  • tags (List of String) List of tags for instances in zone.

  • zone (String) Availability zone.

Nested Schema for Nested Schema for application_balancer_state

Read-Only:

  • status_message (String)
  • target_group_id (String)

Nested Schema for Nested Schema for application_load_balancer

Read-Only:

  • ignore_health_checks (Boolean) Do not wait load balancer health checks.

  • max_opening_traffic_duration (Number) Timeout for waiting for the VM to be checked by the load balancer. If the timeout is exceeded, the VM will be turned off based on the deployment policy. Specified in seconds.

  • status_message (String) The status message of the instance.

  • target_group_description (String) A description of the target group.

  • target_group_id (String) The ID of the target group.

  • target_group_labels (Map of String) A set of key/value label pairs.

  • target_group_name (String) The name of the target group.

Nested Schema for Nested Schema for deploy_policy

Read-Only:

  • max_creating (Number) The maximum number of instances that can be created at the same time.

  • max_deleting (Number) The maximum number of instances that can be deleted at the same time.

  • max_expansion (Number) The maximum number of instances that can be temporarily allocated above the group's target size during the update process.

  • max_unavailable (Number) The maximum number of running instances that can be taken offline (stopped or deleted) at the same time during the update process.

  • startup_duration (Number) The amount of time in seconds to allow for an instance to start. Instance will be considered up and running (and start receiving traffic) only after the startup_duration has elapsed and all health checks are passed.

  • strategy (String) Affects the lifecycle of the instance during deployment. If set to proactive (default), Instance Groups can forcefully stop a running instance. If opportunistic, Instance Groups does not stop a running instance. Instead, it will wait until the instance stops itself or becomes unhealthy.

Nested Schema for Nested Schema for health_check

Read-Only:

  • healthy_threshold (Number) The number of successful health checks before the managed instance is declared healthy.

  • http_options (Block List, Max: 1) HTTP check options. (see below for nested schema)

  • interval (Number) The interval to wait between health checks in seconds.

  • tcp_options (Block List, Max: 1) TCP check options. (see below for nested schema)

  • timeout (Number) The length of time to wait for a response before the health check times out in seconds.

  • unhealthy_threshold (Number) The number of failed health checks before the managed instance is declared unhealthy.

Nested Schema for Nested Schema for health_check.http_options

Read-Only:

  • path (String) The URL path used for health check requests.

  • port (Number) The port used for HTTP health checks.

Nested Schema for Nested Schema for health_check.tcp_options

Read-Only:

  • port (Number) The port used for TCP health checks.

Nested Schema for Nested Schema for instance_template

Read-Only:

  • boot_disk (Block List, Min: 1, Max: 1) Boot disk specifications for the instance. (see below for nested schema)

  • description (String) A description of the instance.

  • filesystem (Block Set) List of filesystems to attach to the instance. (see below for nested schema)

  • hostname (String) Hostname template for the instance. This field is used to generate the FQDN value of instance. The hostname must be unique within the network and region. If not specified, the hostname will be equal to id of the instance and FQDN will be <id>.auto.internal. Otherwise FQDN will be <hostname>.<region_id>.internal.

  • labels (Map of String) A set of key/value label pairs to assign to the instance.

  • metadata (Map of String) A set of metadata key/value pairs to make available from within the instance.

  • metadata_options (Block List, Max: 1) Options allow user to configure access to managed instances metadata (see below for nested schema)

  • name (String) Name template of the instance.

  • network_interface (Block List, Min: 1) Network specifications for the instance. This can be used multiple times for adding multiple interfaces. (see below for nested schema)

  • network_settings (Block List) Network acceleration type for instance. (see below for nested schema)

  • placement_policy (Block List, Max: 1) The placement policy configuration. (see below for nested schema)

  • platform_id (String) The ID of the hardware platform configuration for the instance.

  • resources (Block List, Min: 1, Max: 1) Compute resource specifications for the instance. (see below for nested schema)

  • scheduling_policy (Block List, Max: 1) The scheduling policy configuration. (see below for nested schema)

  • secondary_disk (Block List) A list of disks to attach to the instance. (see below for nested schema)

  • service_account_id (String) The ID of the service account authorized for this instance.

Nested Schema for Nested Schema for instance_template.boot_disk

Read-Only:

  • device_name (String) This value can be used to reference the device under /dev/disk/by-id/.

  • disk_id (String) The ID of the existing disk (such as those managed by yandex_compute_disk) to attach as a boot disk.

  • initialize_params (Block List, Max: 1) Parameters for creating a disk alongside the instance. (see below for nested schema)

  • mode (String) The access mode to the disk resource. By default a disk is attached in READ_WRITE mode.

  • name (String) When set can be later used to change DiskSpec of actual disk.

Nested Schema for Nested Schema for instance_template.boot_disk.initialize_params

Read-Only:

  • description (String) A description of the boot disk.

  • image_id (String) The disk image to initialize this disk from.

  • size (Number) The size of the disk in GB.

  • snapshot_id (String) The snapshot to initialize this disk from.

  • type (String) The disk type.

Nested Schema for Nested Schema for instance_template.filesystem

Read-Only:

  • device_name (String) Name of the device representing the filesystem on the instance.

  • filesystem_id (String) ID of the filesystem that should be attached.

  • mode (String) Mode of access to the filesystem that should be attached. By default, filesystem is attached in READ_WRITE mode.

Nested Schema for Nested Schema for instance_template.metadata_options

Read-Only:

  • aws_v1_http_endpoint (Number) Enables access to AWS flavored metadata (IMDSv1). Possible values: 0, 1 for enabled and 2 for disabled.

  • aws_v1_http_token (Number) Enables access to IAM credentials with AWS flavored metadata (IMDSv1). Possible values: 0, 1 for enabled and 2 for disabled.

  • gce_http_endpoint (Number) Enables access to GCE flavored metadata. Possible values: 0, 1 for enabled and 2 for disabled.

  • gce_http_token (Number) Enables access to IAM credentials with GCE flavored metadata. Possible values: 0, 1 for enabled and 2 for disabled.

Nested Schema for Nested Schema for instance_template.network_interface

Read-Only:

  • dns_record (Block List) List of DNS records. (see below for nested schema)

  • ip_address (String) Manual set static IP address.

  • ipv4 (Boolean) Allocate an IPv4 address for the interface. The default value is true.

  • ipv6 (Boolean) If true, allocate an IPv6 address for the interface. The address will be automatically assigned from the specified subnet.

  • ipv6_address (String) Manual set static IPv6 address.

  • ipv6_dns_record (Block List) List of IPv6 DNS records. (see below for nested schema)

  • nat (Boolean) Flag for using NAT.

  • nat_dns_record (Block List) List of NAT DNS records. (see below for nested schema)

  • nat_ip_address (String) A public address that can be used to access the internet over NAT. Use variables to set.

  • network_id (String) The ID of the network.

  • security_group_ids (Set of String) Security group (SG) IDs for network interface.

  • subnet_ids (Set of String) The ID of the subnets to attach this interface to.

Nested Schema for Nested Schema for instance_template.network_interface.dns_record

Read-Only:

  • dns_zone_id (String) DNS zone id (if not set, private zone used).

  • fqdn (String) DNS record FQDN (must have dot at the end).

  • ptr (Boolean) When set to true, also create PTR DNS record.

  • ttl (Number) DNS record TTL.

Nested Schema for Nested Schema for instance_template.network_interface.ipv6_dns_record

Read-Only:

  • dns_zone_id (String) DNS zone id (if not set, private zone used).

  • fqdn (String) DNS record FQDN (must have dot at the end).

  • ptr (Boolean) When set to true, also create PTR DNS record.

  • ttl (Number) DNS record TTL.

Nested Schema for Nested Schema for instance_template.network_interface.nat_dns_record

Read-Only:

  • dns_zone_id (String) DNS zone id (if not set, private zone used).

  • fqdn (String) DNS record FQDN (must have dot at the end).

  • ptr (Boolean) When set to true, also create PTR DNS record.

  • ttl (Number) DNS record TTL.

Nested Schema for Nested Schema for instance_template.network_settings

Read-Only:

  • type (String) Network acceleration type. By default a network is in STANDARD mode.

Nested Schema for Nested Schema for instance_template.placement_policy

Read-Only:

  • placement_group_id (String) Specifies the id of the Placement Group to assign to the instances.

Nested Schema for Nested Schema for instance_template.resources

Read-Only:

  • core_fraction (Number) If provided, specifies baseline core performance as a percent.

  • cores (Number) The number of CPU cores for the instance.

  • gpus (Number) If provided, specifies the number of GPU devices for the instance.

  • memory (Number) The memory size in GB.

Nested Schema for Nested Schema for instance_template.scheduling_policy

Read-Only:

  • preemptible (Boolean) Specifies if the instance is preemptible. Defaults to false.

Nested Schema for Nested Schema for instance_template.secondary_disk

Read-Only:

  • device_name (String) This value can be used to reference the device under /dev/disk/by-id/.

  • disk_id (String) ID of the existing disk. To set use variables.

  • initialize_params (Block List, Max: 1) Parameters used for creating a disk alongside the instance. (see below for nested schema)

  • mode (String) The access mode to the disk resource. By default a disk is attached in READ_WRITE mode.

  • name (String) When set can be later used to change DiskSpec of actual disk.

Nested Schema for Nested Schema for instance_template.secondary_disk.initialize_params

Read-Only:

  • description (String) A description of the boot disk.

  • image_id (String) The disk image to initialize this disk from.

  • size (Number) The size of the disk in GB.

  • snapshot_id (String) The snapshot to initialize this disk from.

  • type (String) The disk type.

Nested Schema for Nested Schema for instances

Read-Only:

  • fqdn (String)

  • instance_id (String)

  • instance_tag (String)

  • name (String)

  • network_interface (List of Object) (see below for nested schema) (see below for nested schema)

  • status (String)

  • status_changed_at (String)

  • status_message (String)

  • zone_id (String)

Nested Schema for Nested Schema for instances.network_interface

Read-Only:

  • index (Number)
  • ip_address (String)
  • ipv4 (Boolean)
  • ipv6 (Boolean)
  • ipv6_address (String)
  • mac_address (String)
  • nat (Boolean)
  • nat_ip_address (String)
  • nat_ip_version (String)
  • subnet_id (String)

Nested Schema for Nested Schema for load_balancer

Read-Only:

  • ignore_health_checks (Boolean) Do not wait load balancer health checks.

  • max_opening_traffic_duration (Number) Timeout for waiting for the VM to be checked by the load balancer. If the timeout is exceeded, the VM will be turned off based on the deployment policy. Specified in seconds.

  • status_message (String) The status message of the target group.

  • target_group_description (String) A description of the target group.

  • target_group_id (String) The ID of the target group.

  • target_group_labels (Map of String) A set of key/value label pairs.

  • target_group_name (String) The name of the target group.

Nested Schema for Nested Schema for load_balancer_state

Read-Only:

  • status_message (String)
  • target_group_id (String)

Nested Schema for Nested Schema for scale_policy

Read-Only:

  • auto_scale (Block List, Max: 1) The auto scaling policy of the instance group. (see below for nested schema)

  • fixed_scale (Block List, Max: 1) The fixed scaling policy of the instance group. (see below for nested schema)

  • test_auto_scale (Block List, Max: 1) The test auto scaling policy of the instance group. Use it to test how the auto scale works. (see below for nested schema)

Nested Schema for Nested Schema for scale_policy.auto_scale

Read-Only:

  • auto_scale_type (String) Autoscale type, can be ZONAL or REGIONAL. By default ZONAL type is used.

  • cpu_utilization_target (Number) Target CPU load level.

  • custom_rule (Block List) A list of custom rules. (see below for nested schema)

  • initial_size (Number) The initial number of instances in the instance group.

  • max_size (Number) The maximum number of virtual machines in the group.

  • measurement_duration (Number) The amount of time, in seconds, that metrics are averaged for. If the average value at the end of the interval is higher than the cpu_utilization_target, the instance group will increase the number of virtual machines in the group.

  • min_zone_size (Number) The minimum number of virtual machines in a single availability zone.

  • stabilization_duration (Number) The minimum time interval, in seconds, to monitor the load before an instance group can reduce the number of virtual machines in the group. During this time, the group will not decrease even if the average load falls below the value of cpu_utilization_target.

  • warmup_duration (Number) The warm-up time of the virtual machine, in seconds. During this time, traffic is fed to the virtual machine, but load metrics are not taken into account.

Nested Schema for Nested Schema for scale_policy.auto_scale.custom_rule

Read-Only:

  • folder_id (String) If specified, sets the folder id to fetch metrics from. By default, it is the ID of the folder the group belongs to.

  • labels (Map of String) Metrics labels from Monitoring.

  • metric_name (String) Name of the metric in Monitoring.

  • metric_type (String) Type of metric, can be GAUGE or COUNTER. GAUGE metric reflects the value at particular time point. COUNTER metric exhibits a monotonous growth over time.

  • rule_type (String) The metric rule type (UTILIZATION, WORKLOAD). UTILIZATION for metrics describing resource utilization per VM instance. WORKLOAD for metrics describing total workload on all VM instances.

  • service (String) If specified, sets the service name to fetch metrics. The default value is custom. You can use a label to specify service metrics, e.g., service with the compute value for Compute Cloud.

  • target (Number) Target metric value by which Instance Groups calculates the number of required VM instances.

Nested Schema for Nested Schema for scale_policy.fixed_scale

Read-Only:

  • size (Number) The number of instances in the instance group.

Nested Schema for Nested Schema for scale_policy.test_auto_scale

Read-Only:

  • auto_scale_type (String) Autoscale type, can be ZONAL or REGIONAL. By default ZONAL type is used.

  • cpu_utilization_target (Number) Target CPU load level.

  • custom_rule (Block List) A list of custom rules. (see below for nested schema)

  • initial_size (Number) The initial number of instances in the instance group.

  • max_size (Number) The maximum number of virtual machines in the group.

  • measurement_duration (Number) The amount of time, in seconds, that metrics are averaged for. If the average value at the end of the interval is higher than the cpu_utilization_target, the instance group will increase the number of virtual machines in the group.

  • min_zone_size (Number) The minimum number of virtual machines in a single availability zone.

  • stabilization_duration (Number) The minimum time interval, in seconds, to monitor the load before an instance group can reduce the number of virtual machines in the group. During this time, the group will not decrease even if the average load falls below the value of cpu_utilization_target.

  • warmup_duration (Number) The warm-up time of the virtual machine, in seconds. During this time, traffic is fed to the virtual machine, but load metrics are not taken into account.

Nested Schema for Nested Schema for scale_policy.test_auto_scale.custom_rule

Read-Only:

  • folder_id (String) Folder ID of custom metric in Yandex Monitoring that should be used for scaling.

  • labels (Map of String) A map of labels of metric.

  • metric_name (String) The name of metric.

  • metric_type (String) Metric type, GAUGE or COUNTER.

  • rule_type (String) Rule type: UTILIZATION - This type means that the metric applies to one instance. First, Instance Groups calculates the average metric value for each instance, then averages the values for instances in one availability zone. This type of metric must have the instance_id label. WORKLOAD - This type means that the metric applies to instances in one availability zone. This type of metric must have the zone_id label.

  • service (String) Service of custom metric in Yandex Monitoring that should be used for scaling.

  • target (Number) Target metric value level.

Была ли статья полезна?

Предыдущая
compute_instance
Следующая
compute_placement_group
Проект Яндекса
© 2025 ТОО «Облачные Сервисы Казахстан»