Skip to content
This repository was archived by the owner on Sep 27, 2024. It is now read-only.

Commit 2eaccf8

Browse files
authored
update role module with optional namespace variable (#35)
1 parent fc48e2f commit 2eaccf8

3 files changed

Lines changed: 11 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,6 @@ All notable changes to this project will be documented in this file.
33

44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6+
7+
## [2.7.2]
8+
* Update role module with optional namespace variable

role/main.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ resource "aws_iam_role" "api-service-role" {
2222
"Condition": {
2323
"StringEquals": {
2424
"oidc.eks.us-east-1.amazonaws.com/id/${var.OIDCProviderID}:aud": "sts.amazonaws.com",
25-
"oidc.eks.us-east-1.amazonaws.com/id/${var.OIDCProviderID}:sub": "system:serviceaccount:${var.GroupName}:${var.GroupName}-api-service-account"
25+
"oidc.eks.us-east-1.amazonaws.com/id/${var.OIDCProviderID}:sub": "system:serviceaccount:${var.NameSpace}:${var.GroupName}-api-service-account"
2626
}
2727
}
2828
}]
@@ -51,7 +51,7 @@ resource "aws_iam_role" "job-scheduler-service-role" {
5151
"Condition": {
5252
"StringEquals": {
5353
"oidc.eks.us-east-1.amazonaws.com/id/${var.OIDCProviderID}:aud": "sts.amazonaws.com",
54-
"oidc.eks.us-east-1.amazonaws.com/id/${var.OIDCProviderID}:sub": "system:serviceaccount:${var.GroupName}:${var.GroupName}-job-scheduler-service-account"
54+
"oidc.eks.us-east-1.amazonaws.com/id/${var.OIDCProviderID}:sub": "system:serviceaccount:${var.NameSpace}:${var.GroupName}-job-scheduler-service-account"
5555
}
5656
}
5757
}]

role/variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,12 @@ variable "GroupName" {
4040
default = null
4141
}
4242

43+
variable "NameSpace" {
44+
description = "Optional for when the GroupName doesn't match the namespace"
45+
type = string
46+
default = var.GroupName
47+
}
48+
4349
variable "iam_role_path" {
4450
type = string
4551
default = "/delegatedadmin/developer/"

0 commit comments

Comments
 (0)