I'm having a hard time to understand the advantage(s) of Gitlab Infrastructure Registry to publish terraform modules as opposite to just referencing the git repo. Difference in usage
Referencing the repo:
.gitlab-ci.yml:
before_script:
- git config --global url."https://oauth2:${GITLAB_ACCESS_TOKEN}@gitlab.com/".insteadOf "https://gitlab.com"
terraform:
module "module_test" {
source = "git::https://gitlab.com/terraform-modules/local_file?ref=v0.1.0"
}
Using the infrastructure registry
.gitlab-ci.yml
variables:
TF_CLI_CONFIG_FILE: $CI_PROJECT_DIR/.terraformrc
before_script:
- echo -e "credentials \"$CI_SERVER_HOST\" {\n token = \"$CI_JOB_TOKEN\"\n}" > $TF_CLI_CONFIG_FILE
terraform:
module "my_module_name" {
source = "gitlab.com/terraform-modules/local_file/local"
version = "0.1.0"
}
so why bother to create modules in the infrastructure registry ? what am I missing ?