Skip to content

Commit

Permalink
Merge pull request #10 from Coalfire-CF/add-outputs
Browse files Browse the repository at this point in the history
Add VM outputs
  • Loading branch information
matt-pappas-cf authored Feb 29, 2024
2 parents 8fe298c + e4253bc commit caadb44
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 7 deletions.
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,17 @@ No modules.

| Name | Description |
|------|-------------|
| <a name="output_id"></a> [id](#output\_id) | ID of instance. |
| <a name="output_image"></a> [image](#output\_image) | Self-link of the image. |
| <a name="output_instance_id"></a> [instance\_id](#output\_instance\_id) | Server-assigned unique identifier of this instance. |
| <a name="output_instances_details"></a> [instances\_details](#output\_instances\_details) | List of all details for compute instances |
| <a name="output_instances_self_links"></a> [instances\_self\_links](#output\_instances\_self\_links) | List of self-links for compute instances |
| <a name="output_labels"></a> [labels](#output\_labels) | Labels that will be associated with the instance. |
| <a name="output_name"></a> [name](#output\_name) | Name of instance. |
| <a name="output_private_ip"></a> [private\_ip](#output\_private\_ip) | Private IP address assigned to the instance. |
| <a name="output_public_ip"></a> [public\_ip](#output\_public\_ip) | Public IP address assigned to the instance. |
| <a name="output_self_link"></a> [self\_link](#output\_self\_link) | Self-link of the instance. |
| <a name="output_service_account"></a> [service\_account](#output\_service\_account) | Service account attached to the instance. |
| <a name="output_status"></a> [status](#output\_status) | Current status of the instance. |
| <a name="output_tags"></a> [tags](#output\_tags) | Tags that will be associated with the instance. |
| <a name="output_zone"></a> [zone](#output\_zone) | Zone that the instance is located in. |
<!-- END_TF_DOCS -->
68 changes: 62 additions & 6 deletions outputs.tf
Original file line number Diff line number Diff line change
@@ -1,9 +1,65 @@
output "instances_self_links" {
description = "List of self-links for compute instances"
value = google_compute_instance.compute_instance.*.self_link
}

output "instances_details" {
description = "List of all details for compute instances"
value = google_compute_instance.compute_instance.*
}
sensitive = true
}

output "name" {
description = "Name of instance."
value = google_compute_instance.compute_instance.*.name
}

output "id" {
description = "ID of instance."
value = google_compute_instance.compute_instance.*.id
}

output "instance_id" {
description = "Server-assigned unique identifier of this instance."
value = google_compute_instance.compute_instance.*.instance_id
}

output "self_link" {
description = "Self-link of the instance."
value = google_compute_instance.compute_instance.*.self_link
}

output "status" {
description = "Current status of the instance."
value = google_compute_instance.compute_instance.*.current_status
}

output "zone" {
description = "Zone that the instance is located in."
value = google_compute_instance.compute_instance.*.zone
}

output "labels" {
description = "Labels that will be associated with the instance."
value = google_compute_instance.compute_instance.*.labels
}

output "tags" {
description = "Tags that will be associated with the instance."
value = google_compute_instance.compute_instance.*.tags
}

output "private_ip" {
description = "Private IP address assigned to the instance."
value = google_compute_instance.compute_instance.*.network_interface.0.network_ip
}

output "public_ip" {
description = "Public IP address assigned to the instance."
value = try(google_compute_instance.compute_instance.*.network_interface.0.access_config.0.nat_ip, null)
}

output "image" {
description = "Self-link of the image."
value = google_compute_instance.compute_instance.*.boot_disk.0.initialize_params.0.image
}

output "service_account" {
description = "Service account attached to the instance."
value = google_compute_instance.compute_instance.*.service_account.0.email
}

0 comments on commit caadb44

Please sign in to comment.