Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow additional audiences #35

Merged
merged 4 commits into from
Jul 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ applied, the JWT will contain an updated `iss` claim.

| Name | Description | Type | Default | Required |
| ----------------------------- | --------------------------------------------------------------------------- | -------------- | ---------- | :------: |
| additional_audiences | List of additional OIDC audiences allowed to assume the role. | `list(string)` | `null` | no |
| additional_thumbprints | List of additional thumbprints for the OIDC provider. | `list(string)` | `null` | no |
| attach_admin_policy | Flag to enable/disable the attachment of the AdministratorAccess policy. | `bool` | `false` | no |
| attach_read_only_policy | Flag to enable/disable the attachment of the ReadOnly policy. | `bool` | `true` | no |
Expand Down
2 changes: 1 addition & 1 deletion data.tf
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ data "aws_iam_policy_document" "assume_role" {

condition {
test = "StringEquals"
values = ["sts.amazonaws.com"]
values = var.additional_audiences != null ? concat(["sts.amazonaws.com"], var.additional_audiences) : ["sts.amazonaws.com"]
variable = "token.actions.githubusercontent.com:aud"
}

Expand Down
1 change: 1 addition & 0 deletions examples/complete/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ module "aws_oidc_github" {

enabled = var.enabled

additional_audiences = var.additional_audiences
additional_thumbprints = var.additional_thumbprints
attach_admin_policy = var.attach_admin_policy
attach_read_only_policy = var.attach_read_only_policy
Expand Down
6 changes: 6 additions & 0 deletions examples/complete/variables.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
variable "additional_audiences" {
default = null
description = "List of additional OIDC audiences allowed to assume the role."
type = list(string)
}

variable "additional_thumbprints" {
default = null
description = "List of additional thumbprints for the OIDC provider."
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@
// See the License for the specific language governing permissions and
// limitations under the License.

variable "additional_audiences" {
default = null
description = "List of additional OIDC audiences allowed to assume the role."
type = list(string)
}

variable "additional_thumbprints" {
default = null
description = "List of additional thumbprints for the OIDC provider."
Expand Down