Common Examples
Using Your Own Kubernetes Config
If you need more control over how terraform
is executed, you can define a Runtime Extensions yourself instead. Inside your runtime config, mark the extension type as TERRAFORM
:
runtime:
name: my-terraform-runner
extension:
type: TERRAFORM
... # the rest of extension config goes here
Make sure that:
- Your
fetch
command is defined and ends withterraform plan -detailed-exitcode
.-detailed-exitcode
causesterraform
to exit 0 when there are no changes, 1 on errors, and 2 if there are changes - exactly what the Runtime Extension interface expects. - Your
apply
command ends withterraform apply
. terraform init
is run before bothfetch
andapply
.- Pass a
-lock-timeout
(we use60s
) to bothterraform plan
andterraform apply
, as we runplan
continuously in a loop and so cause the two commands to conflict.
As this is now your own Runtime Extension, you can define whatever parameters you would like to expose to your services.
Updated 3 months ago