mirror of
https://github.com/projecthorus/sondehub-infra.git
synced 2025-01-18 10:46:24 +00:00
sns_to_mqtt
This commit is contained in:
parent
63a7a13133
commit
9cf9289f8f
26
ingestion.tf
26
ingestion.tf
@ -115,4 +115,30 @@ resource "aws_sns_topic" "sonde_telem" {
|
||||
}
|
||||
}
|
||||
EOF
|
||||
}
|
||||
|
||||
|
||||
// SNS to MQTT
|
||||
|
||||
resource "aws_lambda_function" "sns_to_mqtt" {
|
||||
function_name = "sns-to-mqtt"
|
||||
handler = "lambda_function.lambda_handler"
|
||||
filename = "${path.module}/sns-to-mqtt/Archive.zip" # this should get replaced out when we make a proper build chain
|
||||
publish = true
|
||||
memory_size = 128
|
||||
role = aws_iam_role.basic_lambda_role.arn
|
||||
runtime = "python3.9"
|
||||
timeout = 3
|
||||
architectures = ["arm64"]
|
||||
lifecycle {
|
||||
ignore_changes = [environment]
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
resource "aws_lambda_permission" "sns_to_mqtt" {
|
||||
action = "lambda:InvokeFunction"
|
||||
function_name = aws_lambda_function.station.arn
|
||||
principal = "apigateway.amazonaws.com"
|
||||
source_arn = aws_sns_topic.sonde_telem.arn
|
||||
}
|
Loading…
Reference in New Issue
Block a user