NetBox and Terraform Setup

This post follows on from the NetBox setup post, upto the API token setup.

SSL Configuration with Nginx

In that previous post, SSL was not used. The connection was made insecure and ignored. Here, I will detail the steps to use Nginx as a proxy for the NetBox docker container.

Add SAN to SSL Creation

I have used a self-signed SSL for this, and I found that SANs needed to be added to the SSL certificate creation.

Create SSL Certificate

Add Certificate to CA Certificate Store

As I will be using the same Linux host to host NetBox and run the Terraform, I will add the self-signed certificate to the CA store. If Terraform was to be run from another host, I would need to copy the certificate to that CA store.

Create Nginx Server Block (vHost)

Copy the SSL cert and key into the nginx/ssl directory

Create the server block

Setup Terraform

The Terraform provider I will be using is by e-breuninger, and can be found here. Below, I have provided an example of how to get it setup and started. This example simply adds a tag called “DMZ”, coloured pink

Leave a Comment

Your email address will not be published. Required fields are marked *