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

enable key vault provider and workload identities on aks cluster #17

Merged
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
14 changes: 11 additions & 3 deletions base-infrastructure/terraform/resources/aks.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
resource "azurerm_kubernetes_cluster" "ifrcgo" {
lifecycle {
ignore_changes = all
}
# lifecycle {
# ignore_changes = all
# }

name = "${local.prefix}-cluster"
location = data.azurerm_resource_group.ifrcgo.location
Expand All @@ -27,6 +27,14 @@ resource "azurerm_kubernetes_cluster" "ifrcgo" {
Environment = var.environment
ManagedBy = "IFRCGo"
}

key_vault_secrets_provider {
secret_rotation_enabled = true
secret_rotation_interval = var.secret_rotation_interval
}

oidc_issuer_enabled = true
workload_identity_enabled = true
}

# add the role to the identity the kubernetes cluster was assigned
Expand Down
12 changes: 12 additions & 0 deletions base-infrastructure/terraform/resources/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,18 @@ variable "RESOURCES_DB_SERVER" {
default = ""
}

variable "secret_rotation_interval" {
type = string
description = "How frequently the cluster should check for secret changes in minutes, in the form of '2m', '3m', etc."
default = "2m"

validation {
condition = can(regex("^[1-9][0-9]*m$", var.secret_rotation_interval))
error_message = "The secret_rotation_interval value must be a string in the form of 'Xm' where X is a positive integer, e.g., '2m', '10m', etc."
}
}


# -----------------
# Attach ACR
# Defaults to common resources
Expand Down