github.com/weaveworks/common@v0.0.0-20230728070032-dd9e68f319d5/tools/provisioning/gcp/outputs.tf (about)

     1  output "username" {
     2    value = "${var.gcp_username}"
     3  }
     4  
     5  output "public_ips" {
     6    value = ["${google_compute_instance.tf_test_vm.*.network_interface.0.access_config.0.assigned_nat_ip}"]
     7  }
     8  
     9  output "private_ips" {
    10    value = ["${google_compute_instance.tf_test_vm.*.network_interface.0.address}"]
    11  }
    12  
    13  output "hostnames" {
    14    value = "${join("\n", 
    15      "${formatlist("%v.%v.%v", 
    16        google_compute_instance.tf_test_vm.*.name, 
    17        google_compute_instance.tf_test_vm.*.zone, 
    18        var.app
    19      )}"
    20    )}"
    21  }
    22  
    23  # /etc/hosts file for the Compute Engine instances:
    24  output "private_etc_hosts" {
    25    value = "${join("\n", 
    26      "${formatlist("%v %v.%v.%v", 
    27        google_compute_instance.tf_test_vm.*.network_interface.0.address, 
    28        google_compute_instance.tf_test_vm.*.name, 
    29        google_compute_instance.tf_test_vm.*.zone, 
    30        var.app
    31      )}"
    32    )}"
    33  }
    34  
    35  # /etc/hosts file for the client:
    36  output "public_etc_hosts" {
    37    value = "${join("\n", 
    38      "${formatlist("%v %v.%v.%v", 
    39        google_compute_instance.tf_test_vm.*.network_interface.0.access_config.0.assigned_nat_ip, 
    40        google_compute_instance.tf_test_vm.*.name, 
    41        google_compute_instance.tf_test_vm.*.zone, 
    42        var.app
    43      )}"
    44    )}"
    45  }
    46  
    47  output "ansible_inventory" {
    48    value = "${format("[all]\n%s", join("\n",
    49      "${formatlist("%v private_ip=%v",
    50        google_compute_instance.tf_test_vm.*.network_interface.0.access_config.0.assigned_nat_ip,
    51        google_compute_instance.tf_test_vm.*.network_interface.0.address
    52      )}"
    53    ))}"
    54  }
    55  
    56  output "private_key_path" {
    57    value = "${var.gcp_private_key_path}"
    58  }
    59  
    60  output "instances_names" {
    61    value = ["${google_compute_instance.tf_test_vm.*.name}"]
    62  }
    63  
    64  output "image" {
    65    value = "${var.gcp_image}"
    66  }
    67  
    68  output "zone" {
    69    value = "${var.gcp_zone}"
    70  }