-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlambda_role.tf
29 lines (25 loc) · 855 Bytes
/
lambda_role.tf
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
29
resource "aws_iam_role" "serverless_messaging" {
name = "Serverless_Messaging"
assume_role_policy = jsonencode({
Version = "2012-10-17"
Statement = [
{
Effect = "Allow"
Principal = { Service = "lambda.amazonaws.com" }
Action = "sts:AssumeRole"
}
]
})
}
resource "aws_iam_role_policy_attachment" "sns_policy" {
policy_arn = "arn:aws:iam::aws:policy/AmazonSNSFullAccess"
role = aws_iam_role.serverless_messaging.name
}
resource "aws_iam_role_policy_attachment" "ses_policy" {
policy_arn = "arn:aws:iam::aws:policy/AmazonSESFullAccess"
role = aws_iam_role.serverless_messaging.name
}
resource "aws_iam_role_policy_attachment" "stepfunctions_policy" {
policy_arn = "arn:aws:iam::aws:policy/AWSStepFunctionsFullAccess"
role = aws_iam_role.serverless_messaging.name
}