Remove dups
This commit is contained in:
@@ -1,29 +0,0 @@
|
||||
data "cloudflare_zone" "zone" {
|
||||
zone_id = "<< cloudflare_zone_id >>"
|
||||
}
|
||||
|
||||
resource "cloudflare_dns_record" "<< resource_name >>" {
|
||||
zone_id = data.cloudflare_zone.zone.zone_id
|
||||
name = "<< name >>"
|
||||
type = "<< record_type >>"
|
||||
<%- if record_type == "A" %>
|
||||
content = "<< ipv4_address >>"
|
||||
proxied = << proxied | lower >>
|
||||
<%- endif %>
|
||||
<%- if record_type == "AAAA" %>
|
||||
content = "<< ipv6_address >>"
|
||||
proxied = << proxied | lower >>
|
||||
<%- endif %>
|
||||
<%- if record_type == "CNAME" %>
|
||||
content = "<< target_hostname >>"
|
||||
proxied = << proxied | lower >>
|
||||
<%- endif %>
|
||||
<%- if record_type == "TXT" %>
|
||||
content = "<< text_value >>"
|
||||
<%- endif %>
|
||||
<%- if record_type == "MX" %>
|
||||
content = "<< mail_server >>"
|
||||
priority = << priority >>
|
||||
<%- endif %>
|
||||
ttl = << ttl >>
|
||||
}
|
||||
@@ -1,175 +0,0 @@
|
||||
{
|
||||
"slug": "cloudflare-dns-record",
|
||||
"kind": "terraform",
|
||||
"metadata": {
|
||||
"name": "Cloudflare DNS Record",
|
||||
"description": "Creates a single Cloudflare DNS record for A, AAAA, CNAME, TXT, or MX with type-specific inputs, TTL, and proxying where supported.",
|
||||
"icon": {
|
||||
"provider": "selfhst",
|
||||
"id": "cloudflare",
|
||||
"color": "default"
|
||||
},
|
||||
"draft": false,
|
||||
"version": {
|
||||
"name": "1.0.0",
|
||||
"source_dep_name": "manual/cloudflare-dns-record"
|
||||
}
|
||||
},
|
||||
"variables": [
|
||||
{
|
||||
"name": "terraform",
|
||||
"title": "Terraform",
|
||||
"items": [
|
||||
{
|
||||
"name": "resource_name",
|
||||
"title": "Resource Name",
|
||||
"type": "str",
|
||||
"default": "dns_record",
|
||||
"config": {
|
||||
"placeholder": "dns_record"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "record",
|
||||
"title": "DNS Record",
|
||||
"items": [
|
||||
{
|
||||
"name": "cloudflare_zone_id",
|
||||
"title": "Cloudflare Zone ID",
|
||||
"type": "str",
|
||||
"config": {
|
||||
"placeholder": "123456789"
|
||||
},
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"name": "name",
|
||||
"title": "Record Name",
|
||||
"description": "DNS record name (use @ for the root domain).",
|
||||
"type": "str",
|
||||
"default": "app",
|
||||
"config": {
|
||||
"placeholder": "app"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "record_type",
|
||||
"title": "DNS record type",
|
||||
"type": "enum",
|
||||
"default": "A",
|
||||
"config": {
|
||||
"options": [
|
||||
"A",
|
||||
"AAAA",
|
||||
"CNAME",
|
||||
"TXT",
|
||||
"MX"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "ttl",
|
||||
"title": "TTL",
|
||||
"description": "Time to live (1 = automatic, or 60-86400 seconds)",
|
||||
"type": "int",
|
||||
"default": 1,
|
||||
"config": {
|
||||
"placeholder": "1",
|
||||
"unit": "seconds"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "ipv4_address",
|
||||
"title": "IPv4 Address",
|
||||
"description": "IPv4 address for an A record.",
|
||||
"type": "str",
|
||||
"required": true,
|
||||
"needs": [
|
||||
"record_type=A"
|
||||
],
|
||||
"config": {
|
||||
"placeholder": "192.0.2.1"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "ipv6_address",
|
||||
"title": "IPv6 Address",
|
||||
"description": "IPv6 address for an AAAA record.",
|
||||
"type": "str",
|
||||
"required": true,
|
||||
"needs": [
|
||||
"record_type=AAAA"
|
||||
],
|
||||
"config": {
|
||||
"placeholder": "2001:db8::1"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "target_hostname",
|
||||
"title": "Target Hostname",
|
||||
"description": "Canonical hostname target for a CNAME record.",
|
||||
"type": "str",
|
||||
"required": true,
|
||||
"needs": [
|
||||
"record_type=CNAME"
|
||||
],
|
||||
"config": {
|
||||
"placeholder": "origin.example.com"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "text_value",
|
||||
"title": "TXT Value",
|
||||
"description": "Text value for a TXT record.",
|
||||
"type": "str",
|
||||
"required": true,
|
||||
"needs": [
|
||||
"record_type=TXT"
|
||||
],
|
||||
"config": {
|
||||
"placeholder": "v=spf1 include:_spf.example.com ~all",
|
||||
"textarea": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "mail_server",
|
||||
"title": "Mail Server",
|
||||
"description": "Mail server hostname for an MX record.",
|
||||
"type": "str",
|
||||
"required": true,
|
||||
"needs": [
|
||||
"record_type=MX"
|
||||
],
|
||||
"config": {
|
||||
"placeholder": "mail.example.com"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "priority",
|
||||
"title": "Priority",
|
||||
"description": "MX record priority (lower value = higher priority).",
|
||||
"type": "int",
|
||||
"default": 10,
|
||||
"required": true,
|
||||
"needs": [
|
||||
"record_type=MX"
|
||||
],
|
||||
"config": {
|
||||
"placeholder": "10"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "proxied",
|
||||
"title": "Proxy",
|
||||
"type": "bool",
|
||||
"default": true,
|
||||
"needs": [
|
||||
"record_type=A,AAAA,CNAME"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
resource "cloudflare_zero_trust_tunnel_cloudflared_config" "<< resource_name >>" {
|
||||
account_id = "<< account_id_value >>"
|
||||
tunnel_id = "<< tunnel_id >>"
|
||||
|
||||
config = {
|
||||
ingress = [
|
||||
{
|
||||
hostname = "<< ingress_hostname >>"
|
||||
service = "<< ingress_service >>"
|
||||
},
|
||||
{
|
||||
service = "<< fallback_service >>"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,89 +0,0 @@
|
||||
{
|
||||
"slug": "cloudflare-zero-trust-tunnel-config",
|
||||
"kind": "terraform",
|
||||
"metadata": {
|
||||
"name": "Cloudflare Zero Trust Tunnel Config",
|
||||
"description": "Creates a Cloudflare Zero Trust tunnel ingress configuration for a cloudflared tunnel with a primary hostname and fallback service.",
|
||||
"tags": [],
|
||||
"icon": {
|
||||
"provider": "selfhst",
|
||||
"id": "cloudflare-zero-trust"
|
||||
},
|
||||
"draft": false,
|
||||
"version": {
|
||||
"name": "5.12.0",
|
||||
"source_dep_name": "manual/cloudflare-zero-trust-tunnel-config"
|
||||
}
|
||||
},
|
||||
"variables": [
|
||||
{
|
||||
"title": "General",
|
||||
"name": "general",
|
||||
"items": [
|
||||
{
|
||||
"name": "resource_name",
|
||||
"type": "str",
|
||||
"title": "Resource Name",
|
||||
"required": false,
|
||||
"default": "tunnel_config",
|
||||
"config": {
|
||||
"placeholder": "tunnel_config"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "account_id_value",
|
||||
"type": "str",
|
||||
"title": "Cloudflare account ID",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"name": "tunnel_id",
|
||||
"type": "str",
|
||||
"title": "Cloudflare tunnel ID",
|
||||
"required": true,
|
||||
"description": "Cloudflare tunnel identifier.",
|
||||
"config": {
|
||||
"placeholder": "Tunnel ID"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "Ingress",
|
||||
"name": "ingress",
|
||||
"items": [
|
||||
{
|
||||
"name": "ingress_hostname",
|
||||
"type": "str",
|
||||
"title": "Hostname",
|
||||
"required": true,
|
||||
"description": "Public hostname routed through the tunnel",
|
||||
"config": {
|
||||
"placeholder": "app.home.arpa"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "ingress_service",
|
||||
"type": "str",
|
||||
"title": "Service URL",
|
||||
"required": true,
|
||||
"description": "Backend service URL for the hostname",
|
||||
"config": {
|
||||
"placeholder": "https://app.internal"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "fallback_service",
|
||||
"type": "str",
|
||||
"title": "Fallback Service",
|
||||
"required": false,
|
||||
"default": "http_status:404",
|
||||
"description": "Fallback service for unmatched requests",
|
||||
"config": {
|
||||
"placeholder": "http_status:404"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
data "cloudflare_zone" "<< resource_name >>" {
|
||||
zone_id = "<< cloudflare_zone_id >>"
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
{
|
||||
"slug": "cloudflare-zone-data",
|
||||
"kind": "terraform",
|
||||
"metadata": {
|
||||
"name": "Cloudflare Zone (datasource)",
|
||||
"description": "",
|
||||
"icon": {
|
||||
"provider": "selfhst",
|
||||
"id": "cloudflare",
|
||||
"color": "default"
|
||||
},
|
||||
"draft": false,
|
||||
"version": {
|
||||
"name": "1.0.0",
|
||||
"source_dep_name": "manual/cloudflare-zone-data"
|
||||
}
|
||||
},
|
||||
"variables": [
|
||||
{
|
||||
"name": "terraform",
|
||||
"title": "Terraform",
|
||||
"items": [
|
||||
{
|
||||
"name": "resource_name",
|
||||
"title": "Resource Name",
|
||||
"type": "str",
|
||||
"required": true,
|
||||
"config": {
|
||||
"placeholder": "my_cloudflare_zone"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "cloudflare_zone_id",
|
||||
"title": "Cloudflare Zone ID",
|
||||
"type": "str",
|
||||
"config": {
|
||||
"placeholder": "123456789"
|
||||
},
|
||||
"required": true
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
-23
@@ -1,23 +0,0 @@
|
||||
resource "cloudflare_zero_trust_access_application" "<< resource_name >>" {
|
||||
zone_id = data.cloudflare_zone.main.zone_id
|
||||
name = "<< app_name >>"
|
||||
domain = "<< domain >>"
|
||||
type = "self_hosted"
|
||||
session_duration = "<< session_duration >>"
|
||||
policies = [
|
||||
<%- if service_token_enabled %>
|
||||
{
|
||||
id = cloudflare_zero_trust_access_policy.<< resource_name >>_service_token.id
|
||||
}
|
||||
<%- if ip_policy_enabled %>
|
||||
,
|
||||
<%- endif %>
|
||||
<%- endif %>
|
||||
<%- if ip_policy_enabled %>
|
||||
{
|
||||
id = cloudflare_zero_trust_access_policy.<< resource_name >>_ip.id
|
||||
}
|
||||
<%- endif %>
|
||||
]
|
||||
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
<%- if service_token_enabled %>
|
||||
resource "cloudflare_zero_trust_access_policy" "<< resource_name >>_service_token" {
|
||||
account_id = data.cloudflare_account.main.account_id
|
||||
name = "<< service_token_policy_name >>"
|
||||
decision = "non_identity"
|
||||
include = [{
|
||||
service_token = {
|
||||
token_id = "<< service_token_id >>"
|
||||
}
|
||||
}]
|
||||
session_duration = "<< session_duration >>"
|
||||
}
|
||||
<%- endif %>
|
||||
<%- if ip_policy_enabled %>
|
||||
resource "cloudflare_zero_trust_access_policy" "<< resource_name >>_ip" {
|
||||
account_id = data.cloudflare_account.main.account_id
|
||||
name = "<< ip_policy_name >>"
|
||||
decision = "non_identity"
|
||||
include = [
|
||||
for ip_range in split(",", "<< ip_ranges >>") : {
|
||||
ip = {
|
||||
ip = trimspace(ip_range)
|
||||
}
|
||||
}
|
||||
]
|
||||
session_duration = "<< session_duration >>"
|
||||
}
|
||||
<%- endif %>
|
||||
@@ -1,7 +0,0 @@
|
||||
data "cloudflare_account" "main" {
|
||||
account_id = "<< account_id_value >>"
|
||||
}
|
||||
|
||||
data "cloudflare_zone" "main" {
|
||||
zone_id = "<< zone_id_value >>"
|
||||
}
|
||||
@@ -1,157 +0,0 @@
|
||||
{
|
||||
"slug": "cloudflare-ztna-application",
|
||||
"kind": "terraform",
|
||||
"metadata": {
|
||||
"name": "Cloudflare Zero Trust Access Application",
|
||||
"description": "Creates a Cloudflare Zero Trust Access application with service token and IP-based access policies.",
|
||||
"tags": [],
|
||||
"icon": {
|
||||
"provider": "selfhst",
|
||||
"id": "cloudflare-zero-trust"
|
||||
},
|
||||
"draft": false,
|
||||
"version": {
|
||||
"name": "5.12.0",
|
||||
"source_dep_name": "manual/cloudflare-ztna-application"
|
||||
}
|
||||
},
|
||||
"variables": [
|
||||
{
|
||||
"title": "Application",
|
||||
"name": "application",
|
||||
"items": [
|
||||
{
|
||||
"name": "app_name",
|
||||
"type": "str",
|
||||
"title": "Application name",
|
||||
"required": false,
|
||||
"default": "application",
|
||||
"config": {
|
||||
"placeholder": "application"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "domain",
|
||||
"type": "str",
|
||||
"title": "Application domain",
|
||||
"required": true,
|
||||
"config": {
|
||||
"placeholder": "app.home.arpa"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "session_duration",
|
||||
"type": "str",
|
||||
"title": "Session Duration",
|
||||
"required": false,
|
||||
"default": "15m",
|
||||
"description": "Session duration (e.g., 15m, 1h, 24h)",
|
||||
"config": {
|
||||
"placeholder": "15m"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "General",
|
||||
"name": "general",
|
||||
"items": [
|
||||
{
|
||||
"name": "account_id_value",
|
||||
"type": "str",
|
||||
"title": "Cloudflare Account ID",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"name": "resource_name",
|
||||
"type": "str",
|
||||
"title": "Resource Name",
|
||||
"required": false,
|
||||
"default": "ztna_app",
|
||||
"config": {
|
||||
"placeholder": "ztna_app"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "zone_id_value",
|
||||
"type": "str",
|
||||
"title": "Cloudflare Zone ID",
|
||||
"required": true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "IP-Based Policy",
|
||||
"name": "ip-policy",
|
||||
"items": [
|
||||
{
|
||||
"name": "ip_policy_enabled",
|
||||
"type": "bool",
|
||||
"title": "IP Policy",
|
||||
"required": false,
|
||||
"default": false
|
||||
},
|
||||
{
|
||||
"name": "ip_policy_name",
|
||||
"type": "str",
|
||||
"title": "IP Policy Name",
|
||||
"required": false,
|
||||
"default": "ip_policy",
|
||||
"description": "Policy name for IP-based access",
|
||||
"config": {
|
||||
"placeholder": "ip_policy"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "ip_ranges",
|
||||
"type": "str",
|
||||
"title": "IP Ranges",
|
||||
"required": false,
|
||||
"default": "IP_RANGE",
|
||||
"description": "Comma-separated list of IP ranges (CIDR notation)",
|
||||
"needs": [
|
||||
"ip_policy_enabled=true"
|
||||
],
|
||||
"config": {
|
||||
"placeholder": "IP_RANGE"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "Service Token Policy",
|
||||
"name": "service-token-policy",
|
||||
"items": [
|
||||
{
|
||||
"name": "service_token_enabled",
|
||||
"type": "bool",
|
||||
"title": "Service Token",
|
||||
"required": false,
|
||||
"default": false
|
||||
},
|
||||
{
|
||||
"name": "service_token_id",
|
||||
"type": "str",
|
||||
"title": "Service Token ID",
|
||||
"required": false,
|
||||
"needs": [
|
||||
"service_token_enabled=true"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "service_token_policy_name",
|
||||
"type": "str",
|
||||
"title": "Service Token Name",
|
||||
"required": false,
|
||||
"default": "service_token_policy",
|
||||
"needs": [
|
||||
"service_token_enabled=true"
|
||||
],
|
||||
"config": {
|
||||
"placeholder": "service_token_policy"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
resource "dns_a_record_set" "dns_record" {
|
||||
zone = "<< dns_zone >>"
|
||||
name = "<< dns_hostname >>"
|
||||
addresses = [
|
||||
"<< ip_address >>"
|
||||
]
|
||||
ttl = "<< dns_ttl | default('3600') >>"
|
||||
}
|
||||
@@ -1,69 +0,0 @@
|
||||
{
|
||||
"slug": "dns-a-record-tsig",
|
||||
"kind": "terraform",
|
||||
"metadata": {
|
||||
"name": "DNS Record A (TSIG)",
|
||||
"description": "Creates a DNS A record using TSIG-authenticated dynamic DNS updates. Maps a hostname to an IP address on a TSIG-enabled DNS server.",
|
||||
"icon": {
|
||||
"provider": "selfhst",
|
||||
"id": "bind-9",
|
||||
"color": "default"
|
||||
},
|
||||
"draft": false,
|
||||
"version": {
|
||||
"name": "3.5.0",
|
||||
"source_dep_name": "hashicorp/dns",
|
||||
"source_dep_version": "3.5.0"
|
||||
}
|
||||
},
|
||||
"variables": [
|
||||
{
|
||||
"name": "record",
|
||||
"title": "DNS Record Configuration",
|
||||
"items": [
|
||||
{
|
||||
"name": "dns_hostname",
|
||||
"title": "Hostname",
|
||||
"type": "str",
|
||||
"config": {
|
||||
"placeholder": "hostname"
|
||||
},
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"name": "dns_zone",
|
||||
"title": "Zone",
|
||||
"type": "str",
|
||||
"config": {
|
||||
"placeholder": "home.arpa."
|
||||
},
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"name": "ip_address",
|
||||
"title": "IP Address",
|
||||
"type": "str",
|
||||
"config": {
|
||||
"placeholder": "192.168.0.1/24"
|
||||
},
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"name": "dns_ttl",
|
||||
"title": "TTL",
|
||||
"description": "Time to live (TTL) for the DNS record in seconds (default: 3600)",
|
||||
"type": "int",
|
||||
"default": 3600,
|
||||
"config": {
|
||||
"unit": "seconds",
|
||||
"slider": true,
|
||||
"min": 60,
|
||||
"max": 86400,
|
||||
"step": 60,
|
||||
"placeholder": "3600"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,53 +0,0 @@
|
||||
<%- if peer_names %>
|
||||
locals {
|
||||
netbird_group_peer_names = [
|
||||
for name in split(",", "<< peer_names >>") : trimspace(name)
|
||||
if trimspace(name) != ""
|
||||
]
|
||||
}
|
||||
|
||||
data "netbird_peer" "group_peers" {
|
||||
for_each = toset(local.netbird_group_peer_names)
|
||||
name = each.value
|
||||
}
|
||||
|
||||
<%- endif %>
|
||||
<%- if resource_lookups %>
|
||||
locals {
|
||||
netbird_group_resource_items = [
|
||||
for item in split(";", "<< resource_lookups >>") : trimspace(item)
|
||||
if trimspace(item) != ""
|
||||
]
|
||||
netbird_group_resource_lookup_map = {
|
||||
for item in local.netbird_group_resource_items :
|
||||
item => {
|
||||
network = trimspace(split("|", item)[0])
|
||||
name = trimspace(split("|", item)[1])
|
||||
}
|
||||
}
|
||||
netbird_group_resource_network_names = distinct([
|
||||
for lookup in values(local.netbird_group_resource_lookup_map) : lookup.network
|
||||
])
|
||||
}
|
||||
|
||||
data "netbird_network" "group_resource_networks" {
|
||||
for_each = toset(local.netbird_group_resource_network_names)
|
||||
name = each.value
|
||||
}
|
||||
|
||||
data "netbird_network_resource" "group_resources" {
|
||||
for_each = local.netbird_group_resource_lookup_map
|
||||
network_id = data.netbird_network.group_resource_networks[each.value.network].id
|
||||
name = each.value.name
|
||||
}
|
||||
|
||||
<%- endif %>
|
||||
resource "netbird_group" "group" {
|
||||
name = "<< group_name >>"
|
||||
<%- if peer_names %>
|
||||
peers = [for name in local.netbird_group_peer_names : data.netbird_peer.group_peers[name].id]
|
||||
<%- endif %>
|
||||
<%- if resource_lookups %>
|
||||
resources = [for item in local.netbird_group_resource_items : data.netbird_network_resource.group_resources[item].id]
|
||||
<%- endif %>
|
||||
}
|
||||
@@ -1,66 +0,0 @@
|
||||
{
|
||||
"slug": "netbird-group",
|
||||
"kind": "terraform",
|
||||
"metadata": {
|
||||
"name": "NetBird Group",
|
||||
"description": "Creates a NetBird group and can optionally attach peers and network resources.",
|
||||
"tags": [
|
||||
"netbird",
|
||||
"terraform"
|
||||
],
|
||||
"icon": {
|
||||
"provider": "selfhst",
|
||||
"id": "netbird"
|
||||
},
|
||||
"draft": false,
|
||||
"version": {
|
||||
"name": "0.0.12",
|
||||
"source_dep_name": "manual/netbird-group"
|
||||
}
|
||||
},
|
||||
"variables": [
|
||||
{
|
||||
"title": "General",
|
||||
"name": "general",
|
||||
"items": [
|
||||
{
|
||||
"name": "group_name",
|
||||
"type": "str",
|
||||
"title": "Group Name",
|
||||
"required": true,
|
||||
"config": {
|
||||
"placeholder": "Engineering"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "Membership",
|
||||
"name": "membership",
|
||||
"items": [
|
||||
{
|
||||
"name": "peer_names",
|
||||
"type": "str",
|
||||
"title": "Peer Names",
|
||||
"required": false,
|
||||
"description": "Comma-separated existing NetBird peer names to attach to the group.",
|
||||
"config": {
|
||||
"placeholder": "web-app,db-app",
|
||||
"textarea": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "resource_lookups",
|
||||
"type": "str",
|
||||
"title": "Resource Lookups",
|
||||
"required": false,
|
||||
"description": "Semicolon-separated `network_name|resource_name` entries for existing NetBird network resources to attach to the group.",
|
||||
"config": {
|
||||
"placeholder": "production-network|internal-app;production-network|corp-lan",
|
||||
"textarea": true
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
data "netbird_network" "parent_network" {
|
||||
name = "<< network_name >>"
|
||||
}
|
||||
|
||||
<%- for group_name in group_names.split(',') %>
|
||||
<%- if group_name|trim %>
|
||||
data "netbird_group" "group_<< group_name|trim|replace(' ', '_')|replace('-', '_') >>" {
|
||||
name = "<< group_name|trim >>"
|
||||
}
|
||||
|
||||
<%- endif %>
|
||||
<%- endfor %>
|
||||
|
||||
resource "netbird_network_resource" "network_resource" {
|
||||
network_id = data.netbird_network.parent_network.id
|
||||
name = "<< resource_name >>"
|
||||
<%- if resource_description %>
|
||||
description = "<< resource_description >>"
|
||||
<%- endif %>
|
||||
address = "<< resource_address >>"
|
||||
groups = [
|
||||
<%- for group_name in group_names.split(',') %>
|
||||
<%- if group_name|trim %>
|
||||
data.netbird_group.group_<< group_name|trim|replace(' ', '_')|replace('-', '_') >>.id,
|
||||
<%- endif %>
|
||||
<%- endfor %>
|
||||
]
|
||||
enabled = << resource_enabled | lower >>
|
||||
}
|
||||
@@ -1,88 +0,0 @@
|
||||
{
|
||||
"slug": "netbird-network-resource",
|
||||
"kind": "terraform",
|
||||
"metadata": {
|
||||
"name": "NetBird Network Resource",
|
||||
"description": "Creates a NetBird network resource and attaches it to one or more groups.",
|
||||
"tags": [
|
||||
"netbird",
|
||||
"terraform"
|
||||
],
|
||||
"icon": {
|
||||
"provider": "selfhst",
|
||||
"id": "netbird"
|
||||
},
|
||||
"draft": true,
|
||||
"version": {
|
||||
"name": "0.0.15",
|
||||
"source_dep_name": "manual/netbird-network-resource"
|
||||
}
|
||||
},
|
||||
"variables": [
|
||||
{
|
||||
"title": "General",
|
||||
"name": "general",
|
||||
"items": [
|
||||
{
|
||||
"name": "resource_name",
|
||||
"type": "str",
|
||||
"title": "Name",
|
||||
"required": true,
|
||||
"config": {
|
||||
"placeholder": "My Network Resource"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "network_name",
|
||||
"type": "str",
|
||||
"title": "Network Name",
|
||||
"required": true,
|
||||
"description": "Existing NetBird network name for the parent network resource lookup.",
|
||||
"config": {
|
||||
"placeholder": "production-network"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "resource_address",
|
||||
"type": "str",
|
||||
"title": "Address",
|
||||
"required": true,
|
||||
"description": "Host, subnet, or domain address for the resource.",
|
||||
"config": {
|
||||
"placeholder": "10.20.0.0/24"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "group_names",
|
||||
"type": "str",
|
||||
"title": "Group Names",
|
||||
"required": true,
|
||||
"description": "Comma-separated existing NetBird group names to attach to this resource.",
|
||||
"config": {
|
||||
"placeholder": "Administrators, DevOps",
|
||||
"textarea": true
|
||||
},
|
||||
"default": "Administrators"
|
||||
},
|
||||
{
|
||||
"name": "resource_description",
|
||||
"type": "str",
|
||||
"title": "Description",
|
||||
"required": false,
|
||||
"description": "Optional description for the NetBird network resource.",
|
||||
"config": {
|
||||
"placeholder": "Internal application endpoint",
|
||||
"textarea": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "resource_enabled",
|
||||
"type": "bool",
|
||||
"title": "Enabled",
|
||||
"required": false,
|
||||
"default": true
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
data "netbird_network" "router_network" {
|
||||
name = "<< network_name >>"
|
||||
}
|
||||
|
||||
<%- if router_target_mode == "peer" %>
|
||||
data "netbird_peer" "router_peer" {
|
||||
name = "<< peer_name >>"
|
||||
}
|
||||
|
||||
<%- endif %>
|
||||
<%- if router_target_mode == "peer_groups" %>
|
||||
locals {
|
||||
router_peer_group_names = [
|
||||
for name in split(",", "<< peer_group_names >>") : trimspace(name)
|
||||
if trimspace(name) != ""
|
||||
]
|
||||
}
|
||||
|
||||
data "netbird_group" "router_peer_groups" {
|
||||
for_each = toset(local.router_peer_group_names)
|
||||
name = each.value
|
||||
}
|
||||
|
||||
<%- endif %>
|
||||
resource "netbird_network_router" "network_router" {
|
||||
network_id = data.netbird_network.router_network.id
|
||||
enabled = << router_enabled | lower >>
|
||||
masquerade = << router_masquerade | lower >>
|
||||
metric = << router_metric >>
|
||||
<%- if router_target_mode == "peer" %>
|
||||
peer = data.netbird_peer.router_peer.id
|
||||
<%- endif %>
|
||||
<%- if router_target_mode == "peer_groups" %>
|
||||
peer_groups = [for name in local.router_peer_group_names : data.netbird_group.router_peer_groups[name].id]
|
||||
<%- endif %>
|
||||
}
|
||||
@@ -1,112 +0,0 @@
|
||||
{
|
||||
"slug": "netbird-network-router",
|
||||
"kind": "terraform",
|
||||
"metadata": {
|
||||
"name": "NetBird Network Router",
|
||||
"description": "Creates a NetBird network router and targets either a single peer or a peer group.",
|
||||
"tags": [
|
||||
"netbird",
|
||||
"terraform"
|
||||
],
|
||||
"icon": {
|
||||
"provider": "selfhst",
|
||||
"id": "netbird"
|
||||
},
|
||||
"draft": false,
|
||||
"version": {
|
||||
"name": "0.0.12",
|
||||
"source_dep_name": "manual/netbird-network-router"
|
||||
}
|
||||
},
|
||||
"variables": [
|
||||
{
|
||||
"title": "General",
|
||||
"name": "general",
|
||||
"items": [
|
||||
{
|
||||
"name": "router_enabled",
|
||||
"type": "bool",
|
||||
"title": "Enabled",
|
||||
"required": false,
|
||||
"default": true
|
||||
},
|
||||
{
|
||||
"name": "router_masquerade",
|
||||
"type": "bool",
|
||||
"title": "Masquerade",
|
||||
"required": false,
|
||||
"default": true,
|
||||
"description": "Masquerade routed traffic on the selected router peer."
|
||||
},
|
||||
{
|
||||
"name": "router_metric",
|
||||
"type": "int",
|
||||
"title": "Metric",
|
||||
"required": false,
|
||||
"default": 9999,
|
||||
"description": "Router metric. Lower values have higher priority.",
|
||||
"config": {
|
||||
"placeholder": "9999"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "router_target_mode",
|
||||
"type": "enum",
|
||||
"title": "Target Mode",
|
||||
"required": true,
|
||||
"default": "peer_groups",
|
||||
"description": "Route through a single peer or a peer group.",
|
||||
"config": {
|
||||
"options": [
|
||||
"peer_groups",
|
||||
"peer"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "Lookups",
|
||||
"name": "lookups",
|
||||
"items": [
|
||||
{
|
||||
"name": "network_name",
|
||||
"type": "str",
|
||||
"title": "Network Name",
|
||||
"required": true,
|
||||
"description": "Existing NetBird network name for the parent network lookup.",
|
||||
"config": {
|
||||
"placeholder": "production-network"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "peer_name",
|
||||
"type": "str",
|
||||
"title": "Peer Name",
|
||||
"required": true,
|
||||
"description": "Existing NetBird peer name for the router peer lookup.",
|
||||
"needs": [
|
||||
"router_target_mode=peer"
|
||||
],
|
||||
"config": {
|
||||
"placeholder": "gateway-peer"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "peer_group_names",
|
||||
"type": "str",
|
||||
"title": "Peer Group Names",
|
||||
"required": true,
|
||||
"description": "Comma-separated existing NetBird group names for router groups.",
|
||||
"needs": [
|
||||
"router_target_mode=peer_groups"
|
||||
],
|
||||
"config": {
|
||||
"placeholder": "Routers,Gateways",
|
||||
"textarea": true
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
resource "netbird_network" "network" {
|
||||
name = "<< network_name >>"
|
||||
<%- if network_description %>
|
||||
description = "<< network_description >>"
|
||||
<%- endif %>
|
||||
}
|
||||
@@ -1,49 +0,0 @@
|
||||
{
|
||||
"slug": "netbird-network",
|
||||
"kind": "terraform",
|
||||
"metadata": {
|
||||
"name": "NetBird Network",
|
||||
"description": "Creates a NetBird network for organizing resources and routers.",
|
||||
"tags": [
|
||||
"netbird",
|
||||
"terraform"
|
||||
],
|
||||
"icon": {
|
||||
"provider": "selfhst",
|
||||
"id": "netbird"
|
||||
},
|
||||
"draft": false,
|
||||
"version": {
|
||||
"name": "0.0.10",
|
||||
"source_dep_name": "manual/netbird-network"
|
||||
}
|
||||
},
|
||||
"variables": [
|
||||
{
|
||||
"title": "General",
|
||||
"name": "general",
|
||||
"items": [
|
||||
{
|
||||
"name": "network_name",
|
||||
"type": "str",
|
||||
"title": "Network Name",
|
||||
"required": true,
|
||||
"config": {
|
||||
"placeholder": "Homelab"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "network_description",
|
||||
"type": "str",
|
||||
"title": "Description",
|
||||
"required": false,
|
||||
"description": "Optional description for the NetBird network.",
|
||||
"config": {
|
||||
"placeholder": "Internal services network",
|
||||
"textarea": true
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,84 +0,0 @@
|
||||
locals {
|
||||
policy_source_group_names = [
|
||||
for name in split(",", "<< source_group_names >>") : trimspace(name)
|
||||
if trimspace(name) != ""
|
||||
]
|
||||
policy_destination_group_names = [
|
||||
for name in split(",", "<< destination_group_names >>") : trimspace(name)
|
||||
if trimspace(name) != ""
|
||||
]
|
||||
<%- if source_posture_check_names %>
|
||||
policy_source_posture_check_names = [
|
||||
for name in split(",", "<< source_posture_check_names >>") : trimspace(name)
|
||||
if trimspace(name) != ""
|
||||
]
|
||||
<%- endif %>
|
||||
<%- if authorized_group_entries %>
|
||||
policy_authorized_group_entries = [
|
||||
for entry in split(";", "<< authorized_group_entries >>") : trimspace(entry)
|
||||
if trimspace(entry) != ""
|
||||
]
|
||||
policy_authorized_group_map = {
|
||||
for entry in local.policy_authorized_group_entries :
|
||||
trimspace(split("|", entry)[0]) => [
|
||||
for username in split(",", split("|", entry)[1]) : trimspace(username)
|
||||
if trimspace(username) != ""
|
||||
]
|
||||
}
|
||||
<%- endif %>
|
||||
policy_group_names = distinct(concat(
|
||||
local.policy_source_group_names,
|
||||
local.policy_destination_group_names,
|
||||
<%- if authorized_group_entries %>
|
||||
keys(local.policy_authorized_group_map),
|
||||
<%- endif %>
|
||||
[]
|
||||
))
|
||||
}
|
||||
|
||||
data "netbird_group" "policy_groups" {
|
||||
for_each = toset(local.policy_group_names)
|
||||
name = each.value
|
||||
}
|
||||
|
||||
<%- if source_posture_check_names %>
|
||||
data "netbird_posture_check" "source_posture_checks" {
|
||||
for_each = toset(local.policy_source_posture_check_names)
|
||||
name = each.value
|
||||
}
|
||||
|
||||
<%- endif %>
|
||||
resource "netbird_policy" "policy" {
|
||||
name = "<< policy_name >>"
|
||||
<%- if policy_description %>
|
||||
description = "<< policy_description >>"
|
||||
<%- endif %>
|
||||
enabled = << policy_enabled | lower >>
|
||||
<%- if source_posture_check_names %>
|
||||
source_posture_checks = [for name in local.policy_source_posture_check_names : data.netbird_posture_check.source_posture_checks[name].id]
|
||||
<%- endif %>
|
||||
|
||||
rule {
|
||||
name = "<< rule_name >>"
|
||||
action = "<< rule_action >>"
|
||||
bidirectional = << rule_bidirectional | lower >>
|
||||
enabled = << rule_enabled | lower >>
|
||||
protocol = "<< rule_protocol >>"
|
||||
sources = [for name in local.policy_source_group_names : data.netbird_group.policy_groups[name].id]
|
||||
destinations = [for name in local.policy_destination_group_names : data.netbird_group.policy_groups[name].id]
|
||||
<%- if rule_description %>
|
||||
description = "<< rule_description >>"
|
||||
<%- endif %>
|
||||
<%- if ports %>
|
||||
ports = [<< ports >>]
|
||||
<%- endif %>
|
||||
<%- if rule_protocol == "netbird-ssh" %>
|
||||
<%- if authorized_group_entries %>
|
||||
authorized_groups = {
|
||||
for group_name, users in local.policy_authorized_group_map :
|
||||
data.netbird_group.policy_groups[group_name].id => users
|
||||
}
|
||||
<%- endif %>
|
||||
<%- endif %>
|
||||
}
|
||||
}
|
||||
@@ -1,192 +0,0 @@
|
||||
{
|
||||
"slug": "netbird-policy",
|
||||
"kind": "terraform",
|
||||
"metadata": {
|
||||
"name": "NetBird Policy",
|
||||
"description": "Creates a NetBird access policy with a single rule and optional posture checks.",
|
||||
"tags": [
|
||||
"netbird",
|
||||
"terraform"
|
||||
],
|
||||
"icon": {
|
||||
"provider": "selfhst",
|
||||
"id": "netbird"
|
||||
},
|
||||
"draft": false,
|
||||
"version": {
|
||||
"name": "0.0.12",
|
||||
"source_dep_name": "manual/netbird-policy"
|
||||
}
|
||||
},
|
||||
"variables": [
|
||||
{
|
||||
"title": "General",
|
||||
"name": "general",
|
||||
"items": [
|
||||
{
|
||||
"name": "policy_name",
|
||||
"type": "str",
|
||||
"title": "Policy Name",
|
||||
"required": true,
|
||||
"config": {
|
||||
"placeholder": "Allow Internal HTTPS"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "policy_description",
|
||||
"type": "str",
|
||||
"title": "Description",
|
||||
"required": false,
|
||||
"description": "Optional description for the policy.",
|
||||
"config": {
|
||||
"placeholder": "Allow app traffic from users to services",
|
||||
"textarea": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "policy_enabled",
|
||||
"type": "bool",
|
||||
"title": "Enabled",
|
||||
"required": false,
|
||||
"default": true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "Rule",
|
||||
"name": "rule",
|
||||
"items": [
|
||||
{
|
||||
"name": "rule_name",
|
||||
"type": "str",
|
||||
"title": "Rule Name",
|
||||
"required": true,
|
||||
"config": {
|
||||
"placeholder": "HTTPS"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "rule_description",
|
||||
"type": "str",
|
||||
"title": "Rule Description",
|
||||
"required": false,
|
||||
"description": "Optional description for the rule.",
|
||||
"config": {
|
||||
"placeholder": "Allow HTTPS from users to the app group",
|
||||
"textarea": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "rule_action",
|
||||
"type": "enum",
|
||||
"title": "Action",
|
||||
"required": false,
|
||||
"default": "accept",
|
||||
"description": "Policy action to take.",
|
||||
"config": {
|
||||
"options": [
|
||||
"accept",
|
||||
"drop"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "rule_protocol",
|
||||
"type": "enum",
|
||||
"title": "Protocol",
|
||||
"required": false,
|
||||
"default": "tcp",
|
||||
"description": "Protocol enforced by the policy rule.",
|
||||
"config": {
|
||||
"options": [
|
||||
"tcp",
|
||||
"udp",
|
||||
"icmp",
|
||||
"all",
|
||||
"netbird-ssh"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "rule_bidirectional",
|
||||
"type": "bool",
|
||||
"title": "Bidirectional",
|
||||
"required": false,
|
||||
"default": true,
|
||||
"description": "Allow traffic in both directions between the selected groups."
|
||||
},
|
||||
{
|
||||
"name": "rule_enabled",
|
||||
"type": "bool",
|
||||
"title": "Rule Enabled",
|
||||
"required": false,
|
||||
"default": true
|
||||
},
|
||||
{
|
||||
"name": "source_group_names",
|
||||
"type": "str",
|
||||
"title": "Source Group Names",
|
||||
"required": true,
|
||||
"description": "Comma-separated existing NetBird source group names.",
|
||||
"config": {
|
||||
"placeholder": "Users,Developers",
|
||||
"textarea": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "destination_group_names",
|
||||
"type": "str",
|
||||
"title": "Destination Group Names",
|
||||
"required": true,
|
||||
"description": "Comma-separated existing NetBird destination group names.",
|
||||
"config": {
|
||||
"placeholder": "Services,Internal Apps",
|
||||
"textarea": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "ports",
|
||||
"type": "str",
|
||||
"title": "Ports",
|
||||
"required": false,
|
||||
"description": "Raw HCL list entries for ports, for example `\"443\", \"8443\"`.",
|
||||
"config": {
|
||||
"placeholder": "\"443\"",
|
||||
"textarea": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "authorized_group_entries",
|
||||
"type": "str",
|
||||
"title": "Authorized Group Entries",
|
||||
"required": false,
|
||||
"description": "Semicolon-separated `group_name|user1,user2` entries for NetBird SSH local-user authorization.",
|
||||
"needs": [
|
||||
"rule_protocol=netbird-ssh"
|
||||
],
|
||||
"config": {
|
||||
"placeholder": "Admins|ubuntu;SRE|root,ec2-user",
|
||||
"textarea": true
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "Posture Checks",
|
||||
"name": "posture-checks",
|
||||
"items": [
|
||||
{
|
||||
"name": "source_posture_check_names",
|
||||
"type": "str",
|
||||
"title": "Posture Check Names",
|
||||
"required": false,
|
||||
"description": "Comma-separated existing NetBird posture check names.",
|
||||
"config": {
|
||||
"placeholder": "Managed Devices,Minimum Version",
|
||||
"textarea": true
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,145 +0,0 @@
|
||||
<%- if domain_mode == "free" %>
|
||||
data "netbird_reverse_proxy_domain" "free" {
|
||||
type = "free"
|
||||
}
|
||||
|
||||
<%- endif %>
|
||||
<%- if domain_mode == "custom" %>
|
||||
data "netbird_reverse_proxy_domain" "custom" {
|
||||
domain = "<< custom_domain >>"
|
||||
validated = true
|
||||
}
|
||||
|
||||
<%- endif %>
|
||||
<%- if target_type == "peer" %>
|
||||
data "netbird_peer" "target_peer" {
|
||||
name = "<< target_peer_name >>"
|
||||
}
|
||||
|
||||
<%- endif %>
|
||||
<%- if target_type == "host" %>
|
||||
data "netbird_network" "target_network" {
|
||||
name = "<< target_network_name >>"
|
||||
}
|
||||
|
||||
data "netbird_network_resource" "target_resource" {
|
||||
network_id = data.netbird_network.target_network.id
|
||||
name = "<< target_host_name >>"
|
||||
}
|
||||
|
||||
<%- endif %>
|
||||
<%- if target_type == "domain" %>
|
||||
data "netbird_network" "target_network" {
|
||||
name = "<< target_network_name >>"
|
||||
}
|
||||
|
||||
data "netbird_network_resource" "target_resource" {
|
||||
network_id = data.netbird_network.target_network.id
|
||||
name = "<< target_domain_name >>"
|
||||
}
|
||||
|
||||
<%- endif %>
|
||||
<%- if target_type == "subnet" %>
|
||||
data "netbird_network" "target_network" {
|
||||
name = "<< target_network_name >>"
|
||||
}
|
||||
|
||||
data "netbird_network_resource" "target_resource" {
|
||||
network_id = data.netbird_network.target_network.id
|
||||
name = "<< target_subnet_name >>"
|
||||
}
|
||||
|
||||
<%- endif %>
|
||||
<%- if target_type != "peer" %>
|
||||
locals {
|
||||
reverse_proxy_target_resource_type = can(cidrnetmask(data.netbird_network_resource.target_resource.address)) ? "subnet" : (length(regexall(":", data.netbird_network_resource.target_resource.address)) > 0 ? "host" : (length(regexall("[A-Za-z*]", data.netbird_network_resource.target_resource.address)) > 0 ? "domain" : "host"))
|
||||
}
|
||||
|
||||
<%- endif %>
|
||||
<%- if bearer_distribution_group_names %>
|
||||
locals {
|
||||
reverse_proxy_bearer_group_names = [
|
||||
for name in split(",", "<< bearer_distribution_group_names >>") : trimspace(name)
|
||||
if trimspace(name) != ""
|
||||
]
|
||||
}
|
||||
|
||||
data "netbird_group" "bearer_distribution_groups" {
|
||||
for_each = toset(local.reverse_proxy_bearer_group_names)
|
||||
name = each.value
|
||||
}
|
||||
|
||||
<%- endif %>
|
||||
resource "netbird_reverse_proxy_service" "reverse_proxy_service" {
|
||||
name = "<< service_name >>"
|
||||
<%- if domain_mode == "free" %>
|
||||
domain = data.netbird_reverse_proxy_domain.free.domain
|
||||
<%- endif %>
|
||||
<%- if domain_mode == "custom" %>
|
||||
domain = data.netbird_reverse_proxy_domain.custom.domain
|
||||
<%- endif %>
|
||||
enabled = << service_enabled | lower >>
|
||||
pass_host_header = << pass_host_header | lower >>
|
||||
rewrite_redirects = << rewrite_redirects | lower >>
|
||||
|
||||
targets = [{
|
||||
<%- if target_type == "peer" %>
|
||||
target_id = data.netbird_peer.target_peer.id
|
||||
<%- endif %>
|
||||
<%- if target_type == "host" %>
|
||||
target_id = data.netbird_network_resource.target_resource.id
|
||||
<%- endif %>
|
||||
<%- if target_type == "domain" %>
|
||||
target_id = data.netbird_network_resource.target_resource.id
|
||||
<%- endif %>
|
||||
<%- if target_type == "subnet" %>
|
||||
target_id = data.netbird_network_resource.target_resource.id
|
||||
<%- endif %>
|
||||
<%- if target_type == "peer" %>
|
||||
target_type = "peer"
|
||||
<%- endif %>
|
||||
<%- if target_type != "peer" %>
|
||||
target_type = local.reverse_proxy_target_resource_type
|
||||
<%- endif %>
|
||||
port = << target_port >>
|
||||
protocol = "<< target_protocol >>"
|
||||
enabled = << target_enabled | lower >>
|
||||
<%- if target_host %>
|
||||
host = "<< target_host >>"
|
||||
<%- endif %>
|
||||
<%- if not target_host and target_type != "peer" %>
|
||||
host = local.reverse_proxy_target_resource_type == "subnet" ? split("/", data.netbird_network_resource.target_resource.address)[0] : null
|
||||
<%- endif %>
|
||||
<%- if target_path %>
|
||||
path = "<< target_path >>"
|
||||
<%- endif %>
|
||||
}]
|
||||
|
||||
auth = {
|
||||
<%- if auth_mode == "link" %>
|
||||
link_auth = {
|
||||
enabled = true
|
||||
}
|
||||
<%- endif %>
|
||||
<%- if auth_mode == "password" %>
|
||||
password_auth = {
|
||||
enabled = true
|
||||
password = "<< auth_password >>"
|
||||
}
|
||||
<%- endif %>
|
||||
<%- if auth_mode == "pin" %>
|
||||
pin_auth = {
|
||||
enabled = true
|
||||
pin = "<< auth_pin >>"
|
||||
}
|
||||
<%- endif %>
|
||||
<%- if auth_mode == "bearer" %>
|
||||
bearer_auth = {
|
||||
enabled = true
|
||||
<%- if bearer_distribution_group_names %>
|
||||
distribution_groups = [for name in local.reverse_proxy_bearer_group_names : data.netbird_group.bearer_distribution_groups[name].id]
|
||||
<%- endif %>
|
||||
}
|
||||
<%- endif %>
|
||||
}
|
||||
}
|
||||
@@ -1,283 +0,0 @@
|
||||
{
|
||||
"slug": "netbird-reverse-proxy-service",
|
||||
"kind": "terraform",
|
||||
"metadata": {
|
||||
"name": "NetBird Reverse Proxy Service",
|
||||
"description": "Creates a NetBird reverse proxy service with one backend target and configurable authentication.",
|
||||
"tags": [
|
||||
"netbird",
|
||||
"terraform",
|
||||
"reverse-proxy"
|
||||
],
|
||||
"icon": {
|
||||
"provider": "selfhst",
|
||||
"id": "netbird"
|
||||
},
|
||||
"draft": false,
|
||||
"version": {
|
||||
"name": "0.0.17",
|
||||
"source_dep_name": "manual/netbird-reverse-proxy-service"
|
||||
}
|
||||
},
|
||||
"variables": [
|
||||
{
|
||||
"title": "General",
|
||||
"name": "general",
|
||||
"items": [
|
||||
{
|
||||
"name": "service_name",
|
||||
"type": "str",
|
||||
"title": "Service Name",
|
||||
"required": true,
|
||||
"config": {
|
||||
"placeholder": "web-app"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "domain_mode",
|
||||
"type": "enum",
|
||||
"title": "Domain Mode",
|
||||
"required": true,
|
||||
"default": "free",
|
||||
"config": {
|
||||
"options": [
|
||||
"free",
|
||||
"custom"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "custom_domain",
|
||||
"type": "str",
|
||||
"title": "Custom Domain",
|
||||
"required": true,
|
||||
"description": "Validated custom domain for the reverse proxy service.",
|
||||
"needs": [
|
||||
"domain_mode=custom"
|
||||
],
|
||||
"config": {
|
||||
"placeholder": "app.example.com"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "service_enabled",
|
||||
"type": "bool",
|
||||
"title": "Enabled",
|
||||
"required": false,
|
||||
"default": true
|
||||
},
|
||||
{
|
||||
"name": "pass_host_header",
|
||||
"type": "bool",
|
||||
"title": "Pass Host Header",
|
||||
"required": false,
|
||||
"default": false,
|
||||
"description": "Pass the original client Host header through to the backend."
|
||||
},
|
||||
{
|
||||
"name": "rewrite_redirects",
|
||||
"type": "bool",
|
||||
"title": "Rewrite Redirects",
|
||||
"required": false,
|
||||
"default": false,
|
||||
"description": "Rewrite backend redirect locations to the public-facing service domain."
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "Target",
|
||||
"name": "target",
|
||||
"items": [
|
||||
{
|
||||
"name": "target_type",
|
||||
"type": "enum",
|
||||
"title": "Target Type",
|
||||
"required": true,
|
||||
"default": "peer",
|
||||
"description": "Target type for the backend service.",
|
||||
"config": {
|
||||
"options": [
|
||||
"peer",
|
||||
"host",
|
||||
"domain",
|
||||
"subnet"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "target_peer_name",
|
||||
"type": "str",
|
||||
"title": "Peer Name",
|
||||
"required": true,
|
||||
"description": "Existing NetBird peer name to resolve via `data \"netbird_peer\"` when `target_type=peer`.",
|
||||
"needs": [
|
||||
"target_type=peer"
|
||||
],
|
||||
"config": {
|
||||
"placeholder": "web-app"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "target_network_name",
|
||||
"type": "str",
|
||||
"title": "Network Name",
|
||||
"required": true,
|
||||
"description": "Existing NetBird network name that contains the selected host, domain, or subnet resource.",
|
||||
"needs": [
|
||||
"target_type=host,domain,subnet"
|
||||
],
|
||||
"config": {
|
||||
"placeholder": "production-network"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "target_host_name",
|
||||
"type": "str",
|
||||
"title": "Host Resource Name",
|
||||
"required": true,
|
||||
"description": "Existing NetBird network resource name for a host target.",
|
||||
"needs": [
|
||||
"target_type=host"
|
||||
],
|
||||
"config": {
|
||||
"placeholder": "internal-app-host"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "target_domain_name",
|
||||
"type": "str",
|
||||
"title": "Domain Resource Name",
|
||||
"required": true,
|
||||
"description": "Existing NetBird network resource name for a domain target.",
|
||||
"needs": [
|
||||
"target_type=domain"
|
||||
],
|
||||
"config": {
|
||||
"placeholder": "app.example.internal"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "target_subnet_name",
|
||||
"type": "str",
|
||||
"title": "Subnet Resource Name",
|
||||
"required": true,
|
||||
"description": "Existing NetBird network resource name for a subnet target.",
|
||||
"needs": [
|
||||
"target_type=subnet"
|
||||
],
|
||||
"config": {
|
||||
"placeholder": "corp-lan"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "target_port",
|
||||
"type": "int",
|
||||
"title": "Target Port",
|
||||
"required": true,
|
||||
"default": 8080,
|
||||
"description": "Backend port for the target.",
|
||||
"config": {
|
||||
"placeholder": "8080"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "target_protocol",
|
||||
"type": "enum",
|
||||
"title": "Target Protocol",
|
||||
"required": true,
|
||||
"default": "http",
|
||||
"config": {
|
||||
"options": [
|
||||
"http",
|
||||
"https"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "target_enabled",
|
||||
"type": "bool",
|
||||
"title": "Target Enabled",
|
||||
"required": false,
|
||||
"default": true
|
||||
},
|
||||
{
|
||||
"name": "target_host",
|
||||
"type": "str",
|
||||
"title": "Resolved Host",
|
||||
"required": false,
|
||||
"description": "Optional backend IP or domain override for the target. Subnet targets need a host IP within the CIDR range.",
|
||||
"config": {
|
||||
"placeholder": "10.20.30.40"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "target_path",
|
||||
"type": "str",
|
||||
"title": "Path Prefix",
|
||||
"required": false,
|
||||
"description": "Optional URL path prefix for the backend target.",
|
||||
"config": {
|
||||
"placeholder": "/"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "Authentication",
|
||||
"name": "authentication",
|
||||
"items": [
|
||||
{
|
||||
"name": "auth_mode",
|
||||
"type": "enum",
|
||||
"title": "Authentication Mode",
|
||||
"required": true,
|
||||
"default": "link",
|
||||
"description": "Authentication method exposed by the reverse proxy service.",
|
||||
"config": {
|
||||
"options": [
|
||||
"link",
|
||||
"none",
|
||||
"password",
|
||||
"pin",
|
||||
"bearer"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "auth_password",
|
||||
"type": "secret",
|
||||
"title": "Password",
|
||||
"required": true,
|
||||
"description": "Shared password for password-based access.",
|
||||
"needs": [
|
||||
"auth_mode=password"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "auth_pin",
|
||||
"type": "secret",
|
||||
"title": "PIN",
|
||||
"required": true,
|
||||
"description": "Shared PIN for PIN-based access.",
|
||||
"needs": [
|
||||
"auth_mode=pin"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "bearer_distribution_group_names",
|
||||
"type": "str",
|
||||
"title": "Bearer Distribution Groups",
|
||||
"required": false,
|
||||
"description": "Comma-separated existing NetBird group names allowed for bearer-auth access.",
|
||||
"needs": [
|
||||
"auth_mode=bearer"
|
||||
],
|
||||
"config": {
|
||||
"placeholder": "SRE,Incident Response",
|
||||
"textarea": true
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,63 +0,0 @@
|
||||
data "netbox_cluster" "<< resource_name >>_cluster" {
|
||||
name = "<< cluster_name >>"
|
||||
}
|
||||
|
||||
<%- if site_name %>
|
||||
data "netbox_site" "<< resource_name >>_site" {
|
||||
name = "<< site_name >>"
|
||||
}
|
||||
<%- endif %>
|
||||
|
||||
<%- if device_name %>
|
||||
data "netbox_devices" "<< resource_name >>_device_lookup" {
|
||||
limit = 1
|
||||
|
||||
filter {
|
||||
name = "name"
|
||||
value = "<< device_name >>"
|
||||
}
|
||||
}
|
||||
<%- endif %>
|
||||
|
||||
resource "netbox_virtual_machine" "<< resource_name >>" {
|
||||
name = "<< vm_name >>"
|
||||
cluster_id = data.netbox_cluster.<< resource_name >>_cluster.id
|
||||
<%- if site_name %>
|
||||
site_id = data.netbox_site.<< resource_name >>_site.id
|
||||
<%- endif %>
|
||||
status = "<< status >>"
|
||||
<%- if device_name %>
|
||||
device_id = data.netbox_devices.<< resource_name >>_device_lookup.devices[0].device_id
|
||||
<%- endif %>
|
||||
<%- if resources_enabled %>
|
||||
vcpus = << vcpus >>
|
||||
memory = << memory_mb >>
|
||||
disk = << disk_gb >>
|
||||
<%- endif %>
|
||||
<%- if description_enabled %>
|
||||
comments = "<< description_text >>"
|
||||
<%- endif %>
|
||||
|
||||
}
|
||||
|
||||
<%- if ipam_enabled %>
|
||||
resource "netbox_interface" "<< resource_name >>_interface" {
|
||||
name = "<< interface_name >>"
|
||||
virtual_machine_id = netbox_virtual_machine.<< resource_name >>.id
|
||||
}
|
||||
|
||||
resource "netbox_ip_address" "<< resource_name >>_ip" {
|
||||
ip_address = "<< primary_ip4 >>"
|
||||
status = "active"
|
||||
<%- if dns_name %>
|
||||
dns_name = "<< dns_name >>"
|
||||
<%- endif %>
|
||||
interface_id = netbox_interface.<< resource_name >>_interface.id
|
||||
object_type = "virtualization.vminterface"
|
||||
}
|
||||
|
||||
resource "netbox_primary_ip" "<< resource_name >>_primary_ip" {
|
||||
ip_address_id = netbox_ip_address.<< resource_name >>_ip.id
|
||||
virtual_machine_id = netbox_virtual_machine.<< resource_name >>.id
|
||||
}
|
||||
<%- endif %>
|
||||
@@ -1,222 +0,0 @@
|
||||
{
|
||||
"slug": "netbox-vm",
|
||||
"kind": "terraform",
|
||||
"metadata": {
|
||||
"name": "NetBox Virtual Machine",
|
||||
"description": "Registers a virtual machine in NetBox with cluster, site, and host device associations. Defines VM metadata including resource allocation and optional IPAM integration.",
|
||||
"tags": [],
|
||||
"icon": {
|
||||
"provider": "selfhst",
|
||||
"id": "netbox"
|
||||
},
|
||||
"draft": false,
|
||||
"version": {
|
||||
"name": "5.0.1",
|
||||
"source_dep_name": "manual/netbox-vm"
|
||||
}
|
||||
},
|
||||
"variables": [
|
||||
{
|
||||
"title": "General",
|
||||
"name": "general",
|
||||
"items": [
|
||||
{
|
||||
"name": "resource_name",
|
||||
"type": "str",
|
||||
"title": "Resource Name",
|
||||
"required": false,
|
||||
"default": "vm",
|
||||
"config": {
|
||||
"placeholder": "vm"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "Virtual Machine Configuration",
|
||||
"name": "vm",
|
||||
"items": [
|
||||
{
|
||||
"name": "vm_name",
|
||||
"type": "str",
|
||||
"title": "Virtual machine name",
|
||||
"required": true,
|
||||
"config": {
|
||||
"placeholder": "servername"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "cluster_name",
|
||||
"type": "str",
|
||||
"title": "Cluster name",
|
||||
"required": true,
|
||||
"default": "clustername",
|
||||
"description": "Existing NetBox cluster name to resolve via data source.",
|
||||
"config": {
|
||||
"placeholder": "clustername"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "status",
|
||||
"type": "enum",
|
||||
"title": "VM status",
|
||||
"required": false,
|
||||
"default": "active",
|
||||
"config": {
|
||||
"options": [
|
||||
"active",
|
||||
"planned",
|
||||
"staged",
|
||||
"offline",
|
||||
"decommissioning"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "Site Assignment",
|
||||
"name": "site",
|
||||
"items": [
|
||||
{
|
||||
"name": "site_name",
|
||||
"type": "str",
|
||||
"title": "Site Name",
|
||||
"required": false,
|
||||
"description": "Existing NetBox site name to resolve via data source (leave empty to skip)"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "Host Device",
|
||||
"name": "device",
|
||||
"items": [
|
||||
{
|
||||
"name": "device_name",
|
||||
"type": "str",
|
||||
"title": "Device Name",
|
||||
"required": false,
|
||||
"description": "Existing NetBox device name for host assignment (leave empty to skip)"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "IP Address Management",
|
||||
"name": "ipam",
|
||||
"items": [
|
||||
{
|
||||
"name": "ipam_enabled",
|
||||
"type": "bool",
|
||||
"title": "IPAM",
|
||||
"required": false,
|
||||
"default": false
|
||||
},
|
||||
{
|
||||
"name": "interface_name",
|
||||
"type": "str",
|
||||
"title": "Network interface name",
|
||||
"required": true,
|
||||
"default": "eth0",
|
||||
"config": {
|
||||
"placeholder": "eth0"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "primary_ip4",
|
||||
"type": "str",
|
||||
"title": "Primary IPv4",
|
||||
"required": true,
|
||||
"description": "Primary IPv4 address with CIDR notation"
|
||||
},
|
||||
{
|
||||
"name": "dns_name",
|
||||
"type": "str",
|
||||
"title": "DNS Name",
|
||||
"required": false,
|
||||
"description": "DNS name for the IP address (leave empty to skip)"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "Resource Allocation",
|
||||
"name": "resources",
|
||||
"items": [
|
||||
{
|
||||
"name": "resources_enabled",
|
||||
"type": "bool",
|
||||
"title": "Resources",
|
||||
"required": false,
|
||||
"default": false
|
||||
},
|
||||
{
|
||||
"name": "vcpus",
|
||||
"type": "int",
|
||||
"title": "vCPUs",
|
||||
"required": false,
|
||||
"default": 2,
|
||||
"config": {
|
||||
"slider": true,
|
||||
"min": 1,
|
||||
"max": 24,
|
||||
"step": 1,
|
||||
"placeholder": "2",
|
||||
"unit": "vCPU"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "memory_mb",
|
||||
"type": "int",
|
||||
"title": "Memory",
|
||||
"required": false,
|
||||
"default": 4096,
|
||||
"config": {
|
||||
"slider": true,
|
||||
"min": 512,
|
||||
"max": 24576,
|
||||
"step": 512,
|
||||
"placeholder": "4096",
|
||||
"unit": "MB"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "disk_gb",
|
||||
"type": "int",
|
||||
"title": "Disk Size",
|
||||
"required": false,
|
||||
"default": 50,
|
||||
"config": {
|
||||
"slider": true,
|
||||
"min": 10,
|
||||
"max": 1000,
|
||||
"step": 10,
|
||||
"placeholder": "50",
|
||||
"unit": "GB"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "Description",
|
||||
"name": "description",
|
||||
"items": [
|
||||
{
|
||||
"name": "description_enabled",
|
||||
"type": "bool",
|
||||
"title": "Description",
|
||||
"required": false,
|
||||
"default": false
|
||||
},
|
||||
{
|
||||
"name": "description_text",
|
||||
"type": "str",
|
||||
"title": "VM description",
|
||||
"required": false,
|
||||
"config": {
|
||||
"placeholder": "Add a description here...",
|
||||
"textarea": true
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
resource "proxmox_lxc" "<< resource_name >>" {
|
||||
hostname = "<< hostname >>"
|
||||
<%- if description %>
|
||||
description = "<< description >>"
|
||||
<%- endif %>
|
||||
target_node = "<< target_node >>"
|
||||
unprivileged = << unprivileged | lower >>
|
||||
ostemplate = "<< ostemplate >>"
|
||||
|
||||
cores = << cores >>
|
||||
swap = << swap_mb >>
|
||||
memory = << memory_mb >>
|
||||
|
||||
start = << start_container | lower >>
|
||||
|
||||
rootfs {
|
||||
storage = "<< rootfs_storage >>"
|
||||
size = "<< rootfs_size_gb >>G"
|
||||
}
|
||||
|
||||
nameserver = "<< nameserver >>"
|
||||
<%- if searchdomain %>
|
||||
searchdomain = "<< searchdomain >>"
|
||||
<%- endif %>
|
||||
|
||||
network {
|
||||
name = "<< network_name >>"
|
||||
bridge = "<< bridge >>"
|
||||
ip = "<< ip_address >>"
|
||||
}
|
||||
|
||||
lifecycle {
|
||||
ignore_changes = [
|
||||
rootfs,
|
||||
network,
|
||||
cmode
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,231 +0,0 @@
|
||||
{
|
||||
"slug": "proxmox-lxc",
|
||||
"kind": "terraform",
|
||||
"metadata": {
|
||||
"name": "Proxmox LXC",
|
||||
"description": "Creates a Proxmox Linux container with configurable template, compute, root filesystem, and single-interface network settings.",
|
||||
"tags": [],
|
||||
"icon": {
|
||||
"provider": "selfhst",
|
||||
"id": "proxmox"
|
||||
},
|
||||
"draft": false,
|
||||
"version": {
|
||||
"name": "3.0.2-rc07",
|
||||
"source_dep_name": "telmate/proxmox",
|
||||
"source_dep_version": "3.0.2-rc07"
|
||||
}
|
||||
},
|
||||
"variables": [
|
||||
{
|
||||
"title": "Terraform",
|
||||
"name": "terraform",
|
||||
"items": [
|
||||
{
|
||||
"name": "resource_name",
|
||||
"type": "str",
|
||||
"title": "Resource Name",
|
||||
"required": false,
|
||||
"default": "lxc",
|
||||
"config": {
|
||||
"placeholder": "lxc"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "Container Identity",
|
||||
"name": "identity",
|
||||
"items": [
|
||||
{
|
||||
"name": "hostname",
|
||||
"type": "str",
|
||||
"title": "Container hostname",
|
||||
"required": true,
|
||||
"config": {
|
||||
"placeholder": "Container Name"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "description",
|
||||
"type": "str",
|
||||
"title": "Container description",
|
||||
"required": false,
|
||||
"description": "Add a description here...",
|
||||
"config": {
|
||||
"placeholder": "Application container",
|
||||
"textarea": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "target_node",
|
||||
"type": "str",
|
||||
"title": "Target Node",
|
||||
"required": true,
|
||||
"description": "Proxmox node that will host the container",
|
||||
"config": {
|
||||
"placeholder": "Proxmox node"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "unprivileged",
|
||||
"type": "bool",
|
||||
"title": "Unprivileged",
|
||||
"required": false,
|
||||
"default": false
|
||||
},
|
||||
{
|
||||
"name": "ostemplate",
|
||||
"type": "str",
|
||||
"title": "Template",
|
||||
"required": true,
|
||||
"config": {
|
||||
"placeholder": "template reference"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "Compute",
|
||||
"name": "compute",
|
||||
"items": [
|
||||
{
|
||||
"name": "cores",
|
||||
"type": "int",
|
||||
"title": "CPU Cores",
|
||||
"required": false,
|
||||
"default": 4,
|
||||
"config": {
|
||||
"slider": true,
|
||||
"min": 1,
|
||||
"max": 32,
|
||||
"step": 1,
|
||||
"placeholder": "4"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "memory_mb",
|
||||
"type": "int",
|
||||
"title": "Memory",
|
||||
"required": false,
|
||||
"default": 8192,
|
||||
"config": {
|
||||
"slider": true,
|
||||
"min": 256,
|
||||
"max": 262144,
|
||||
"step": 256,
|
||||
"placeholder": "8192",
|
||||
"unit": "MB"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "swap_mb",
|
||||
"type": "int",
|
||||
"title": "Swap",
|
||||
"required": false,
|
||||
"default": 512,
|
||||
"config": {
|
||||
"slider": true,
|
||||
"min": 0,
|
||||
"max": 65536,
|
||||
"step": 128,
|
||||
"placeholder": "512",
|
||||
"unit": "MB"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "start_container",
|
||||
"type": "bool",
|
||||
"title": "Auto Start",
|
||||
"required": false,
|
||||
"default": true,
|
||||
"description": "Start the container after creation"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "Storage and Network",
|
||||
"name": "storage-network",
|
||||
"items": [
|
||||
{
|
||||
"name": "rootfs_storage",
|
||||
"type": "str",
|
||||
"title": "Rootfs Storage",
|
||||
"required": false,
|
||||
"default": "local-lvm",
|
||||
"description": "Storage pool for the root filesystem",
|
||||
"config": {
|
||||
"placeholder": "local-lvm"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "rootfs_size_gb",
|
||||
"type": "int",
|
||||
"title": "Rootfs Size",
|
||||
"required": false,
|
||||
"default": 256,
|
||||
"description": "Root filesystem size in GB",
|
||||
"config": {
|
||||
"slider": true,
|
||||
"min": 4,
|
||||
"max": 4096,
|
||||
"step": 1,
|
||||
"placeholder": "256",
|
||||
"unit": "GB"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "nameserver",
|
||||
"type": "str",
|
||||
"title": "Container DNS server",
|
||||
"required": true,
|
||||
"description": "DNS server used by the container.",
|
||||
"config": {
|
||||
"placeholder": "DNS_SERVER"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "searchdomain",
|
||||
"type": "str",
|
||||
"title": "Container search domain",
|
||||
"required": false,
|
||||
"default": "",
|
||||
"description": "Search domain used by the container.",
|
||||
"config": {
|
||||
"placeholder": "home.arpa"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "network_name",
|
||||
"type": "str",
|
||||
"title": "Network Name",
|
||||
"required": false,
|
||||
"default": "eth0",
|
||||
"config": {
|
||||
"placeholder": "eth0"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "bridge",
|
||||
"type": "str",
|
||||
"title": "Proxmox bridge name",
|
||||
"required": false,
|
||||
"default": "vmbr1",
|
||||
"description": "Bridge name to use in Proxmox.",
|
||||
"config": {
|
||||
"placeholder": "vmbr1"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "ip_address",
|
||||
"type": "str",
|
||||
"title": "Container IP address",
|
||||
"required": true,
|
||||
"config": {
|
||||
"placeholder": "IP_ADDRESS"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,77 +0,0 @@
|
||||
resource "proxmox_vm_qemu" "<< resource_name >>" {
|
||||
name = "<< vm_name >>"
|
||||
<%- if vm_id %>
|
||||
vmid = "<< vm_id >>"
|
||||
<%- endif %>
|
||||
<%- if description %>
|
||||
description = "<< description >>"
|
||||
<%- endif %>
|
||||
<%- if tags %>
|
||||
tags = "<< tags >>"
|
||||
<%- endif %>
|
||||
agent = 1
|
||||
agent_timeout = 90
|
||||
target_node = "<< target_node >>"
|
||||
|
||||
define_connection_info = false
|
||||
|
||||
full_clone = << full_clone | lower >>
|
||||
clone = "<< clone_template >>"
|
||||
|
||||
onboot = << onboot | lower >>
|
||||
<%- if startup %>
|
||||
startup = "<< startup >>"
|
||||
<%- endif %>
|
||||
automatic_reboot = << automatic_reboot | lower >>
|
||||
|
||||
qemu_os = "<< qemu_os >>"
|
||||
bios = "<< bios >>"
|
||||
|
||||
cpu {
|
||||
cores = << cpu_cores >>
|
||||
sockets = << cpu_sockets >>
|
||||
type = "<< cpu_type >>"
|
||||
}
|
||||
|
||||
memory = << memory_mb >>
|
||||
balloon = << memory_mb >>
|
||||
|
||||
network {
|
||||
id = 0
|
||||
bridge = "<< bridge >>"
|
||||
model = "<< network_model >>"
|
||||
}
|
||||
|
||||
scsihw = "virtio-scsi-pci"
|
||||
|
||||
disks {
|
||||
ide {
|
||||
ide0 {
|
||||
cloudinit {
|
||||
storage = "<< cloudinit_storage >>"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
virtio {
|
||||
virtio0 {
|
||||
disk {
|
||||
storage = "<< disk_storage >>"
|
||||
size = "<< disk_size_gb >>G"
|
||||
iothread = << disk_iothread | lower >>
|
||||
replicate = << disk_replicate | lower >>
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ipconfig0 = "<< ipconfig0 >>"
|
||||
<%- if nameserver %>
|
||||
nameserver = "<< nameserver >>"
|
||||
<%- endif %>
|
||||
ciuser = "<< ci_user >>"
|
||||
<%- if ssh_key %>
|
||||
sshkeys = "<< ssh_key >>"
|
||||
<%- endif %>
|
||||
|
||||
}
|
||||
@@ -1,355 +0,0 @@
|
||||
{
|
||||
"slug": "proxmox-vm-qemu",
|
||||
"kind": "terraform",
|
||||
"metadata": {
|
||||
"name": "Proxmox VM (QEMU)",
|
||||
"description": "Creates a Proxmox virtual machine from a cloud-init-ready template with configurable clone, CPU, memory, disk, networking, and guest settings.",
|
||||
"tags": [],
|
||||
"icon": {
|
||||
"provider": "selfhst",
|
||||
"id": "proxmox"
|
||||
},
|
||||
"draft": false,
|
||||
"version": {
|
||||
"name": "3.0.2-rc07",
|
||||
"source_dep_name": "telmate/proxmox",
|
||||
"source_dep_version": "3.0.2-rc07"
|
||||
}
|
||||
},
|
||||
"variables": [
|
||||
{
|
||||
"title": "Terraform",
|
||||
"name": "terraform",
|
||||
"items": [
|
||||
{
|
||||
"name": "resource_name",
|
||||
"type": "str",
|
||||
"title": "Resource Name",
|
||||
"required": false,
|
||||
"default": "vmqemu",
|
||||
"config": {
|
||||
"placeholder": "vmqemu"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "VM Identity",
|
||||
"name": "identity",
|
||||
"items": [
|
||||
{
|
||||
"name": "vm_name",
|
||||
"type": "str",
|
||||
"title": "Proxmox VM name",
|
||||
"required": true,
|
||||
"config": {
|
||||
"placeholder": "servername"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "vm_id",
|
||||
"type": "str",
|
||||
"title": "Proxmox VMID",
|
||||
"required": false,
|
||||
"config": {
|
||||
"placeholder": "20001"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "description",
|
||||
"type": "str",
|
||||
"title": "VM description",
|
||||
"required": false,
|
||||
"config": {
|
||||
"placeholder": "Application server",
|
||||
"textarea": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "tags",
|
||||
"type": "str",
|
||||
"title": "Tags",
|
||||
"required": false,
|
||||
"config": {
|
||||
"placeholder": "docker"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "target_node",
|
||||
"type": "str",
|
||||
"title": "Target Node",
|
||||
"required": true,
|
||||
"description": "Proxmox node that will host the VM.",
|
||||
"config": {
|
||||
"placeholder": "proxmox-node"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "Clone Configuration",
|
||||
"name": "clone",
|
||||
"items": [
|
||||
{
|
||||
"name": "clone_template",
|
||||
"type": "str",
|
||||
"title": "Template",
|
||||
"required": true,
|
||||
"description": "Source template name to clone",
|
||||
"config": {
|
||||
"placeholder": "pkr-ubuntu-noble-1"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "full_clone",
|
||||
"type": "bool",
|
||||
"title": "Full Clone",
|
||||
"required": false,
|
||||
"default": true,
|
||||
"description": "Create a full clone instead of a linked clone"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "Boot Settings",
|
||||
"name": "guest",
|
||||
"items": [
|
||||
{
|
||||
"name": "onboot",
|
||||
"type": "bool",
|
||||
"title": "Auto Start",
|
||||
"required": false,
|
||||
"default": true,
|
||||
"description": "Start the VM automatically with the node."
|
||||
},
|
||||
{
|
||||
"name": "startup",
|
||||
"type": "str",
|
||||
"title": "Startup",
|
||||
"required": false,
|
||||
"description": "Proxmox startup order and delay string",
|
||||
"config": {
|
||||
"placeholder": "order=1,up=10"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "automatic_reboot",
|
||||
"type": "bool",
|
||||
"title": "Auto Reboot",
|
||||
"required": false,
|
||||
"default": false,
|
||||
"description": "Allow provider-triggered automatic reboot on change"
|
||||
},
|
||||
{
|
||||
"name": "ci_user",
|
||||
"type": "str",
|
||||
"title": "Cloud-init user",
|
||||
"required": false,
|
||||
"default": "admin",
|
||||
"config": {
|
||||
"placeholder": "admin"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "ssh_key",
|
||||
"type": "str",
|
||||
"title": "SSH Key",
|
||||
"required": false,
|
||||
"description": "SSH public key passed to cloud-init",
|
||||
"config": {
|
||||
"placeholder": "SSH public key",
|
||||
"textarea": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "ipconfig0",
|
||||
"type": "str",
|
||||
"title": "Network Config",
|
||||
"required": false,
|
||||
"default": "ip=dhcp",
|
||||
"description": "Cloud-init network config for the first NIC",
|
||||
"config": {
|
||||
"placeholder": "ip=IP_ADDRESS/24,gw=GATEWAY"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "nameserver",
|
||||
"type": "str",
|
||||
"title": "Nameserver",
|
||||
"required": false,
|
||||
"description": "DNS server for guest cloud-init config",
|
||||
"config": {
|
||||
"placeholder": "DNS_SERVER"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "Compute",
|
||||
"name": "compute",
|
||||
"items": [
|
||||
{
|
||||
"name": "cpu_cores",
|
||||
"type": "int",
|
||||
"title": "CPU Cores",
|
||||
"required": false,
|
||||
"default": 2,
|
||||
"config": {
|
||||
"slider": true,
|
||||
"min": 1,
|
||||
"max": 32,
|
||||
"step": 1,
|
||||
"placeholder": "2",
|
||||
"unit": "cores"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "cpu_sockets",
|
||||
"type": "int",
|
||||
"title": "CPU Sockets",
|
||||
"required": false,
|
||||
"default": 1,
|
||||
"config": {
|
||||
"slider": true,
|
||||
"min": 1,
|
||||
"max": 8,
|
||||
"step": 1,
|
||||
"placeholder": "1",
|
||||
"unit": "sockets"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "cpu_type",
|
||||
"type": "str",
|
||||
"title": "Proxmox CPU type",
|
||||
"required": false,
|
||||
"default": "host",
|
||||
"description": "CPU type to use in Proxmox.",
|
||||
"config": {
|
||||
"placeholder": "host"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "memory_mb",
|
||||
"type": "int",
|
||||
"title": "Memory",
|
||||
"required": false,
|
||||
"default": 4096,
|
||||
"config": {
|
||||
"slider": true,
|
||||
"min": 512,
|
||||
"max": 262144,
|
||||
"step": 512,
|
||||
"placeholder": "4096",
|
||||
"unit": "MB"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "bios",
|
||||
"type": "enum",
|
||||
"title": "VM BIOS type",
|
||||
"required": false,
|
||||
"default": "seabios",
|
||||
"description": "BIOS type for the VM.",
|
||||
"config": {
|
||||
"options": [
|
||||
"seabios",
|
||||
"ovmf"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "qemu_os",
|
||||
"type": "str",
|
||||
"title": "QEMU OS type",
|
||||
"required": false,
|
||||
"default": "other",
|
||||
"description": "Guest OS type for QEMU.",
|
||||
"config": {
|
||||
"placeholder": "other"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "Storage and Network",
|
||||
"name": "storage-network",
|
||||
"items": [
|
||||
{
|
||||
"name": "bridge",
|
||||
"type": "str",
|
||||
"title": "Bridge",
|
||||
"required": false,
|
||||
"default": "vmbr1",
|
||||
"description": "Proxmox bridge for the first NIC",
|
||||
"config": {
|
||||
"placeholder": "vmbr1"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "network_model",
|
||||
"type": "str",
|
||||
"title": "NIC model",
|
||||
"required": false,
|
||||
"default": "virtio",
|
||||
"description": "Network adapter model.",
|
||||
"config": {
|
||||
"placeholder": "virtio"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "disk_storage",
|
||||
"type": "str",
|
||||
"title": "Disk Storage",
|
||||
"required": false,
|
||||
"default": "local-lvm",
|
||||
"description": "Storage pool for the main disk",
|
||||
"config": {
|
||||
"placeholder": "local-lvm"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "cloudinit_storage",
|
||||
"type": "str",
|
||||
"title": "Cloud-init Storage",
|
||||
"required": false,
|
||||
"default": "local-lvm",
|
||||
"description": "Storage pool for the cloud-init disk",
|
||||
"config": {
|
||||
"placeholder": "local-lvm"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "disk_size_gb",
|
||||
"type": "int",
|
||||
"title": "Disk Size",
|
||||
"required": false,
|
||||
"default": 32,
|
||||
"description": "Main disk size in GB",
|
||||
"config": {
|
||||
"slider": true,
|
||||
"min": 8,
|
||||
"max": 4096,
|
||||
"step": 1,
|
||||
"placeholder": "32",
|
||||
"unit": "GB"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "disk_iothread",
|
||||
"type": "bool",
|
||||
"title": "IO Thread",
|
||||
"required": false,
|
||||
"default": true
|
||||
},
|
||||
{
|
||||
"name": "disk_replicate",
|
||||
"type": "bool",
|
||||
"title": "Disk Replication",
|
||||
"required": false,
|
||||
"default": true
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user