Skip to content

Hoverhuang-er/terraform-registry-proxy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Logo

netlify status

Terraform registry proxy with prometheus

How to setup terraform registry proxy

  • Create config.ini file in the current directory with the following content:
[registry]
proxy_host = "your-registry.terraform-registry.example.com"
[release]
proxy_host = "your-release.terraform-registry.example.com"
path_prefix = ""
terraform_version = "1.1.7"
[server]
address = ":5000"
is_private = false # if true, only the proxy_host will be allowed to access the registry and release by certificate
cert_file = "" # optional
key_file = ""  # optional
use_tls = false # optional
  • Build container images with podman
podman build -t registry-proxy:dev .
  • Install container with podman/docker
podman run --name terraform-registry-proxy -itd -p 5000:5000 registry-proxy:dev

After you have your infrastructure setup you need to update your Terraform configuration so it knows to pull dependencies through the proxy.

Modify provider.tf switch to proxy mode

terraform {
  required_providers {
    azurerm = {
      source  = "hashicorp/aws"
      version = "=< 4.16.0"
    }
  }
}

# Configure the Microsoft Azure Provider
provider "aws" {
  region = "cn-north-1"
  profile = "default"
}

You would update it to this

terraform {
  required_providers {
    azurerm = {
      source  = "your-registry.terraform-registry.example.com/hashicorp/aws"
      version = "=< 4.16.0"
    }
  }
}

# Configure the Microsoft Azure Provider
provider "aws" {
  region = "cn-north-1"
  profile = "default"
}

Supported Cloud Platform

AWS Lambda Container

amplifybutton

Salesforce Heroku

Deploy

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published