-
Notifications
You must be signed in to change notification settings - Fork 0
/
policies.tf
42 lines (38 loc) · 1007 Bytes
/
policies.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
30
31
32
33
34
35
36
37
38
39
40
41
42
data "aws_region" "current" {}
data "aws_caller_identity" "user" {}
data "archive_file" "lambda_zip" {
type = "zip"
source_file = "./dynamodb_stream/index.js"
output_path = "./dynamodb_stream/dynamodb_stream.zip"
}
data "aws_iam_policy_document" "policy_doc" {
statement {
actions = [
"dynamodb:BatchGetItem",
"dynamodb:GetItem",
"dynamodb:GetRecords",
"dynamodb:Scan",
"dynamodb:Query",
"dynamodb:GetShardIterator",
"dynamodb:DescribeStream",
"dynamodb:ListStreams"
]
effect = "Allow"
resources = [module.dynamodb.dynamodb_table_arn, "${module.dynamodb.dynamodb_table_arn}/*"]
}
statement {
actions = ["logs:*"]
effect = "Allow"
resources = ["arn:aws:logs:*:*:*"]
}
}
data "aws_iam_policy_document" "AWSLambdaTrustPolicy" {
statement {
actions = ["sts:AssumeRole"]
effect = "Allow"
principals {
type = "Service"
identifiers = ["lambda.amazonaws.com"]
}
}
}