Skip to content

Commit

Permalink
Merge branch 'remove_plan_as_artifact'
Browse files Browse the repository at this point in the history
  • Loading branch information
agjmills committed Aug 23, 2024
2 parents 610452c + c797e73 commit db48f6b
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions modules/terraform_state/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -44,24 +44,31 @@ resource "aws_iam_openid_connect_provider" "github" {

data "aws_iam_policy_document" "github_oidc_assume_role" {
statement {
effect = "Allow"
effect = "Allow"
actions = ["sts:AssumeRoleWithWebIdentity"]

principals {
type = "Federated"
type = "Federated"
identifiers = ["arn:aws:iam::${data.aws_caller_identity.current.account_id}:oidc-provider/token.actions.githubusercontent.com"]
}

condition {
test = "StringEquals"
variable = "token.actions.githubusercontent.com:aud"
values = ["sts.amazonaws.com"]
}

condition {
test = "StringLike"
variable = "token.actions.githubusercontent.com:sub"
values = ["repo:alexmills-uk/*"]
values = ["repo:alexmills-uk/*:*"]
}
}
}

resource "aws_iam_role" "github_oidc_role" {
name = "github-deployment"
path = "github-oidc"
assume_role_policy = data.aws_iam_policy_document.github_oidc_assume_role.json
}

Expand Down

0 comments on commit db48f6b

Please sign in to comment.