{% extends 'template.html' %} {% block content %}

Getting started

Progress: 0%

1. Setup required authentication environment variables

The following environment variables must be setup to be able to login:
  • ADMIN_AUTHENTICATION_TOKEN - Token to use for authorisation to be able to modify modules in the user interface.
  • SECRET_KEY - Key used for encrypting sessions. Can be generated using: python -c 'import secrets; print(secrets.token_hex())'

Setup these environment variables and restart the Terrareg server.

2. Login

Go to the login page and login using the admin token

The admin authentication token is setup as the ADMIN_AUTHENTICATION_TOKEN environment variable.

3. Create a module

Go to the create module page and fill out the details for the module.

4a. Index a module version from Git

Go to the module's integration tab, provide a version to index, select 'Publish' and click 'Index Version'.

Notice: A version has been successfully indexed, but has not been published.
Either re-index the module version, ensuring the 'Publish' checkbox has been set.
Otherwise, follow instructions for publishing a module version in the 'Upload a version' step.

4b. Upload a version of the module

  1. Create a zip/tar.gz archive with the contents of the terraform module
  2. Upload the module by performing a POST request to the upload endpoint:
    The archive file should be supplied as a file attachment.
  3. Publish version of the module by performing a POST request to the 'publish' endpoint:
For example:
# Zip module
cd path/to/module
zip * ../module.zip

version=1.0.0

# Upload module version
curl -X POST \
    "" \
    -F file=@../module.zip

# Publish module version
curl -X POST \
    ""

5. Secure your Terrareg instance

To avoid unauthenticated access to some of the features, ensure to set the following environment variables:
  • UPLOAD_API_KEYS or ALLOW_MODULE_HOSTING - Either setup API keys for liming access to the module version upload endpoint or disable uploading modules entirely, enforcing the use of indexing from a Git repository
  • PUBLISH_API_KEYS - Setup API keys for limiting access to the module version publishing endpoint

6. Enable SSL

To be able to use modules from the registry in Terraform, the instance must be configured with an SSL certificate.

Either:
  • Provide the location of an SSL certificate to Terrareg, using SSL_CERT_PRIVATE_KEY and SSL_CERT_PUBLIC_KEY environment variables;
  • Place Terrareg behind a load balancer/reverse proxy that can provide the service over HTTPS.

Complete

Congratulations!

Your Terrareg instance is all setup 🎉
{% endblock %}