-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathcsoc_eventforwarder_role.tf
More file actions
34 lines (32 loc) · 966 Bytes
/
csoc_eventforwarder_role.tf
File metadata and controls
34 lines (32 loc) · 966 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
resource "aws_iam_role" "eventbridge_forwarder_role" {
name = "imms-${var.environment}-eventbridge-forwarder-role"
assume_role_policy = jsonencode({
Version : "2012-10-17",
Statement = [{
Sid = "TrustEventBridgeService",
Effect = "Allow",
Principal = { Service = "events.amazonaws.com" },
Action = "sts:AssumeRole",
Condition = {
StringEquals = {
"aws:SourceAccount" = var.imms_account_id
}
}
}]
})
}
resource "aws_iam_role_policy" "eventbridge_forwarder_policy" {
name = "imms-${var.environment}-eventbridge-forwarder-policy"
role = aws_iam_role.eventbridge_forwarder_role.id
policy = jsonencode({
Version = "2012-10-17",
Statement = [{
Sid = "ActionsForResource",
Effect = "Allow",
Action = ["events:PutEvents"],
Resource = [
"arn:aws:events:eu-west-2:${var.csoc_account_id}:event-bus/shield-eventbus"
]
}]
})
}