You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(mqtt): add mapache user + drop user_data from ignore_changes
Two coupled changes:
1. New mqtt_user_mapache (default "mapache") with a 32-char
random_password, written as a third line in /etc/nanomq_pwd.conf via
user-data. Intended for the mapache services fleet beyond gr26 —
query, foreman, any future MQTT publishers. Keeps the credential
distinct from gr26 so it can rotate independently of CAN ingest.
2. Drop user_data from lifecycle.ignore_changes (keep ami). The old
guard meant adding users, ACL tweaks, or any user-data edit required
an explicit `terraform taint` / `-replace` to actually deploy — easy
to forget, and we've already hit the trap twice. nanomq carries no
persistent state, so a ~90s replacement on legitimate config changes
is acceptable; paho clients auto-reconnect. Postgres + ClickHouse
modules keep user_data ignored because they own data volumes.
Side effect: the apply that lands this PR will replace the running
gr-mqtt instance (new user-data → instance recreate). EIP, SG, and all
three random_password values survive in state.
Copy file name to clipboardExpand all lines: infra/environments/prod/outputs.tf
+6Lines changed: 6 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -65,6 +65,12 @@ output "mqtt_password_tcm26" {
65
65
sensitive=true
66
66
}
67
67
68
+
output"mqtt_password_mapache" {
69
+
description="Generated MQTT password for the mapache services fleet user. Read with `terraform output -raw mqtt_password_mapache` → mapache-secrets/MQTT_MAPACHE_PASSWORD or wherever the consumer reads it."
70
+
value=module.mqtt.mqtt_password_mapache
71
+
sensitive=true
72
+
}
73
+
68
74
output"clickhouse_private_ip" {
69
75
description="Private IP of the ClickHouse EC2. In-cluster pods connect to this on 8123 (HTTP) / 9000 (native)."
Copy file name to clipboardExpand all lines: infra/modules/mqtt-ec2/outputs.tf
+11Lines changed: 11 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -44,3 +44,14 @@ output "mqtt_password_tcm26" {
44
44
value=random_password.mqtt_tcm26.result
45
45
sensitive=true
46
46
}
47
+
48
+
output"mqtt_user_mapache" {
49
+
description="MQTT username for mapache services beyond gr26. Pair with mqtt_password_mapache."
50
+
value=var.mqtt_user_mapache
51
+
}
52
+
53
+
output"mqtt_password_mapache" {
54
+
description="Generated MQTT password for mapache services. Read via `terraform output -raw mqtt_password_mapache` and put into the relevant k8s Secret key."
Copy file name to clipboardExpand all lines: infra/modules/mqtt-ec2/variables.tf
+6Lines changed: 6 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -42,6 +42,12 @@ variable "mqtt_user_tcm26" {
42
42
default="tcm26"
43
43
}
44
44
45
+
variable"mqtt_user_mapache" {
46
+
description="MQTT username for mapache services beyond gr26 (query, foreman, future publishers). Paired with the module-generated mqtt_password_mapache. Distinct from mqtt_user so the service-fleet credential can rotate independently of the CAN-ingest pipeline."
47
+
type=string
48
+
default="mapache"
49
+
}
50
+
45
51
variable"allowed_security_group_ids" {
46
52
description="Security group IDs allowed to connect on port 1883. Typically the EKS node SG."
0 commit comments