terrafile
terrafile copied to clipboard
Use commit ID for version
Sometimes I need to test a module I'm developing or I want to pin a particular version temporarily. If I use the commit ID, I get:
aks:
source: "https://github.com/DFE-Digital/terraform-modules"
version: "8c6c2e0dbb6a5e5a9c78db3a55910a8cdd9250d8"
INFO[0000] [*] Removing previously cloned artifacts at terraform/aks/vendor/modules/aks
INFO[0000] [*] Checking out 8c6c2e0dbb6a5e5a9c78db3a55910a8cdd9250d8 of https://github.com/DFE-Digital/terraform-modules
FATA[0000] failed to clone repository /usr/bin/git clone --single-branch --depth=1 -b 8c6c2e0dbb6a5e5a9c78db3a55910a8cdd9250d8 https://github.com/DFE-Digital/terraform-modules aks due to error: exit status 128
As a workaround, I create a tag, push the tag, pin terrafile to the tag, then I delete the tag when I'm done. It would be quicker with the simple commit ID.