Skip to main content
policy.yaml626 B
View on GitHub
apiVersion: atmos/v1
kind: Policy
metadata:
name: lifecycle-lint-successful-plan
description: "Require TFLint to run and succeed after each successful Terraform plan."
spec:
policies:
lint-successful-plan:
on: operation
engine: starlark
action: hooks
rule: |
return ctx.input["event"] == "after.terraform.plan" and ctx.input["status"] == "success"

hooks:
- ref: lint
event: after.terraform.plan
required: true
require_success: true
hooks:
lint:
kind: command
command: tflint
args:
- --recursive
tools: {}