ivkcs_agent_init resource
Name | Description | Format | Required | Resource recreation on value change |
|---|---|---|---|---|
| Service instance identifier | string | ||
| List of host names for agent initialization | list, list elements — string | ||
| Agent initialization options | set, list arguments — in the table. |
Name | Description | Format | Default value |
|---|---|---|---|
| Limit of RAM used for the agent, MB | integer | 256 |
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.
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 thevkcs_compute_instanceresource).
-
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_instanceresource: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?