# Using Private Modules

All users in an organization with **Manage Modules** permission can view the Terrakube private registry and use the available providers and modules.

### Using private modules

Click **Registry** in the main menu. And then click the module you want to use.

<figure><img src="/files/twxzaPsw0G6dCpcsyERO" alt=""><figcaption></figcaption></figure>

In the module page, select the version in the dropdown list

<figure><img src="/files/0qRKKEnU2h84uzSAjU4K" alt=""><figcaption></figcaption></figure>

You can copy the code reference from the module page

<figure><img src="/files/HCDfdMKftTHigHHg0ZAR" alt=""><figcaption></figcaption></figure>

For example:

```
module "google-network" { 
  source = "8075-azbuilder-terrakube-gmnub6flawx.ws-us89b.gitpod.io/terrakube/google-network/google" 
  version = "v6.0.1" 
  # insert required variables here 
}
```

### **Submodules**

If your repository has submodules, Terrakube will scan the **modules** folder to identify all the submodules. Then, you will see a dropdown list with the submodules in the UI.

<figure><img src="/files/u6ck69mDqDvMW9kJa2CL" alt=""><figcaption></figcaption></figure>

To view the readme file, inputs, outputs, resources and other information for any submodule, you can choose the submodule you want.

<figure><img src="/files/m0gZBo1IMo1OOsgtcs3y" alt=""><figcaption></figcaption></figure>

You can also copy the details of how to configure any submodule, just like the main module. Example:

```
module "iam" { 
  source = "8075-azbuilder-terrakube-7qovhyoq3u9.ws-eu105.gitpod.io/aws/iam/aws//modules/iam-account" 
  version = "v5.30.0" 
  # insert required variables here 
}
```

In the submodule view you can switch to the differents submodules.

<figure><img src="/files/l5FsFkVy8SPWr67yClIx" alt=""><figcaption></figcaption></figure>

Or you can back to the main module with the **Back** button on the top of the page.

<figure><img src="/files/ti1dpYko81fME3d8srNj" alt=""><figcaption></figcaption></figure>

### **Configure Authentication**

When running Terraform on the CLI, you must configure credentials in [.terraformrc or terraform.rc ](https://developer.hashicorp.com/terraform/cli/config/config-file)to access the private modules.

For example:

```
credentials "8075-azbuilder-terrakube-gmnub6flawx.ws-us89b.gitpod.io" { 
  # valid user API token:
  token = "xxxxxx.yyyyyy.zzzzzzzzzzzzz"
}
```

To get the API token you can check [API Tokens](/2.18.0/user-guide/organizations/api-tokens.md).

As an alternative you can run the [terraform login](https://developer.hashicorp.com/terraform/cli/commands/login) command to obtain and save an user API token.

```
terraform login [terrakube hostname]
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.terrakube.io/2.18.0/user-guide/private-registry/using-private-modules.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
