Skip to content

Commit 6fb02c4

Browse files
author
Scott Cabrinha
authored
feat: Allow users to add more Audiences to OpenID Connect (#1451)
1 parent 4be3cc3 commit 6fb02c4

File tree

4 files changed

+9
-2
lines changed

4 files changed

+9
-2
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,7 @@ Apache 2 Licensed. See [LICENSE](https://github.com/terraform-aws-modules/terraf
262262
| <a name="input_map_users"></a> [map\_users](#input\_map\_users) | Additional IAM users to add to the aws-auth configmap. See examples/basic/variables.tf for example format. | <pre>list(object({<br> userarn = string<br> username = string<br> groups = list(string)<br> }))</pre> | `[]` | no |
263263
| <a name="input_node_groups"></a> [node\_groups](#input\_node\_groups) | Map of map of node groups to create. See `node_groups` module's documentation for more details | `any` | `{}` | no |
264264
| <a name="input_node_groups_defaults"></a> [node\_groups\_defaults](#input\_node\_groups\_defaults) | Map of values to be applied to all node groups. See `node_groups` module's documentation for more details | `any` | `{}` | no |
265+
| <a name="input_openid_connect_audiences"></a> [openid\_connect\_audiences](#input\_openid\_connect\_audiences) | List of OpenID Connect audience client IDs to add to the IRSA provider. | `list(string)` | `[]` | no |
265266
| <a name="input_permissions_boundary"></a> [permissions\_boundary](#input\_permissions\_boundary) | If provided, all IAM roles will be created with this permissions boundary attached. | `string` | `null` | no |
266267
| <a name="input_subnets"></a> [subnets](#input\_subnets) | A list of subnets to place the EKS cluster and workers within. | `list(string)` | n/a | yes |
267268
| <a name="input_tags"></a> [tags](#input\_tags) | A map of tags to add to all resources. Tags added to launch configuration or templates override these values for ASG Tags only. | `map(string)` | `{}` | no |

irsa.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
resource "aws_iam_openid_connect_provider" "oidc_provider" {
1111
count = var.enable_irsa && var.create_eks ? 1 : 0
12-
client_id_list = [local.sts_principal]
12+
client_id_list = local.sts_principal
1313
thumbprint_list = [var.eks_oidc_root_ca_thumbprint]
1414
url = flatten(concat(aws_eks_cluster.this[*].identity[*].oidc.0.issuer, [""]))[0]
1515

local.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ locals {
4444
)
4545

4646
ec2_principal = "ec2.${data.aws_partition.current.dns_suffix}"
47-
sts_principal = "sts.${data.aws_partition.current.dns_suffix}"
47+
sts_principal = compact(concat(["sts.${data.aws_partition.current.dns_suffix}"], var.openid_connect_audiences))
4848

4949
policy_arn_prefix = "arn:${data.aws_partition.current.partition}:iam::aws:policy"
5050
workers_group_defaults_defaults = {

variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,3 +393,9 @@ variable "wait_for_cluster_timeout" {
393393
type = number
394394
default = 300
395395
}
396+
397+
variable "openid_connect_audiences" {
398+
description = "List of OpenID Connect audience client IDs to add to the IRSA provider."
399+
type = list(string)
400+
default = []
401+
}

0 commit comments

Comments
 (0)