Skip to content

Terraform module to manage Compute Instance Group resources within the Yandex.Cloud.

License

Notifications You must be signed in to change notification settings

terraform-yacloud-modules/terraform-yandex-instance-group

Repository files navigation

Yandex Cloud VM Instance group Terraform module

Terraform module which creates Yandex Cloud VM Instance group resources.

Examples

Examples codified under the examples are intended to give users references for how to use the module(s) as well as testing/validating changes to the source code of the module. If contributing to the project, please be sure to make any appropriate updates to the relevant examples to allow maintainers to test your changes and to keep the examples up to date for users. Thank you!

Requirements

Name Version
terraform >= 1.3
tls >= 3.1.0
yandex >= 0.72.0

Providers

Name Version
tls >= 3.1.0
yandex >= 0.72.0

Modules

No modules.

Resources

Name Type
tls_private_key.this resource
yandex_compute_disk.main resource
yandex_compute_instance_group.this resource
yandex_compute_image.this data source

Inputs

Name Description Type Default Required
boot_disk Basic boot disk parameters
object({
mode = optional(string)
device_name = optional(string)
})
{} no
boot_disk_initialize_params Additional boot disk parameters
object({
size = optional(number, 10)
type = optional(string, "network-hdd")
})
{} no
core_fraction Core fraction applied to instance number null no
cores Cores allocated to instance number 2 no
deletion_protection Flag that protects the instance group from accidental deletion bool false no
deploy_policy Instance group deploy policy
object({
max_unavailable = number
max_expansion = number
max_deleting = optional(number)
max_creating = optional(number)
startup_duration = optional(string)
strategy = optional(string, "proactive")
})
{
"max_expansion": 1,
"max_unavailable": 1
}
no
enable_alb_integration If true, Application load balancer integration will be created bool false no
enable_nat Enable public IPv4 address bool false no
enable_nlb_integration If true, Network load balancer integration will be created bool false no
generate_ssh_key If true, SSH key will be generated for instance group string true no
health_check Health check configuration
object({
enabled = optional(bool, false)
interval = optional(number, 15)
timeout = optional(number, 10)
healthy_threshold = optional(number, 3)
unhealthy_threshold = optional(number, 3)
tcp_options = optional(object({
port = number
}), null)
http_options = optional(object({
port = number,
path = string
}), null)
})
{
"enabled": true,
"tcp_options": {
"port": 8080
}
}
no
hostname Hostname of the instance. More info: https://cloud.yandex.ru/docs/compute/concepts/network#hostname string null no
image_family Default image family name (lowest priority) string "ubuntu-2004-lts" no
image_id Image ID (medium priority) string null no
image_snapshot_id Image snapshot id to initialize from.
Highest priority over var.image_id
and var.image_family"
string null no
instance_description Instance description string null no
instance_group_description Instance group description string null no
labels A set of labels which will be applied to all resources map(string) {} no
max_checking_health_duration Timeout for waiting for the VM to become healthy number 10 no
memory Memory allocated to instance (in Gb) number 2 no
name Name which will be used for all resources string n/a yes
network_acceleration_type Network acceleration type string "STANDARD" no
network_id Network ID string null no
platform_id Hardware CPU platform name (Intel Ice Lake by default) string "standard-v3" no
preemptible Make instance preemptible bool false no
scale Instance group scaling policy
object({
fixed = optional(object({
size = number
}), null)
auto = optional(object({
initial_size = number
measurement_duration = number
cpu_utilization_target = string
min_zone_size = number
max_size = number
warmup_duration = string
stabilization_duration = string
}), null)

})
{
"fixed": {
"size": 1
}
}
no
secondary_disks Additional disks with params
map(object({
enabled = optional(bool, true)
description = optional(string, "")
labels = optional(map(string), {})
zone = optional(string, null)
size = optional(number, 10)
block_size = optional(number, 4096)
type = optional(string, "network-hdd")

mode = optional(string, "READ_WRITE")
device_name = optional(string, "data")
}))
{} no
security_group_ids Security group IDs linked to instances list(string) null no
serial_port_enable Enable serial port on instances bool false no
service_account_id ID of the service account authorized for instance string null no
ssh_pubkey Public RSA key path to inject string null no
ssh_user Initial SSH username for instance string "ubuntu" no
subnet_ids VPC Subnet IDs list(string) [] no
user_data Cloud-init user-data string null no
variables A set of key/value variables pairs to assign to the instance group map(string) {} no
zones A list of availability zones list(string) [] no

Outputs

Name Description
compute_disks Secondary disk's data
instance_group_id Compute instance group ID
ssh_key_prv Private SSH key
ssh_key_pub Public SSH key
target_group_id Target group ID

License

Apache-2.0 Licensed. See LICENSE.