Terraform module usage instructions are incorrect

Summary

When viewing an infrastructure registry package details page, the usage instructions for Terraform modules are incorrect. They specify a source that does not work, and the host for the credentials does not match for self-hosted instances.

Steps to reproduce

  1. Create a project
  2. Publish a Terraform module to the infrastructure registry
  3. Go to Packages & Registries -> Infrastructure Registry
  4. Click on a package to view it's details
  5. Follow the usage instructions

Example Project

What is the current bug behavior?

The source specified does not work, and the host for credentials is hard-coded to gitlab.com even for self-managed instances.

What is the expected correct behavior?

The source should be in the format <host>/<root_namespace>/<package_name/system> and the host in the credentials should match the host for the GitLab instance.

Relevant logs and/or screenshots

Screen_Shot_2021-06-22_at_2.19.51_PM

Output of checks

Results of GitLab environment info

Expand for output related to GitLab environment info

(For installations with omnibus-gitlab package run and paste the output of:
`sudo gitlab-rake gitlab:env:info`)

(For installations from source run and paste the output of:
`sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production`)

Results of GitLab application Check

Expand for output related to the GitLab application check

(For installations with omnibus-gitlab package run and paste the output of: sudo gitlab-rake gitlab:check SANITIZE=true)

(For installations from source run and paste the output of: sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true)

(we will only investigate if the tests are passing)

Possible fixes