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

#@ if constraint.to_generate():
name: #@ constraint.constraint_name()
resourceTypes:
- sqladmin.googleapis.com/Instance
methodTypes:
- CREATE
- UPDATE
condition: resource.settings.availabilityType != "REGIONAL"
actionType: DENY
display_name: Require Cloud SQL instances to be configured with high availibility
description: Ensure that Cloud SQL instance is configured with high availibility
#@ end