Amazon CloudFormation Guard (cfn-guard) is an open-source policy-as-code tool that validates infrastructure-as-code templates against rules written in its own domain-specific language, helping teams enforce standards before resources are ever deployed.
Git pre-commit hooks run automatically before a commit is finalized and can reject it outright if a check fails, giving teams a way to catch issues at the earliest point in the development workflow. The open-source pre-commit framework makes these checks easy to share and maintain across a team's repositories.
In this lab, you will configure a pre-commit hook that pulls centrally maintained tagging rules from Amazon S3, write a cfn-guard rule enforcing required tags, and apply that enforcement to both a CloudFormation template and a Terraform configuration, catching missing or invalid tags before either ever reaches a deploy.
Upon completion of this beginner-level lab, you will be able to:
Familiarity with the following will be beneficial but is not required:
The following content can be used to fulfill the prerequisites: