Adds langfuse ec2 and api key to code
This commit is contained in:
@@ -202,13 +202,23 @@ resource "aws_iam_role_policy" "s3_policy" {
|
||||
|
||||
policy = jsonencode({
|
||||
Version = "2012-10-17"
|
||||
Statement = [{
|
||||
Effect = "Allow"
|
||||
Action = [
|
||||
"s3:GetObject"
|
||||
]
|
||||
Resource = "arn:aws:s3:::upflux-doc-analyzer/*"
|
||||
}]
|
||||
Statement = [
|
||||
{
|
||||
Effect = "Allow"
|
||||
Action = [
|
||||
"s3:GetObject",
|
||||
"s3:PutObject"
|
||||
]
|
||||
Resource = "arn:aws:s3:::upflux-doc-analyzer/*"
|
||||
},
|
||||
{
|
||||
Effect = "Allow"
|
||||
Action = [
|
||||
"s3:DeleteObject"
|
||||
]
|
||||
Resource = "arn:aws:s3:::upflux-doc-analyzer/temp_textract/*"
|
||||
}
|
||||
]
|
||||
})
|
||||
}
|
||||
|
||||
@@ -229,6 +239,23 @@ resource "aws_iam_role_policy" "textract_policy" {
|
||||
}]
|
||||
})
|
||||
}
|
||||
|
||||
resource "aws_iam_role_policy" "secrets_manager_policy" {
|
||||
name = "${var.app_name}-secrets-manager-policy"
|
||||
role = aws_iam_role.ecs_task_role.id
|
||||
|
||||
policy = jsonencode({
|
||||
Version = "2012-10-17"
|
||||
Statement = [{
|
||||
Effect = "Allow"
|
||||
Action = [
|
||||
"secretsmanager:GetSecretValue"
|
||||
]
|
||||
Resource = "*"
|
||||
}]
|
||||
})
|
||||
}
|
||||
|
||||
# ECS Task Definition
|
||||
resource "aws_ecs_task_definition" "app" {
|
||||
family = var.app_name
|
||||
@@ -242,6 +269,13 @@ resource "aws_ecs_task_definition" "app" {
|
||||
name = var.app_name
|
||||
image = "${data.aws_caller_identity.current.account_id}.dkr.ecr.${var.aws_region}.amazonaws.com/${var.ecr_repository_name}:${var.image_tag}"
|
||||
|
||||
environment = [
|
||||
{
|
||||
name = "LANGFUSE_HOST"
|
||||
value = var.langfuse_host
|
||||
}
|
||||
]
|
||||
|
||||
portMappings = [{
|
||||
containerPort = 8000
|
||||
hostPort = 8000
|
||||
|
||||
@@ -20,4 +20,5 @@ ecr_repository_name = "upflux-doc-analyser"
|
||||
image_tag = "latest"
|
||||
fargate_cpu = "256"
|
||||
fargate_memory = "512"
|
||||
app_count = 1
|
||||
app_count = 1
|
||||
langfuse_host = "http://10.0.0.12:3000"
|
||||
@@ -53,4 +53,9 @@ variable "app_count" {
|
||||
description = "Number of tasks to run"
|
||||
type = number
|
||||
default = 1
|
||||
}
|
||||
|
||||
variable "langfuse_host" {
|
||||
description = "Langfuse host URL"
|
||||
type = string
|
||||
}
|
||||
Reference in New Issue
Block a user