VK Cloud logo

Description of output parameters

Describe the output parameters so that they can be sent to the user by email after the manifest is executed and the service is deployed.

If an output parameter contains sensitive data, set the sensitive attribute. In this case, the output parameter data will be passed to the user, but will not be saved to Terraform logs.

The following can be passed to the user in the output parameters:

  • The IP address of the created service instance VM.

    Example of an output parameter for the VM IP address
    # Output the VM IP addressoutput "address" {  description = "The host IP-address"  value = vkcs_compute_instance.compute.access_ip_v4}
  • Passwords for the initial setup of the service instance, generated by a script.

    Example of an output parameter for script results
    # Script executionresource "ivkcs_agent_exec" "start" {  hosts = [local.hosts_name]  name  = "start"  uuid  = var.instance_uuid  step {    index   = 1    type    = "bash"    content = pwgen 25 1    options {      timeout                = "10m"      attempts               = 1    }  }  depends_on = [    vkcs_compute_instance.compute,    vkcs_compute_volume_attach.attached,  ]}# Requesting script resultsdata "ivkcs_agent_script_result" "password" {  uuid  = var.instance_uuid  host  = local.hosts_names[0]  group = ivkcs_agent_exec.start.name  index = 1  depends_on = [    ivkcs_agent_exec.start  ]}# Output of script resultsoutput "password" {  description = "password"  value = data.ivkcs_agent_script_result.password.result  sensitive = true}
  • Passwords for the initial setup of the service instance, generated using the random_password resource.

    Example of an output parameter for a password generated using the `random_password` resource
    output "default_password" {  value     = random_password.user.result  sensitive = true}
  • A private SSH key for accessing the service instance VM.

    Example of an output parameter for a private SSH key
    output "private_key" {  value     = ivkcs_ssh_keypair.key.private_key  sensitive = true}
Was this article helpful?