#@ load("/constraints.lib.star", "build_constraint")
#@ constraint = build_constraint("cloudsqlDisableExternalIP")

#@ if constraint.to_generate():
name: #@ constraint.constraint_name()
resourceTypes:
- sqladmin.googleapis.com/Instance
methodTypes:
- CREATE
- UPDATE
condition: "resource.settings.ipConfiguration.ipv4Enabled == true"
actionType: DENY
display_name: Require Cloud SQL database instances to not have external IP address
description: Ensure That Cloud SQL database instances do not configure external IP address
#@ end