Skip to content

Commit

Permalink
Adding outputs for Firewall Rules, Router and NATs
Browse files Browse the repository at this point in the history
  • Loading branch information
rajivreddy committed Apr 17, 2024
1 parent bfae967 commit 0ef61fb
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,12 @@ No modules.

| Name | Description |
|------|-------------|
| <a name="output_firewall_id"></a> [firewall\_id](#output\_firewall\_id) | an identifier for the resource with format projects/{{project}}/global/firewalls/{{name}} |
| <a name="output_gateway_ipv4"></a> [gateway\_ipv4](#output\_gateway\_ipv4) | The gateway address for default routing out of the network. This value is selected by GCP. |
| <a name="output_id"></a> [id](#output\_id) | an identifier for the resource with format projects/{{project}}/global/networks/{{name}} |
| <a name="output_nat_id"></a> [nat\_id](#output\_nat\_id) | an identifier for the resource with format projects/{{project}}/regions/{{region}}/routers/{{router\_name}}/nat |
| <a name="output_numeric_id"></a> [numeric\_id](#output\_numeric\_id) | The unique identifier for the resource. This identifier is defined by the server. |
| <a name="output_router_id"></a> [router\_id](#output\_router\_id) | an identifier for the resource with format projects/{{project}}/regions/{{region}}/routers/{{name}} |
| <a name="output_self_link"></a> [self\_link](#output\_self\_link) | The URI of the created resource. |
| <a name="output_subnet_ids"></a> [subnet\_ids](#output\_subnet\_ids) | n/a |
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
9 changes: 9 additions & 0 deletions example/sample/outputs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
output "subnet_ids" {
description = "description"
value = module.vpc.subnet_ids
}

output "firewall_id" {
description = "description"
value = module.vpc.firewall_id
}
18 changes: 18 additions & 0 deletions outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,21 @@ output "subnet_ids" {
}
}
}

### Firewall Outputs ###
output "firewall_id" {
description = "an identifier for the resource with format projects/{{project}}/global/firewalls/{{name}}"
value = try(values(google_compute_firewall.this)[*].id, [])
}

### Router Outputs ###
output "router_id" {
description = "an identifier for the resource with format projects/{{project}}/regions/{{region}}/routers/{{name}}"
value = try(google_compute_router.this[0].id, null)
}

### NAT Outputs ###
output "nat_id" {
description = "an identifier for the resource with format projects/{{project}}/regions/{{region}}/routers/{{router_name}}/nat"
value = try(google_compute_router_nat.this[0].id, null)
}
File renamed without changes.

0 comments on commit 0ef61fb

Please sign in to comment.