Skip to content
This repository was archived by the owner on Nov 24, 2023. It is now read-only.

Commit c2e9314

Browse files
kavya498hkantare
authored andcommitted
rename cos_instance in secure ROKS example
1 parent 3517c53 commit c2e9314

File tree

4 files changed

+5
-12
lines changed

4 files changed

+5
-12
lines changed

examples/secure-roks-cluster/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ Review the following variables that you can customize in your Terraform template
6767
|ibmcloud_api_key|[IBM Cloud IAM API key](https://cloud.ibm.com/docs/account?topic=account-userapikey#create_user_key).|string|N/A|Yes|
6868
|region|[IBM Cloud region for the VPC cluster](https://cloud.ibm.com/docs/openshift?topic=openshift-regions-and-zones#zones-vpc).|string|N/A|Yes|
6969
|resource_group|Name of the [IBM Cloud resource group](https://cloud.ibm.com/docs/account?topic=account-rgs) to create the resources in. If set to `null`, the default resource group is used.|string|`null`|No|
70-
|cos_instance_name|Name of the IBM Cloud Object Storage instance. If set to `null`, an instance is created with the following naming convention: `<var.resource_prefix>-cos`|string|`null`|No|
70+
|cos_instance|CRN of the IBM Cloud Object Storage instance. If set to `null`, an instance is created with the following naming convention: `<var.resource_prefix>-cos`|string|`null`|No|
7171
|resource_prefix|Prefix to use for created resource names.|string|N/A|Yes|
7272
|flavor|The flavor for the VPC worker nodes to create in the cluster. To list available flavors, run `ibmcloud ks flavors --zone <vpc_region>-1`.|string|`bx2.4x16`|No|
7373
|ocp_version|Specify the Red Hat OpenShift on IBM Cloud version. To list versions, run `ibmcloud ks versions`.|string|`4.6_openshift`|No|

examples/secure-roks-cluster/cos.tf

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,5 @@
1-
data "ibm_resource_instance" "cos_instance" {
2-
count = var.cos_instance_name != null ? 1 : 0
3-
name = var.cos_instance_name
4-
location = "global"
5-
resource_group_id = data.ibm_resource_group.resource_group.id
6-
service = "cloud-object-storage"
7-
}
81
resource "ibm_resource_instance" "cos_instance" {
9-
count = var.cos_instance_name != null ? 0 : 1
2+
count = var.cos_instance != null ? 0 : 1
103
name = "${var.resource_prefix}-cos"
114
location = "global"
125
resource_group_id = data.ibm_resource_group.resource_group.id

examples/secure-roks-cluster/locals.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
locals {
2-
cos_crn = var.cos_instance_name != null ? data.ibm_resource_instance.cos_instance[0].id : ibm_resource_instance.cos_instance[0].id
2+
cos_crn = var.cos_instance != null ? var.cos_instance : ibm_resource_instance.cos_instance[0].id
33
sysdig_instance_id = var.sysdig_instance != null ? var.sysdig_instance : module.sysdig_instance[0].sysdig_guid
44
logdna_instance_id = var.logdna_instance != null ? var.logdna_instance : module.logdna_instance[0].logdna_instance_guid
55
zones = [for index in range(3) : "${var.region}-${index + 1}"]

examples/secure-roks-cluster/variables.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ variable "resource_group" {
1919
######################################################
2020
#IBM-Cloud Object Storage Variables
2121
######################################################
22-
variable "cos_instance_name" {
23-
description = "Name of Object Storage Instance. If null it creates an instance with `<var.resource_prefix>-cos"
22+
variable "cos_instance" {
23+
description = "CRN of Object Storage Instance. If null it creates an instance with `<var.resource_prefix>-cos"
2424
type = string
2525
default = null
2626
}

0 commit comments

Comments
 (0)