Skip to content

Instantly share code, notes, and snippets.

@liskl
Created April 7, 2020 13:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save liskl/098962e56b87e613d49e332a96e87fd5 to your computer and use it in GitHub Desktop.
Save liskl/098962e56b87e613d49e332a96e87fd5 to your computer and use it in GitHub Desktop.
terraform conftest example
package main
import input
resource_whitelist = {
"kafka_topic"
}
resource_changes[r] {
input.resource_changes[_].change.actions[_] != "no-op"
r := input.resource_changes[_].type
not resource_whitelist[r]
}
deny[msg] {
count(resource_changes) > 0
msg := sprintf("resource type %s is not preapproved", [resource_changes[_]])
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment