Skip to content

ckoliber/terraform-hcloud-network

Repository files navigation

Terraform HCloud Network

pipeline release license

Network is a Terraform module useful for creating Network, Subnets, Routes, and Firewalls on HCloud

Installation

Add the required configurations to your terraform config file and install module using command bellow:

terraform init

Usage

module "network" {
  source = "ckoliber/network/hcloud"

  name = "mynet"
  cidr = "192.168.0.0/16"
  subnets = {
    masters = {
      type = "server",
      cidr = "192.168.0.0/24"
    }
    workers = {
      type = "server",
      cidr = "192.168.1.0/24"
    }
  }

  firewalls = {
    manager = {
      targets = ["cluster/role=manager"]
      inbounds = {
        "80:tcp" = {
          description = "HTTP Inbound Traffic"
          source_ips  = ["0.0.0.0/0", "::/0"]
        }
        "443:tcp" = {
          description = "HTTPS Inbound Traffic"
          source_ips  = ["0.0.0.0/0", "::/0"]
        }
        "443:tcp" = {
          description = "HTTPS Inbound Traffic"
          source_ips  = ["0.0.0.0/0", "::/0"]
        }
      }
    }
    worker = {
      targets = ["cluster/role=worker"]
      inbounds = {
        "80:tcp" = {
          description = "HTTP Inbound Traffic"
          source_ips  = ["0.0.0.0/0", "::/0"]
        }
        "443:tcp" = {
          description = "HTTPS Inbound Traffic"
          source_ips  = ["0.0.0.0/0", "::/0"]
        }
      }
    }
  }
}

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

This project is licensed under the MIT.
Copyright (c) KoLiBer ([email protected])

About

Terraform HCloud Network Module

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages