Add group 4 VyOS imports

This commit is contained in:
2026-11-14 19:30:46 +09:00
parent 4433535637
commit 9ac440fc5a
8 changed files with 346 additions and 0 deletions
+21
View File
@@ -199,3 +199,24 @@ import {
to = module.network_public.aws_default_security_group.this
id = "sg-d3e15bb6"
}
import {
to = module.network_vyos.aws_security_group.protected[0]
id = "sg-827947e5"
}
import {
for_each = local.vyos_ingress_rule_ids
to = module.network_vyos.aws_vpc_security_group_ingress_rule.this[each.key]
id = each.value
}
import {
to = module.network_vyos.aws_vpc_security_group_egress_rule.all_ipv4
id = "sgr-024024d4f607e7dfd"
}
import {
to = module.network_vyos.aws_instance.protected[0]
id = "i-0ca9aa005fc681496"
}
+89
View File
@@ -48,6 +48,14 @@ locals {
prometheus = "sgr-074e62f626b5ffd11"
}
vyos_ingress_rule_ids = {
vpc_all = "sgr-0928f20c49ffde656"
mosh = "sgr-0fbe8c57e8f184cdf"
home_all = "sgr-034cc92dca18b3394"
ssh = "sgr-0e86e1d0cd516c8bd"
wireguard = "sgr-03f382fd75347b435"
}
vpc_flow_log_ids = {
s3 = "fl-078c5e5e029ddbf59"
cloudwatch = "fl-04b92a3f869a9f322"
@@ -314,3 +322,84 @@ module "network_public" {
}
}
}
module "network_vyos" {
source = "../../modules/network_vyos"
region = var.region
name_prefix = var.name_prefix
protect_from_destroy = true
vpc_id = "vpc-68ee3b0d"
subnet_id = "subnet-0254975b"
key_name = "amazon"
security_group = {
name = "VyOS-Router"
description = "VyOS-Router FW"
}
ingress_rules = {
vpc_all = {
ip_protocol = "-1"
cidr_ipv4 = "10.0.0.0/16"
}
mosh = {
description = "Allow mosh"
ip_protocol = "udp"
from_port = 60000
to_port = 61000
cidr_ipv4 = "0.0.0.0/0"
}
home_all = {
description = "Home"
ip_protocol = "-1"
cidr_ipv4 = "192.168.0.0/16"
}
ssh = {
description = "Allow SSH"
ip_protocol = "tcp"
from_port = 22
to_port = 22
cidr_ipv4 = "0.0.0.0/0"
}
wireguard = {
description = "Allow Wireguard"
ip_protocol = "udp"
from_port = 51820
to_port = 51820
cidr_ipv4 = "0.0.0.0/0"
}
}
instance = {
name = "VyOS"
ami = "ami-09c81926f92d4475d"
instance_type = "t2.nano"
private_ip = "10.0.1.119"
associate_public_ip_address = true
source_dest_check = false
ebs_optimized = false
monitoring = false
metadata_options = {
http_endpoint = "enabled"
http_tokens = "optional"
http_put_response_hop_limit = 1
http_protocol_ipv6 = "disabled"
instance_metadata_tags = "disabled"
}
root_block_device = {
delete_on_termination = true
encrypted = false
volume_size = 4
volume_type = "gp2"
iops = 100
}
tags = {
Env = "homelab"
}
}
}