-
Notifications
You must be signed in to change notification settings - Fork 4
/
secrets.tf
39 lines (35 loc) · 890 Bytes
/
secrets.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
resource "aws_secretsmanager_secret" "mqtt" {
name = "MQTT"
}
resource "aws_secretsmanager_secret_version" "mqtt" {
secret_id = aws_secretsmanager_secret.mqtt.id
secret_string = jsonencode(
{
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"
}
)
}
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]
}
}