Skip to content

Instantly share code, notes, and snippets.

@rssnyder
Created July 2, 2025 20:47
Show Gist options
  • Select an option

  • Save rssnyder/bf37c78330422ce27291c508073015b3 to your computer and use it in GitHub Desktop.

Select an option

Save rssnyder/bf37c78330422ce27291c508073015b3 to your computer and use it in GitHub Desktop.
generate tf outputs in iacm stage
- step:
type: Run
name: tf output json container
identifier: tf_output_json_container
spec:
# use the Harness plugin used by TF steps to avoid pulling another container
connectorRef: account.harnessImage
image: plugins/harness_terraform:latest
shell: Sh
command: |-
# use the binary created by the plugin in earlier steps, change `apply` to the ID of the apply step
<+execution.steps.apply.steps.apply.output.outputVariables.binary> -chdir=/harness/<+workspace.folderPath> output -json > tf_outputs.json
cat tf_outputs.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment