-
Notifications
You must be signed in to change notification settings - Fork 0
/
role.tf
46 lines (44 loc) · 1.11 KB
/
role.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
data "aws_iam_policy_document" "role_trust_policy" {
statement {
sid = "SelfAssumeRole"
actions = ["sts:AssumeRole"]
effect = "Allow"
principals {
type = "AWS"
identifiers = [
"arn:${data.aws_partition.current.partition}:iam::${local.account_id}:root"
]
}
condition {
test = "ArnLike"
variable = "aws:PrincipalArn"
values = [
"arn:${data.aws_partition.current.partition}:iam::${local.account_id}:role/${local.role_name}"
]
}
}
statement {
sid = "SagemakerAssumeRole"
actions = ["sts:AssumeRole"]
effect = "Allow"
principals {
type = "Service"
identifiers = ["sagemaker.amazonaws.com"]
}
}
statement {
sid = "DominoAssumeRole"
actions = ["sts:AssumeRole"]
effect = "Allow"
principals {
type = "AWS"
identifiers = [
var.domino_external_deployments_role_arn,
]
}
}
}
resource "aws_iam_role" "domino_sagemaker_role" {
name = local.role_name
assume_role_policy = data.aws_iam_policy_document.role_trust_policy.json
}