Skip to content

Commit

Permalink
fix: Support multiple thumbprints in github odic provider
Browse files Browse the repository at this point in the history
Following GitHub's announcement that can be found on their [blog](https://github.blog/changelog/2023-06-27-github-actions-update-on-oidc-integration-with-aws/)
there are now multiple thumbprints that are required to integrate
AWS with GitHub actions.

We have been running with this change for some time now and wanted
to submit upstream in case others are having issues with their
GitHub actions workflows assuming AWS roles.
  • Loading branch information
therealdwright committed Jun 28, 2023
1 parent c1e20a2 commit 37e9189
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion modules/iam-github-oidc-provider/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ data "aws_partition" "current" {}
data "tls_certificate" "this" {
count = var.create ? 1 : 0

url = var.url
url = var.openid_config_url
}

resource "aws_iam_openid_connect_provider" "this" {
Expand Down
6 changes: 6 additions & 0 deletions modules/iam-github-oidc-provider/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,9 @@ variable "url" {
type = string
default = "https://token.actions.githubusercontent.com"
}

variable "openid_config_url" {
description = "The OIDC Identity Provider's issuer identifier."
type = string
default = "https://token.actions.githubusercontent.com/.well-known/openid-configuration"
}
9 changes: 5 additions & 4 deletions wrappers/iam-github-oidc-provider/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ module "wrapper" {

for_each = var.items

create = try(each.value.create, var.defaults.create, true)
tags = try(each.value.tags, var.defaults.tags, {})
client_id_list = try(each.value.client_id_list, var.defaults.client_id_list, [])
url = try(each.value.url, var.defaults.url, "https://token.actions.githubusercontent.com")
create = try(each.value.create, var.defaults.create, true)
tags = try(each.value.tags, var.defaults.tags, {})
client_id_list = try(each.value.client_id_list, var.defaults.client_id_list, [])
url = try(each.value.url, var.defaults.url, "https://token.actions.githubusercontent.com")
openid_config_url = try(each.value.openid_config_url, var.defaults.openid_config_url, "https://token.actions.githubusercontent.com/.well-known/openid-configuration")
}

0 comments on commit 37e9189

Please sign in to comment.