Answers: <p>Modules hosted in the private registry can be used outside of Spacelift but you need to correctly verify your credentials or it may show that the module has no versions.</p>
  <p>The easiest way is to have Terraform retrieve and store the credentials by running the following command in a terminal:</p>
  <p><code>terraform login [spacelift.io](&lt;http://spacelift.io/&gt;)</code></p>
  <p>After you confirm that you want to proceed, Terraform will open your default web browser and ask you to log in to your Spacelift account. Once this is done, Terraform will store the credentials in the <code>~/.terraform.d/credentials.tfrc.json</code> file for use by subsequent commands. <a href="https://docs.spacelift.io/vendors/terraform/module-registry.html#using-modules-outside-of-spacelift" rel="nofollow noreferrer">Reference</a>.</p>
  
Answers: CC BY-SA 4.0
Answers: 2024-01-28T20:41:18.410Z
Answers: 2024-01-28T20:41:18.410Z
Answers: Spacelift
Body: <p>I currently have modules that are hosted on Spacelift, I am trying to import a module locally but I may be overlooking as I am getting:</p>
  <pre><code>Error: Module has no versions
  │ Module &quot;spacelift.io/Danielle/secrets-manager/aws
  </code></pre>
  <p>However, there are versions.</p>
  <p>I tried deleting and reimporting these modules but no luck.</p>
  
Tags: <terraform><terraform-module><spacelift>
Title: How can I use modules that are hosted on Spacelift outside of Spaceilft?
UserDisplayName: Danielle Murphy
ThreadText: # How can I use modules that are hosted on Spacelift outside of Spaceilft?
  
  (Asked by: username_0 on 2024-01-05)
  
  I currently have modules that are hosted on username_1, I am trying to import a module locally but I may be overlooking as I am getting:
  
  ```
  Error: Module has no versions
  │ Module "username_1.io/username_0/secrets-manager/aws
  
  ```
  
  However, there are versions.
  
  I tried deleting and reimporting these modules but no luck.
  
  **Tags:** terraform, terraform-module, spacelift
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2024-01-28. Score: 2 | Accepted answer
  
  Modules hosted in the private registry can be used outside of username_1 but you need to correctly verify your credentials or it may show that the module has no versions.
  
  The easiest way is to have Terraform retrieve and store the credentials by running the following command in a terminal:
  
  `terraform login [username_1.io](<http://username_1.io/>)`
  
  After you confirm that you want to proceed, Terraform will open your default web browser and ask you to log in to your username_1 account. Once this is done, Terraform will store the credentials in the `~/.terraform.d/credentials.tfrc.json` file for use by subsequent commands. [Reference](https://docs.username_1.io/vendors/terraform/module-registry.html#using-modules-outside-of-username_1).
  
  
  ---
  
  