-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.tf
More file actions
28 lines (25 loc) · 692 Bytes
/
Copy pathmain.tf
File metadata and controls
28 lines (25 loc) · 692 Bytes
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
provider "aws" {
region = "eu-west-1" # Replace with your desired AWS region
}
resource "aws_lambda_function" "example_lambda" {
filename = "src.zip" # This assumes you have a file named lambda.zip in the same directory
function_name = "example_lambda"
role = aws_iam_role.lambda.arn
handler = "index.handler"
runtime = "nodejs14.x"
}
resource "aws_iam_role" "lambda" {
name = "example_lambda_role"
assume_role_policy = jsonencode({
Version = "2012-10-17"
Statement = [
{
Effect = "Allow"
Principal = {
Service = "lambda.amazonaws.com"
}
Action = "sts:AssumeRole"
}
]
})
}