Skip to content

Commit

Permalink
fix: add an Organization Policy that prevents VM instances with publi…
Browse files Browse the repository at this point in the history
…c IPs (#245)
  • Loading branch information
daniel-cit authored Dec 16, 2021
1 parent c38eb81 commit 5f1d3ad
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions modules/org-policies/compute.tf
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,13 @@ module "vpc_subnetwork_policy" {
allow = var.trusted_subnetworks
allow_list_length = length(var.trusted_subnetworks)
}

module "vm_external_ip_access" {
source = "terraform-google-modules/org-policy/google"
version = "~> 4.0"
policy_for = "project"
project_id = var.project_id
constraint = "constraints/compute.vmExternalIpAccess"
policy_type = "list"
enforce = "true"
}

0 comments on commit 5f1d3ad

Please sign in to comment.