|
1 | 1 | locals { |
2 | | - tailscale_tags = [for k, v in module.this.tags : "tag:${v}" if k == "Name"] |
3 | | - userdata = templatefile("${path.module}/userdata.sh.tpl", { |
4 | | - routes = join(",", var.advertise_routes) |
5 | | - authkey = tailscale_tailnet_key.default.key |
6 | | - hostname = module.this.id |
| 2 | + |
| 3 | + primary_tag = coalesce(var.primary_tag, module.this.id) |
| 4 | + prefixed_primary_tag = "tag:${local.primary_tag}" |
| 5 | + prefixed_additional_tags = [for tag in var.additional_tags : "tag:${tag}"] |
| 6 | + tailscale_tags = concat([local.prefixed_primary_tag], local.prefixed_additional_tags) |
| 7 | + |
| 8 | + userdata = templatefile("${path.module}/userdata.sh.tmpl", { |
| 9 | + routes = join(",", var.advertise_routes) |
| 10 | + authkey = tailscale_tailnet_key.default.key |
| 11 | + hostname = module.this.id |
| 12 | + tags = join(",", local.tailscale_tags) |
| 13 | + ssh_enabled = var.ssh_enabled |
7 | 14 | }) |
8 | 15 | } |
9 | 16 |
|
10 | 17 | module "tailscale_subnet_router" { |
11 | 18 | source = "masterpointio/ssm-agent/aws" |
12 | | - version = "0.17.0" |
| 19 | + version = "1.0.0" |
13 | 20 |
|
14 | 21 | context = module.this.context |
15 | 22 | tags = module.this.tags |
16 | 23 |
|
17 | | - vpc_id = var.vpc_id |
18 | | - subnet_ids = var.subnet_ids |
19 | | - key_pair_name = var.key_pair_name |
| 24 | + vpc_id = var.vpc_id |
| 25 | + subnet_ids = var.subnet_ids |
| 26 | + key_pair_name = var.key_pair_name |
| 27 | + create_run_shell_document = var.create_run_shell_document |
| 28 | + |
20 | 29 | additional_security_group_ids = var.additional_security_group_ids |
21 | | - create_run_shell_document = var.create_run_shell_document |
22 | 30 |
|
23 | 31 | session_logging_kms_key_alias = var.session_logging_kms_key_alias |
24 | 32 | session_logging_enabled = var.session_logging_enabled |
25 | 33 | session_logging_ssm_document_name = var.session_logging_ssm_document_name |
26 | 34 |
|
27 | | - ami = var.ami |
28 | | - instance_type = var.instance_type |
29 | | - instance_count = var.instance_count |
| 35 | + ami = var.ami |
| 36 | + instance_type = var.instance_type |
30 | 37 |
|
31 | 38 | monitoring_enabled = var.monitoring_enabled |
32 | 39 | associate_public_ip_address = var.associate_public_ip_address |
|
0 commit comments