Skip to content

Commit 5f1d3ad

Browse files
authored
fix: add an Organization Policy that prevents VM instances with public IPs (#245)
1 parent c38eb81 commit 5f1d3ad

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

modules/org-policies/compute.tf

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,13 @@ module "vpc_subnetwork_policy" {
5858
allow = var.trusted_subnetworks
5959
allow_list_length = length(var.trusted_subnetworks)
6060
}
61+
62+
module "vm_external_ip_access" {
63+
source = "terraform-google-modules/org-policy/google"
64+
version = "~> 4.0"
65+
policy_for = "project"
66+
project_id = var.project_id
67+
constraint = "constraints/compute.vmExternalIpAccess"
68+
policy_type = "list"
69+
enforce = "true"
70+
}

0 commit comments

Comments
 (0)