Find out how to configure Terraform to make use of Native Suppliers from Nexus

In case your group has blocked and has as an alternative downloaded the supplier binaries to Nexus, then you are able to do the next to nonetheless make your Terraform execute accurately.

Step 1 – Obtain the Required Suppliers

In our instance, we’d like the next suppliers:

  1. AWS
  2. Archive

These instructions under are working straight from the pipeline that executes the Terraform:

# Obtain the suppliers from the Nexus repository
- curl -u ${Nexus_REPO_USER}:${Nexus_REPO_PASS} -o
- curl -u ${Nexus_REPO_USER}:${Nexus_REPO_PASS} -o
# Make a neighborhood listing to retailer these suppliers
- mkdir -p $HOME/.terraform.d/plugins/
- mkdir -p $HOME/.terraform.d/plugins/
# Transfer the downloaded zip information to those directories
- mv $HOME/.terraform.d/plugins/
- mv $HOME/.terraform.d/plugins/
# Give the permissions (not all the time required)
- chmod 777 -R $HOME/.terraform.d/plugins/

Step 2 – Run the Terraform code with a Plugin Listing

The next code continues the pipeline from above the place we left off:

# Add the "-plugin-dir" to make use of the identical location as above
- terraform init -plugin-dir=$HOME/.terraform.d/plugins/ -backend-config=env/dev/backend.conf -reconfigure-force-copy

Step 3 – Replace the terraform block to the identical variations as above

Now we have to modify or add the next code into our Terraform code:

terraform {

  required_providers {
    aws = {
      supply = "hashicorp/aws"
      model = "4.65.0"
    archive = {
      supply = "hashicorp/archive"
      model = "2.3.0"

  # Add different options you want right here... e.g.
  # backend "s3" {
  #  ...


Leave a Reply

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