Skip to content

Commit 56511f3

Browse files
authored
feat: Github OIDC add extra thumbprints as needed (#403)
Co-authored-by: magreenbaum <magreenbaum>
1 parent b684577 commit 56511f3

File tree

4 files changed

+16
-1
lines changed

4 files changed

+16
-1
lines changed

modules/iam-github-oidc-provider/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ No modules.
4848

4949
| Name | Description | Type | Default | Required |
5050
|------|-------------|------|---------|:--------:|
51+
| <a name="input_additional_thumbprints"></a> [additional\_thumbprints](#input\_additional\_thumbprints) | List of additional thumbprints to add to the thumbprint list. | `list(string)` | <pre>[<br> "6938fd4d98bab03faadb97b34396831e3780aea1",<br> "1c58a3a8518e8759bf075b76b750d4f2df264fcd"<br>]</pre> | no |
5152
| <a name="input_client_id_list"></a> [client\_id\_list](#input\_client\_id\_list) | List of client IDs (also known as audiences) for the IAM OIDC provider. Defaults to STS service if not values are provided | `list(string)` | `[]` | no |
5253
| <a name="input_create"></a> [create](#input\_create) | Controls if resources should be created (affects all resources) | `bool` | `true` | no |
5354
| <a name="input_tags"></a> [tags](#input\_tags) | A map of tags to add to the resources created | `map(any)` | `{}` | no |

modules/iam-github-oidc-provider/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ resource "aws_iam_openid_connect_provider" "this" {
1515

1616
url = var.url
1717
client_id_list = coalescelist(var.client_id_list, ["sts.${data.aws_partition.current.dns_suffix}"])
18-
thumbprint_list = data.tls_certificate.this[0].certificates[*].sha1_fingerprint
18+
thumbprint_list = distinct(concat(data.tls_certificate.this[0].certificates[*].sha1_fingerprint, var.additional_thumbprints))
1919

2020
tags = var.tags
2121
}

modules/iam-github-oidc-provider/variables.tf

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,13 @@ variable "url" {
2121
type = string
2222
default = "https://token.actions.githubusercontent.com"
2323
}
24+
25+
variable "additional_thumbprints" {
26+
description = "List of additional thumbprints to add to the thumbprint list."
27+
type = list(string)
28+
# https://github.blog/changelog/2023-06-27-github-actions-update-on-oidc-integration-with-aws/
29+
default = [
30+
"6938fd4d98bab03faadb97b34396831e3780aea1",
31+
"1c58a3a8518e8759bf075b76b750d4f2df264fcd"
32+
]
33+
}

wrappers/iam-github-oidc-provider/main.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,8 @@ module "wrapper" {
77
tags = try(each.value.tags, var.defaults.tags, {})
88
client_id_list = try(each.value.client_id_list, var.defaults.client_id_list, [])
99
url = try(each.value.url, var.defaults.url, "https://token.actions.githubusercontent.com")
10+
additional_thumbprints = try(each.value.additional_thumbprints, var.defaults.additional_thumbprints, [
11+
"6938fd4d98bab03faadb97b34396831e3780aea1",
12+
"1c58a3a8518e8759bf075b76b750d4f2df264fcd"
13+
])
1014
}

0 commit comments

Comments
 (0)