FAQ | This is a LIVE service | Changelog

Extend terraform-pipeline-base with a concept of "local files"

In https://gitlab.developers.cam.ac.uk/uis/devops/user-notify/infrastructure/-/merge_requests/2, we had to add a little hack to the terraform CI pipeline jobs to persist a "local files" directory between plan and apply stages.

It would be convenient for this to be folded into the standard pipeline:

  1. Add ${TF_DATA_DIR}/local-files to the artifacts published by plan jobs.
  2. Add a TF_VAR_local_files_dir variable to apply and plan jobs.

Configurations which need to persist files can do so by making use of a local_files_dir variable as in https://gitlab.developers.cam.ac.uk/uis/devops/user-notify/infrastructure/-/merge_requests/2 but configs which don't care don't need to do anything; terraform will ignore $TF_VAR_local_files_dir if there is no corresponding variable.