tfenforce

command module
v0.0.0-...-f905eb2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 25, 2019 License: Apache-2.0 Imports: 8 Imported by: 0

README

tfenforce

A simple example written in go of how to enforce policies/standards on terraform resources.

Examples

No Violations

Generate the plan and run tfenforce:

cd examples/no_violation
terraform init
terraform plan -out tfplan
terraform show -json tfplan > tfplan.json
go run ../../main.go -tfplan ./tfplan.json

This will output nothing.

IAM Policy Violation

Generate the plan and run tfenforce:

cd examples/iam_violation
terraform init
terraform plan -out tfplan
terraform show -json tfplan > tfplan.json
go run ../../main.go -tfplan ./tfplan.json

This will output a single violation:

cannot declare '*' IAM permission (aws_iam_policy.service-policy-default)

VPC Policy Violation

Generate the plan and run tfenforce:

cd examples/vpc_violation
terraform init
terraform plan -out tfplan
terraform show -json tfplan > tfplan.json
go run ../../main.go -tfplan ./tfplan.json

This will output a single violation:

cannot define aws_vpc resources (aws_vpc.test)

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL