# 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="https://4014930676-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MfAN3V983Y82_trlbcu%2Fuploads%2Fgit-blob-4fc7d08e401ce791a1cc8644662fd1f3718398b7%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

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

<figure><img src="https://4014930676-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MfAN3V983Y82_trlbcu%2Fuploads%2Fgit-blob-d0dddcd9317d8383032ed599317c2495dea006d5%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

You can copy the code reference from the module page

<figure><img src="https://4014930676-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MfAN3V983Y82_trlbcu%2Fuploads%2Fgit-blob-17de5fdf969725c9b848c5644ceec4f5449a435c%2Fimage.png?alt=media" 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="https://4014930676-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MfAN3V983Y82_trlbcu%2Fuploads%2Fgit-blob-bc5e26d1106b174a321665d33546f6a435f1fefd%2Fimage.png?alt=media" 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="https://4014930676-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MfAN3V983Y82_trlbcu%2Fuploads%2Fgit-blob-5bfedf506d4aacf051426cc02bb8a6ca32d2d22e%2Fimage.png?alt=media" 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="https://4014930676-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MfAN3V983Y82_trlbcu%2Fuploads%2Fgit-blob-098427d2923f3832ec8530b82c07a033d86db2a0%2Fimage.png?alt=media" 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="https://4014930676-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MfAN3V983Y82_trlbcu%2Fuploads%2Fgit-blob-5e2b35783f6aabcd9d7fba2cd4c7c0f0e9d03774%2Fimage.png?alt=media" 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](https://docs.terrakube.io/user-guide/organizations/api-tokens "mention").

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]
```
