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

#@ if constraint.to_generate():
name: #@ constraint.constraint_name()
resourceTypes:
- sqladmin.googleapis.com/Instance
methodTypes:
- CREATE
- UPDATE
condition: resource.settings.passwordValidationPolicy.minLength == 0
actionType: DENY
display_name: Require Cloud SQL instances to configure root password
description: Ensure that Cloud SQL instance is configured to use a root password
#@ end