-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathiam_connectors_node_group.tf
More file actions
45 lines (42 loc) · 1.2 KB
/
iam_connectors_node_group.tf
File metadata and controls
45 lines (42 loc) · 1.2 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
data "aws_iam_policy_document" "connectors_node_group_trust" {
statement {
effect = "Allow"
actions = ["sts:AssumeRole"]
principals {
type = "Service"
identifiers = ["ec2.amazonaws.com"]
}
}
}
resource "aws_iam_role" "connectors_node_group" {
name_prefix = "${var.common_prefix}-connect-"
path = "/"
force_detach_policies = true
tags = merge(
var.default_tags,
{
"redpanda-client" = "connectors"
}
)
assume_role_policy = data.aws_iam_policy_document.connectors_node_group_trust.json
}
resource "aws_iam_instance_profile" "connectors_node_group" {
name_prefix = "${var.common_prefix}-connect-"
path = "/"
role = aws_iam_role.connectors_node_group.name
tags = merge(
var.default_tags,
{
"redpanda-client" = "connectors"
}
)
}
resource "aws_iam_role_policy_attachment" "connectors_node_group" {
for_each = {
"1" = "arn:aws:iam::aws:policy/AmazonEC2ContainerRegistryReadOnly"
"2" = "arn:aws:iam::aws:policy/AmazonEKSWorkerNodePolicy"
"3" = "arn:aws:iam::aws:policy/AmazonEKS_CNI_Policy"
}
policy_arn = each.value
role = aws_iam_role.connectors_node_group.name
}