Skip to content

Commit

Permalink
Merge pull request #1 from echoboomer/ga-release
Browse files Browse the repository at this point in the history
First generally available version.
  • Loading branch information
echoboomer authored Sep 9, 2020
2 parents 093ffe3 + 15fbea5 commit a98e57b
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Runs Open Policy Agent against Terraform plans.

The plugin requires a Terraform plan to evaluate. This can be accomplished by exporting a Terraform plan from another step.

Consider using the [Buildkite Terraform Plugin](https://github.com/echoboomer/terraform-buildkite-plugin) along with the [Buildkite Artifacts Plugin](https://github.com/buildkite-plugins/artifacts-buildkite-plugin) to accomplish this. The former exports a `json` version of the Terraform plan automatically. A full example using these options is provided below.
Consider using the [Buildkite Terraform Plugin](https://github.com/echoboomer/terraform-buildkite-plugin) along with the [Buildkite Artifacts Plugin](https://github.com/buildkite-plugins/artifacts-buildkite-plugin) to accomplish this. The former exports a `json` version of the Terraform plan automatically.

The Terraform plan must be `json` formatted.

Expand Down Expand Up @@ -73,6 +73,32 @@ steps:
tests_dir: unit-tests
```
You can combine this plugin with the [Buildkite Terraform Plugin](https://github.com/echoboomer/terraform-buildkite-plugin) to run an OPA test inline in the same step as your Terraform plan:
```yml
steps:
- label: ":terraform: Running Terraform"
concurrency: 1
concurrency_group: tf-repo
plugins:
- echoboomer/terraform#v1.2.18:
apply_master: true
init_args:
- "-input=false"
- "-backend-config=bucket=my_gcp_bucket"
- "-backend-config=prefix=my-prefix"
- "-backend-config=credentials=sa.json"
image: mycustomtfimage
skip_apply_no_diff: true
version: mytag
- echoboomer/terraform-opa#v1.0.0:
fail_step: true
terraform_plan: tfplan.json
tests_dir: "tests"
```
With the provided configuration in this example, Terraform will run a plan and then immediately use the `tfplan.json` file that is available in the `terraform/` directory to run an OPA evaluation.

## Configuration

### `debug` (Not Required, boolean)
Expand Down

0 comments on commit a98e57b

Please sign in to comment.