-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.tf
More file actions
95 lines (89 loc) · 2.32 KB
/
main.tf
File metadata and controls
95 lines (89 loc) · 2.32 KB
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
data "overmind_aws_external_id" "this" {}
resource "aws_iam_role" "overmind" {
name = var.role_name
assume_role_policy = jsonencode({
Version = "2012-10-17"
Statement = [
{
Effect = "Allow"
Principal = { AWS = "arn:aws:iam::942836531449:root" }
Action = "sts:AssumeRole"
Condition = {
StringEquals = {
"sts:ExternalId" = data.overmind_aws_external_id.this.external_id
}
}
},
{
Effect = "Allow"
Principal = { AWS = "arn:aws:iam::942836531449:root" }
Action = "sts:TagSession"
},
]
})
tags = merge(var.tags, {
"overmind.version" = "2026-02-17"
})
}
resource "aws_iam_role_policy" "overmind" {
name = "OvmReadOnly"
role = aws_iam_role.overmind.id
policy = jsonencode({
Version = "2012-10-17"
Statement = [
{
Effect = "Allow"
Action = [
"apigateway:Get*",
"autoscaling:Describe*",
"cloudfront:Get*",
"cloudfront:List*",
"cloudwatch:Describe*",
"cloudwatch:GetMetricData",
"cloudwatch:ListTagsForResource",
"directconnect:Describe*",
"dynamodb:Describe*",
"dynamodb:List*",
"ec2:Describe*",
"ecs:Describe*",
"ecs:List*",
"eks:Describe*",
"eks:List*",
"elasticfilesystem:Describe*",
"elasticloadbalancing:Describe*",
"iam:Get*",
"iam:List*",
"kms:Describe*",
"kms:Get*",
"kms:List*",
"lambda:Get*",
"lambda:List*",
"network-firewall:Describe*",
"network-firewall:List*",
"networkmanager:Describe*",
"networkmanager:Get*",
"networkmanager:List*",
"rds:Describe*",
"rds:ListTagsForResource",
"route53:Get*",
"route53:List*",
"s3:GetBucket*",
"s3:ListAllMyBuckets",
"sns:Get*",
"sns:List*",
"sqs:Get*",
"sqs:List*",
"ssm:Describe*",
"ssm:Get*",
"ssm:ListTagsForResource",
]
Resource = "*"
},
]
})
}
resource "overmind_aws_source" "this" {
name = var.name
aws_role_arn = aws_iam_role.overmind.arn
aws_regions = var.regions
}