-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.tf
34 lines (28 loc) · 818 Bytes
/
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
resource "aws_iam_role" "orchestration_role" {
name = local.orchestration_role_names1
assume_role_policy = <<EOF
{
"Version":"2012-10-17",
"Statement": {
"Effect": "Allow",
"Action": "sts:AssumeRoleWithWebIdentity",
"Principal":{
"Federated": "arn:aws:iam::${var.aws_oidc_account}:oidc-provider/token.actions.githubusercontent.com"
},
"Condition":{
"StringEquals":{
"token.actions.githubusercontent.com:sub": [
"repo:ipipeline/${var.github_repo_name}:ref:refs/heads/test-dev",
"repo:ipipeline/${var.github_repo_name}:pull_request"
]
}
}
}
}
EOF
tags = var.tags
}
variable "github_repo_name" {
description = "The name of the repository to use with assume role policy trust condition"
type = list
}