This is an example repository for a OPA bundle provider.
For one-shot testing individual bundles:
- Build the required bundles:
> opa build -b <bundle_dir> -o <bundle_name>.tar.gz
- Evaluate your script:
> opa eval -b <bundle_name>.tar.gz <rego_pkg>.rego "data.<rego_pkg>"
For running the bundle server:
- Start the server:
> opa build -b <bundle_dir> -o /bundles/<bundle_name>.tar.gz
- Start the server:
> cd server && yarn start
- Copy the
samples/config/opa-config-template.yamland edit as necessary - Run OPA:
> opa run -c <opa_config>.yaml <rego_pkg>.rego
graph BT
subgraph bundleService["Bundle Service"]
subgraph scripts
conftest@{shape: subproc}
tfplan@{shape: subproc}
azapi@{shape: subproc}
end
node@{shape: rect, label: "node"}
bundleDir@{shape: docs, label: "/bundles"}
updateDir@{shape: processes, label: "updateScripts"}
end
opa@{shape: rounded, label: "OPA Tool"}
opa-->|"http"|node
node-->|"getBundle()"|bundleDir
node-->|"updateBundle()"|updateDir
updateDir--->|"/tf/code"|conftest
updateDir--->|"/tf/plan"|tfplan
updateDir--->|"/azure"|azapi
bundleDir-.->|"*.bundle.tar.gz"|scripts