microscopic-river-74022
01/24/2024, 10:06 AMmicroscopic-river-74022
01/24/2024, 10:06 AMterraform
Deploy action and a exec
Run action in your Garden project. Here's an example:
First, define a terraform
Deploy action in your garden.yml
file:
yaml
kind: Deploy
type: terraform
name: tf
autoApply: true
This will deploy your Terraform stack. You can then reference the stack outputs of this terraform
action using runtime output template strings.
Next, define an exec
Run action that takes a Terraform output and writes it to a local file:
yaml
kind: Run
type: exec
name: write-output
dependencies: [deploy.tf]
script: echo ${runtime.services.tf.outputs.my-output} > output.txt
In this example, my-output
is the name of the output from your Terraform stack. This script will write the output to a file named output.txt
.
Please note that the exec
actions are executed locally on the same machine as the Garden CLI, and not in a Kubernetes cluster. Also, the terraform
Deploy action will not automatically apply the Terraform stack unless you explicitly set the autoApply
flag to true
.
For more details, you can refer to the Garden documentation () and the Terraform plugin documentation ().
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------quaint-dress-831
01/24/2024, 10:21 AM${runtime.services.tf.outputs.my-output}
for ${actions.deploy.tf.outputs.my-output}
in the abovemany-pizza-75746
01/25/2024, 12:34 AM