Replies: 2 comments
-
@zlberto Were you able to figure out a good approach here? |
Beta Was this translation helpful? Give feedback.
-
This guide helped me mostly with remix (vite) on AWS lambda: https://dev.to/gautierblandin/deploying-remix-vite-on-lambda-using-pulumi-41oj I only followed it until the Note that the file is located in # ./deployment/lambda.tf
resource "aws_lambda_function" "http" {
filename = "lambda_function.zip"
function_name = "http"
role = aws_iam_role.iam_for_remix_vite_lambda.arn
handler = "index.handler"
architectures = ["arm64"]
source_code_hash = data.archive_file.lambda.output_base64sha256
runtime = "nodejs20.x"
environment {
variables = {
foo = "bar"
}
}
}
resource "aws_lambda_function_url" "furl" {
authorization_type = "NONE"
function_name = aws_lambda_function.http.function_name
}
data "aws_iam_policy_document" "assume_role" {
statement {
effect = "Allow"
principals {
type = "Service"
identifiers = ["lambda.amazonaws.com"]
}
actions = ["sts:AssumeRole"]
}
}
resource "aws_iam_role" "iam_for_remix_vite_lambda" {
name = "iam_for_remix_vite_lambda"
path = "/service-role/"
assume_role_policy = data.aws_iam_policy_document.assume_role.json
}
data "archive_file" "lambda" {
type = "zip"
source_file = "${path.module}/../build/lambda/index.cjs"
output_path = "lambda_function.zip"
}
output "lambda_url" {
value = aws_lambda_function_url.furl.function_url
} |
Beta Was this translation helpful? Give feedback.
-
Could you provide documentation on how to deploy a Remix app in AWS Lambda using Terraform?
Beta Was this translation helpful? Give feedback.
All reactions