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

fix: kube to kms auth policy creation #685

Merged
merged 3 commits into from
Jan 30, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ variable "atracker_cos_bucket" {
description = "Add atracker to cos s2s"
}

variable "clusters" {
description = "Add cluster to kms auth policies"
}

##############################################################################

##############################################################################
Expand All @@ -55,6 +59,22 @@ module "kms_to_block_storage" {
]
}

# workaround for https://github.com/terraform-ibm-modules/terraform-ibm-landing-zone/issues/645
module "kube_to_kms" {
source = "../list_to_map"
list = [
for instance in(length(var.clusters) > 0 ? ["containers-kubernetes"] : []) :
{
name = instance
source_service_name = "containers-kubernetes"
description = "Allow cluster to be encrypted by KMS instance"
roles = ["Reader"]
target_service_name = local.target_key_management_service
target_resource_instance_id = var.key_management_guid
} if local.target_key_management_service != null
]
}

##############################################################################

##############################################################################
Expand Down Expand Up @@ -134,7 +154,8 @@ output "authorizations" {
module.kms_to_block_storage.value,
module.cos_to_key_management.value,
module.flow_logs_to_cos.value,
module.atracker_to_cos.value
module.atracker_to_cos.value,
module.kube_to_kms.value
)
}

Expand Down
1 change: 1 addition & 0 deletions dynamic_values/service_authorizations.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ module "service_authorizations" {
skip_kms_block_storage_s2s_auth_policy = var.skip_kms_block_storage_s2s_auth_policy
skip_all_s2s_auth_policies = var.skip_all_s2s_auth_policies
atracker_cos_bucket = var.atracker_cos_bucket
clusters = var.clusters
}

##############################################################################