VK Cloud logo

ivkcs_agent_init resource

Resource arguments

Name

Description

Format

Required

Resource recreation on value change

uuid

Service instance identifier

string

ivkcs_agent_init resource

ivkcs_agent_init resource

hosts

List of host names for agent initialization

list, list elements — string

ivkcs_agent_init resource

ivkcs_agent_init resource

options

Agent initialization options

set, list arguments — in the table.

ivkcs_agent_init resource

ivkcs_agent_init resource

Agent initialization options

Name

Description

Format

Default value

memory_limit

Limit of RAM used for the agent, MB

integer

256

Returned parameters

The ivkcs_agent_init resource returns the agent attribute in the format of a list of strings. The index in the list corresponds to the index of the host passed in the hosts argument. The value is a bash script. The bash script functions:

  • Requests the agent from the configuration management service.
  • Downloads the agent and installs it on the hosts.
  • Issues access keys to the hosts for the configuration management service.

Example of resource description

resource "ivkcs_agent_init" "init" {	uuid = "<UUID>"	hosts = ["<LIST_OF_HOST_NAMES>"]	options {		memory_limit = 512	}}

Here:

  • <UUID> — service instance identifier.
  • <LIST_OF_HOST_NAMES> — list of host names on which monitoring will be performed. The host names must exactly match the VM names defined in your Terraform configuration (usually in the vkcs_compute_instance resource).

Examples of specifying host names

  • Using a local variable (recommended approach):

    locals {hosts_name = "${substr(var.instance_uuid, 0, 8)}-myapp"}resource "ivkcs_agent_check" "health" {hosts = [local.hosts_name]  # Use the value from localsuuid  = var.instance_uuid# ...}
  • Specifying the host name directly:

    resource "ivkcs_agent_check" "health" {hosts = ["myapp-production-server"]  # Specify a fixed host nameuuid  = var.instance_uuid# ...}
  • Specifying the host name via a variable in the vkcs_compute_instance resource:

    resource "vkcs_compute_instance" "app_server" {name = "app-production-vm"  # Define a variable containing the host name# ...}resource "ivkcs_agent_check" "health" {hosts = [vkcs_compute_instance.app_server.name]  # Use the value of the host name variableuuid  = var.instance_uuid# ...}
Was this article helpful?