-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdata.tf
More file actions
54 lines (44 loc) · 980 Bytes
/
data.tf
File metadata and controls
54 lines (44 loc) · 980 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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
data "aws_caller_identity" "current" {}
data "aws_region" "current" {}
data "archive_file" "lambda" {
type = "zip"
source_file = "${path.module}/build/main"
output_path = "${path.module}/build/main.zip"
depends_on = [
null_resource.lambda
]
}
data "aws_iam_policy_document" "lambda" {
statement {
actions = ["sts:AssumeRole"]
effect = "Allow"
principals {
type = "Service"
identifiers = ["lambda.amazonaws.com"]
}
}
}
data "aws_iam_policy_document" "lambda_policy" {
statement {
effect = "Allow"
actions = [
"logs:CreateLogGroup",
"logs:CreateLogStream",
"logs:PutLogEvents",
]
resources = [
"${aws_cloudwatch_log_group.this.arn}",
]
}
statement {
effect = "Allow"
actions = [
"autoscaling:DescribeAutoScalingInstances",
"autoscaling:DetachInstances",
"autoscaling:SetDesiredCapacity",
]
resources = [
"*",
]
}
}