Skip to content

Commit

Permalink
Fix GCVE network policy (#1948)
Browse files Browse the repository at this point in the history
Co-authored-by: Luca Prete <[email protected]>
  • Loading branch information
LucaPrete and Luca Prete authored Dec 22, 2023
1 parent 06b2a97 commit 44b1115
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
3 changes: 2 additions & 1 deletion modules/gcve-private-cloud/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,5 +158,6 @@ module "gcve-pc" {
|---|---|:---:|
| [vmw_engine_network_config](outputs.tf#L17) | VMware engine network configuration. | |
| [vmw_engine_network_peerings](outputs.tf#L22) | The peerings created towards the user VPC or other VMware engine networks. | |
| [vmw_engine_private_clouds](outputs.tf#L27) | VMware engine private cloud resources. | |
| [vmw_engine_network_policies](outputs.tf#L27) | The network policies associated to the VMware engine network. | |
| [vmw_engine_private_clouds](outputs.tf#L32) | VMware engine private cloud resources. | |
<!-- END TFDOC -->
4 changes: 2 additions & 2 deletions modules/gcve-private-cloud/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,15 @@ data "google_vmwareengine_network" "private_cloud_network" {
location = "global"
}

resource "google_vmwareengine_network_policy" "vmw-engine-network-policy" {
resource "google_vmwareengine_network_policy" "vmw_engine_network_policies" {
provider = google-beta
for_each = var.vmw_network_config.network_policies
project = var.project_id
name = "${var.prefix}-${each.key}"
description = each.value.description
edge_services_cidr = each.value.edge_services_cidr
location = each.value.region
vmware_engine_network = local.vmw_network
vmware_engine_network = local.vmw_network.id

external_ip {
enabled = each.value.expose_on_internet
Expand Down
5 changes: 5 additions & 0 deletions modules/gcve-private-cloud/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ output "vmw_engine_network_peerings" {
value = google_vmwareengine_network_peering.vmw_engine_network_peerings
}

output "vmw_engine_network_policies" {
description = "The network policies associated to the VMware engine network."
value = google_vmwareengine_network_policy.vmw_engine_network_policies
}

output "vmw_engine_private_clouds" {
description = "VMware engine private cloud resources."
value = google_vmwareengine_private_cloud.vmw_engine_private_clouds
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ values:
name: gcve-pc-default
project: gcve-test-project
type: STANDARD
module.gcve-pc.google_vmwareengine_network_policy.vmw-engine-network-policy["ew8"]:
module.gcve-pc.google_vmwareengine_network_policy.vmw_engine_network_policies["ew8"]:
description: Terraform-managed.
edge_services_cidr: 192.168.100.0/26
external_ip:
Expand Down

0 comments on commit 44b1115

Please sign in to comment.