Skip to content

Commit

Permalink
feat(oidc): Add OIDC provider condition
Browse files Browse the repository at this point in the history
  • Loading branch information
Balsir committed Dec 5, 2024
1 parent 593d595 commit 98d63ca
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion modules/addon-oidc/iam.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
locals {
oidc_provider_create = var.enabled == true && var.oidc_provider_create == true # var.oidc_provider_create == true
oidc_provider_create = var.enabled == true && var.oidc_provider_create == true
oidc_role_create = var.enabled == true && var.oidc_role_create == true
oidc_role_name_prefix = try(coalesce(var.oidc_role_name_prefix), "")
oidc_role_name = try(trim("${local.oidc_role_name_prefix}-${var.oidc_role_name}", "-"), "")
Expand Down
24 changes: 12 additions & 12 deletions modules/addon-oidc/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,25 @@ variable "enabled" {
variable "oidc_provider_create" {
type = bool
default = null
description = "Whether to create oidc provider. Defaults to `true`. Set to false if you want to disable default oidc provider when oidc_custom_provider_arn is set"
description = "Whether to create OIDC provider. Defaults to `true`. Set to false if you want to disable default OIDC provider when oidc_custom_provider_arn is set"
}

variable "oidc_role_create" {
type = bool
default = null
description = "Whether to create oidc role and annotate Service Account. Defaults to `true`."
description = "Whether to create OIDC role and annotate Service Account. Defaults to `true`."
}

variable "oidc_role_name_prefix" {
type = string
default = null
description = "oidc role name prefix. Defaults to addon oidc component name with `oidc` suffix."
description = "OIDC role name prefix. Defaults to addon OIDC component name with `oidc` suffix."
}

variable "oidc_role_name" {
type = string
default = null
description = "oidc role name. The value is prefixed by `var.oidc_role_name_prefix`. Defaults to addon Helm chart name."
description = "OIDC role name. The value is prefixed by `var.oidc_role_name_prefix`. Defaults to addon Helm chart name."
}

variable "oidc_policy_enabled" {
Expand All @@ -39,37 +39,37 @@ variable "oidc_policy_enabled" {
variable "oidc_policy" {
type = string
default = null
description = "Policy to be attached to the oidc role. Applied only if `oidc_policy_enabled` is `true`."
description = "Policy to be attached to the OIDC role. Applied only if `oidc_policy_enabled` is `true`."
}

variable "oidc_assume_role_enabled" {
type = bool
default = null
description = "Whether oidc is allowed to assume role defined by `oidc_assume_role_arn`. Mutually exclusive with `oidc_policy_enabled`. Defaults to `false`."
description = "Whether OIDC is allowed to assume role defined by `oidc_assume_role_arn`. Mutually exclusive with `oidc_policy_enabled`. Defaults to `false`."
}

variable "oidc_assume_role_arns" {
type = list(string)
default = null
description = "List of ARNs assumable by the oidc role. Applied only if `oidc_assume_role_enabled` is `true`. Defaults to `[]`."
description = "List of ARNs assumable by the OIDC role. Applied only if `oidc_assume_role_enabled` is `true`. Defaults to `[]`."
}

variable "oidc_permissions_boundary" {
type = string
default = null
description = "ARN of the policy that is used to set the permissions boundary for the oidc role. Defaults to `\"\"`."
description = "ARN of the policy that is used to set the permissions boundary for the OIDC role. Defaults to `\"\"`."
}

variable "oidc_additional_policies" {
type = map(string)
default = null
description = "Map of the additional policies to be attached to oidc role. Where key is arbitrary id and value is policy ARN. Defaults to `{}`."
description = "Map of the additional policies to be attached to OIDC role. Where key is arbitrary id and value is policy ARN. Defaults to `{}`."
}

variable "oidc_tags" {
type = map(string)
default = null
description = "oidc resources tags. Defaults to `{}`."
description = "OIDC resources tags. Defaults to `{}`."
}

variable "oidc_assume_role_policy_condition_test" {
Expand All @@ -93,13 +93,13 @@ variable "oidc_assume_role_policy_condition_variable" {
variable "oidc_openid_client_ids" {
type = list(string)
default = []
description = "List of OpenID Connect client IDs that are allowed to assume the oidc provider. Defaults to `[]`."
description = "List of OpenID Connect client IDs that are allowed to assume the OIDC provider. Defaults to `[]`."
}

variable "oidc_openid_provider_url" {
type = string
default = null
description = "oidc provider url. Defaults to `\"\"`."
description = "OIDC provider URL. Defaults to `\"\"`."
}

variable "oidc_openid_thumbprints" {
Expand Down

0 comments on commit 98d63ca

Please sign in to comment.