Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add internal_ips output to compute-vm module #891

Merged
merged 3 commits into from
Oct 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 7 additions & 6 deletions modules/compute-vm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -315,12 +315,13 @@ module "instance-group" {
| [group](outputs.tf#L26) | Instance group resource. | |
| [instance](outputs.tf#L31) | Instance resource. | |
| [internal_ip](outputs.tf#L36) | Instance main interface internal IP address. | |
| [self_link](outputs.tf#L44) | Instance self links. | |
| [service_account](outputs.tf#L49) | Service account resource. | |
| [service_account_email](outputs.tf#L56) | Service account email. | |
| [service_account_iam_email](outputs.tf#L61) | Service account email. | |
| [template](outputs.tf#L69) | Template resource. | |
| [template_name](outputs.tf#L74) | Template name. | |
| [internal_ips](outputs.tf#L44) | Instance interfaces internal IP addresses. | |
| [self_link](outputs.tf#L52) | Instance self links. | |
| [service_account](outputs.tf#L57) | Service account resource. | |
| [service_account_email](outputs.tf#L64) | Service account email. | |
| [service_account_iam_email](outputs.tf#L69) | Service account email. | |
| [template](outputs.tf#L77) | Template resource. | |
| [template_name](outputs.tf#L82) | Template name. | |

<!-- END TFDOC -->
## TODO
Expand Down
8 changes: 8 additions & 0 deletions modules/compute-vm/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,14 @@ output "internal_ip" {
)
}

output "internal_ips" {
description = "Instance interfaces internal IP addresses."
value = [
for nic in try(google_compute_instance.default.0.network_interface, [])
: nic.network_ip
]
}

output "self_link" {
description = "Instance self links."
value = try(google_compute_instance.default.0.self_link, null)
Expand Down