-
Notifications
You must be signed in to change notification settings - Fork 8
/
main.tf
56 lines (49 loc) · 1.3 KB
/
main.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
resource "aws_iam_role" "role" {
name = "${var.aws_iam_role_name}"
assume_role_policy = "${data.aws_iam_policy_document.assume_role_policy.json}"
}
resource "aws_iam_role_policy" "role" {
name = "${var.aws_iam_role_name}"
role = "${aws_iam_role.role.id}"
policy = "${data.aws_iam_policy_document.role_policy.json}"
}
data "aws_iam_policy_document" "assume_role_policy" {
statement {
effect = "Allow"
actions = ["sts:AssumeRole"]
principals {
type = "AWS"
identifiers = ["arn:aws:iam::${var.epsagon_account_id}:root"]
}
condition {
test = "StringEquals"
variable = "sts:ExternalId"
values = ["${var.epsagon_external_id}"]
}
}
}
data "aws_iam_policy_document" "role_policy" {
statement {
effect = "Allow"
actions = [
"logs:PutSubscriptionFilter",
"logs:DescribeSubscriptionFilters",
"logs:DeleteSubscriptionFilter",
"logs:FilterLogEvents",
"logs:DescribeLogStreams",
"logs:DescribeLogGroups",
"lambda:List*",
"lambda:Get*",
"batch:Describe*",
"xray:Get*",
"xray:BatchGet*",
"apigateway:GET",
"apigateway:HEAD",
"apigateway:OPTIONS",
"states:List*",
"states:Get*",
"states:Describe*",
]
resources = ["*"]
}
}