Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(ci-staging): add github actions ci role #650

Merged
merged 1 commit into from
Dec 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions terragrunt/modules/ci-runners/gh_oidc.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,31 @@ resource "aws_iam_openid_connect_provider" "github_actions_provider" {
// unused
thumbprint_list = ["1c58a3a8518e8759bf075b76b750d4f2df264fcd"]
}

resource "aws_iam_role" "github_actions_ci_role" {
name = "ci--rust-lang--aws-runners-test"
assume_role_policy = jsonencode({
Version = "2012-10-17"
Statement = [
{
Effect = "Allow"
Action = [
"sts:AssumeRoleWithWebIdentity",
]
Principal = {
Federated = aws_iam_openid_connect_provider.github_actions_provider.arn
}
Condition = {
// StringLike is used with a wildcard operator (*) to allow any branch, pull request merge branch
// of the repository to assume a role in AWS
StringLike : {
"token.actions.githubusercontent.com:sub" : "repo:rust-lang/aws-runners-test:ref:*"
},
StringEquals : {
"token.actions.githubusercontent.com:aud" : "sts.amazonaws.com"
}
}
}
]
})
}
Loading