2023-10-22 03:40:16 +00:00
|
|
|
resource "aws_secretsmanager_secret" "mqtt" {
|
|
|
|
name = "MQTT"
|
|
|
|
}
|
|
|
|
|
|
|
|
resource "aws_secretsmanager_secret_version" "mqtt" {
|
|
|
|
secret_id = aws_secretsmanager_secret.mqtt.id
|
|
|
|
secret_string = jsonencode(
|
|
|
|
{
|
2023-10-22 04:49:32 +00:00
|
|
|
HOST = join(",", local.websocket_host_addresses)
|
|
|
|
HOST_MOS_FORMAT = join(" ", [for x in local.websocket_host_addresses : "${x}:1883"])
|
|
|
|
PASSWORD = random_password.mqtt.result
|
|
|
|
USERNAME = "write"
|
2023-10-22 03:40:16 +00:00
|
|
|
}
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
resource "random_password" "mqtt" {
|
|
|
|
length = 18
|
|
|
|
special = false
|
|
|
|
lifecycle {
|
|
|
|
ignore_changes = [special]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
resource "aws_secretsmanager_secret" "radiosondy" {
|
|
|
|
name = "RADIOSONDY"
|
|
|
|
}
|
|
|
|
|
|
|
|
resource "aws_secretsmanager_secret_version" "radiosondy" {
|
|
|
|
secret_id = aws_secretsmanager_secret.radiosondy.id
|
|
|
|
secret_string = jsonencode(
|
|
|
|
{
|
|
|
|
API_KEY = ""
|
|
|
|
}
|
|
|
|
)
|
|
|
|
lifecycle {
|
|
|
|
ignore_changes = [secret_string]
|
|
|
|
}
|
|
|
|
}
|