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

Commit 4c1651d

Browse files
author
Sean Sundberg
authored
Updates auth policy and kms encryption (#26)
- Removes auth policy logic to be handled in separate module - Updates kms variables in metadata Signed-off-by: Sean Sundberg <[email protected]>
1 parent 8bfc51a commit 4c1651d

File tree

3 files changed

+10
-24
lines changed

3 files changed

+10
-24
lines changed

main.tf

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -123,17 +123,9 @@ data ibm_is_subnet vpc_subnet {
123123
identifier = local.vpc_subnets[count.index].id
124124
}
125125

126-
resource "ibm_iam_authorization_policy" "policy" {
127-
count = var.kms_enabled && var.authorize_kms ? length(local.policy_targets) : 0
128-
129-
source_service_name = "containers-kubernetes"
130-
target_service_name = local.policy_targets[count.index]
131-
roles = ["Reader"]
132-
}
133-
134126
resource ibm_container_vpc_cluster cluster {
135127
count = !var.exists ? 1 : 0
136-
depends_on = [null_resource.print_resources, ibm_iam_authorization_policy.policy]
128+
depends_on = [null_resource.print_resources]
137129

138130
name = local.cluster_name
139131
vpc_id = local.vpc_id

module.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,9 @@ versions:
2626
refs:
2727
- source: github.com/cloud-native-toolkit/terraform-ibm-vpc-subnets
2828
version: ">= 1.0.0"
29-
- id: kms
29+
- id: kms_key
3030
refs:
31-
- source: github.com/cloud-native-toolkit/terraform-ibm-key-protect
32-
version: ">= 1.0.0"
33-
- source: github.com/cloud-native-toolkit/terraform-ibm-hpcs
31+
- source: github.com/cloud-native-toolkit/terraform-ibm-kms-key
3432
version: ">= 1.0.0"
3533
optional: true
3634
variables:
@@ -56,10 +54,13 @@ versions:
5654
output: id
5755
- name: kms_id
5856
moduleRef:
59-
id: kms
60-
output: guid
57+
id: kms_key
58+
output: kms_id
6159
optional: true
6260
- name: kms_key_id
61+
moduleRef:
62+
id: kms_key
63+
output: id
6364
optional: true
6465
- name: name_prefix
6566
scope: global
@@ -76,4 +77,3 @@ versions:
7677
- name: exists
7778
scope: module
7879
- name: ocp_entitlement
79-
scope: ignore

variables.tf

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -98,13 +98,13 @@ variable "kms_enabled" {
9898
variable "kms_id" {
9999
type = string
100100
description = "The crn of the KMS instance that will be used to encrypt the cluster."
101-
default = ""
101+
default = null
102102
}
103103

104104
variable "kms_key_id" {
105105
type = string
106106
description = "The id of the root key in the KMS instance that will be used to encrypt the cluster."
107-
default = ""
107+
default = null
108108
}
109109

110110
variable "kms_private_endpoint" {
@@ -113,12 +113,6 @@ variable "kms_private_endpoint" {
113113
default = true
114114
}
115115

116-
variable "authorize_kms" {
117-
type = bool
118-
description = "Flag indicating that the authorization between the kms and the service should be created."
119-
default = true
120-
}
121-
122116
variable "login" {
123117
type = bool
124118
description = "Flag indicating that after the cluster is provisioned, the module should log into the cluster"

0 commit comments

Comments
 (0)