mirror of
https://github.com/Sea-Haven-Industries/front-integrations.git
synced 2026-09-30 21:13:13 +00:00
61 lines
1.6 KiB
Terraform
61 lines
1.6 KiB
Terraform
|
|
resource "aws_cloudwatch_log_group" "sla_monitor" {
|
||
|
|
name = "/aws/lambda/front-sla-monitor"
|
||
|
|
retention_in_days = 60
|
||
|
|
}
|
||
|
|
|
||
|
|
resource "aws_cloudwatch_log_group" "user_sync" {
|
||
|
|
name = "/aws/lambda/front-user-sync"
|
||
|
|
retention_in_days = 60
|
||
|
|
}
|
||
|
|
|
||
|
|
resource "aws_lambda_function" "sla_monitor" {
|
||
|
|
function_name = "front-sla-monitor"
|
||
|
|
role = aws_iam_role.sla_monitor.arn
|
||
|
|
handler = "app.handler"
|
||
|
|
runtime = "python3.12"
|
||
|
|
architectures = ["arm64"]
|
||
|
|
memory_size = 256
|
||
|
|
timeout = 300
|
||
|
|
|
||
|
|
s3_bucket = aws_s3_bucket.artifacts.id
|
||
|
|
s3_key = aws_s3_object.sla_monitor.key
|
||
|
|
source_code_hash = data.archive_file.sla_monitor.output_base64sha256
|
||
|
|
|
||
|
|
environment {
|
||
|
|
variables = local.sla_monitor_env
|
||
|
|
}
|
||
|
|
|
||
|
|
depends_on = [
|
||
|
|
aws_s3_object.sla_monitor,
|
||
|
|
aws_cloudwatch_log_group.sla_monitor,
|
||
|
|
aws_iam_role_policy_attachment.sla_monitor_basic,
|
||
|
|
aws_iam_role_policy.sla_monitor_secrets,
|
||
|
|
aws_iam_role_policy.sla_monitor_ddb,
|
||
|
|
]
|
||
|
|
}
|
||
|
|
|
||
|
|
resource "aws_lambda_function" "user_sync" {
|
||
|
|
function_name = "front-user-sync"
|
||
|
|
role = aws_iam_role.user_sync.arn
|
||
|
|
handler = "app.handler"
|
||
|
|
runtime = "python3.12"
|
||
|
|
architectures = ["arm64"]
|
||
|
|
memory_size = 256
|
||
|
|
timeout = 300
|
||
|
|
|
||
|
|
s3_bucket = aws_s3_bucket.artifacts.id
|
||
|
|
s3_key = aws_s3_object.user_sync.key
|
||
|
|
source_code_hash = data.archive_file.user_sync.output_base64sha256
|
||
|
|
|
||
|
|
environment {
|
||
|
|
variables = local.user_sync_env
|
||
|
|
}
|
||
|
|
|
||
|
|
depends_on = [
|
||
|
|
aws_s3_object.user_sync,
|
||
|
|
aws_cloudwatch_log_group.user_sync,
|
||
|
|
aws_iam_role_policy_attachment.user_sync_basic,
|
||
|
|
aws_iam_role_policy.user_sync_secrets,
|
||
|
|
]
|
||
|
|
}
|