File tree Expand file tree Collapse file tree 8 files changed +64
-12
lines changed Expand file tree Collapse file tree 8 files changed +64
-12
lines changed Original file line number Diff line number Diff line change 11locals {
2- description = " Created By OpenShift Installer"
3- public_endpoints = var. ibmcloud_publish_strategy == " External" ? true : false
2+ description = " Created By OpenShift Installer"
3+ # If any Service Endpoints are being overridden, set visibility to 'private'
4+ # for IBM Terraform Provider to use the endpoints JSON file.
5+ endpoint_visibility = var. ibmcloud_endpoints_json_file != " " ? " private" : " public"
6+ public_endpoints = var. ibmcloud_publish_strategy == " External" ? true : false
47 tags = concat (
58 [" kubernetes.io_cluster_${ var . cluster_id } :owned" ],
69 var. ibmcloud_extra_tags
@@ -14,4 +17,8 @@ locals {
1417provider "ibm" {
1518 ibmcloud_api_key = var. ibmcloud_api_key
1619 region = var. ibmcloud_region
17- }
20+
21+ # Manage endpoints for IBM Cloud services
22+ visibility = local. endpoint_visibility
23+ endpoints_file_path = var. ibmcloud_endpoints_json_file
24+ }
Original file line number Diff line number Diff line change 1+ locals {
2+ # Use the direct COS endpoint if IBM Cloud Service Endpoints are being overridden,
3+ # as public and private may not be available. The direct endpoint requires
4+ # additional IBM Cloud Account configuration, which must be configured when using
5+ # Service Endpoint overrides.
6+ cos_endpoint_type = local. endpoint_visibility == " private" ? " direct" : " public"
7+ }
8+
19# ###########################################
210# COS bucket
311# ###########################################
412
513resource "ibm_cos_bucket" "bootstrap_ignition" {
614 bucket_name = " ${ local . prefix } -bootstrap-ignition"
15+ endpoint_type = local. cos_endpoint_type
716 resource_instance_id = var. cos_resource_instance_crn
817 region_location = var. ibmcloud_region
918 storage_class = " smart"
@@ -16,9 +25,10 @@ resource "ibm_cos_bucket" "bootstrap_ignition" {
1625resource "ibm_cos_bucket_object" "bootstrap_ignition" {
1726 bucket_crn = ibm_cos_bucket. bootstrap_ignition . crn
1827 bucket_location = ibm_cos_bucket. bootstrap_ignition . region_location
19- key = " bootstrap.ign"
2028 content_file = var. ignition_bootstrap_file
29+ endpoint_type = local. cos_endpoint_type
2130 etag = filemd5 (var. ignition_bootstrap_file )
31+ key = " bootstrap.ign"
2232}
2333
2434# ###########################################
Original file line number Diff line number Diff line change 11locals {
2- description = " Created By OpenShift Installer"
3- public_endpoints = var. ibmcloud_publish_strategy == " External" ? true : false
2+ description = " Created By OpenShift Installer"
3+ # If any Service Endpoints are being overridden, set visibility to 'private'
4+ # for IBM Terraform Provider to use the endpoints JSON file.
5+ endpoint_visibility = var. ibmcloud_endpoints_json_file != " " ? " private" : " public"
6+ public_endpoints = var. ibmcloud_publish_strategy == " External" ? true : false
47 tags = concat (
58 [" kubernetes.io_cluster_${ var . cluster_id } :owned" ],
69 var. ibmcloud_extra_tags
@@ -14,4 +17,8 @@ locals {
1417provider "ibm" {
1518 ibmcloud_api_key = var. ibmcloud_api_key
1619 region = var. ibmcloud_region
17- }
20+
21+ # Manage endpoints for IBM Cloud services
22+ visibility = local. endpoint_visibility
23+ endpoints_file_path = var. ibmcloud_endpoints_json_file
24+ }
Original file line number Diff line number Diff line change 11locals {
2- description = " Created By OpenShift Installer"
3- public_endpoints = var. ibmcloud_publish_strategy == " External" ? true : false
2+ description = " Created By OpenShift Installer"
3+ # If any Service Endpoints are being overridden, set visibility to 'private'
4+ # for IBM Terraform Provider to use the endpoints JSON file.
5+ endpoint_visibility = var. ibmcloud_endpoints_json_file != " " ? " private" : " public"
6+ public_endpoints = var. ibmcloud_publish_strategy == " External" ? true : false
47 tags = concat (
58 [" kubernetes.io_cluster_${ var . cluster_id } :owned" ],
69 var. ibmcloud_extra_tags
@@ -14,4 +17,8 @@ locals {
1417provider "ibm" {
1518 ibmcloud_api_key = var. ibmcloud_api_key
1619 region = var. ibmcloud_region
17- }
20+
21+ # Manage endpoints for IBM Cloud services
22+ visibility = local. endpoint_visibility
23+ endpoints_file_path = var. ibmcloud_endpoints_json_file
24+ }
Original file line number Diff line number Diff line change 11locals {
2- prefix = var. cluster_id
2+ # Use the direct COS endpoint if IBM Cloud Service Endpoints are being overridden,
3+ # as public and private may not be available. The direct endpoint requires
4+ # additional IBM Cloud Account configuration, which must be configured when using
5+ # Service Endpoint overrides.
6+ cos_endpoint_type = var. endpoint_visibility == " private" ? " direct" : " public"
7+ prefix = var. cluster_id
38}
49
510resource "ibm_cos_bucket" "images" {
6- bucket_name = " ${ local . prefix } -vsi-image"
11+ bucket_name = " ${ local . prefix } -vsi-image"
12+ # Use the direct COS endpoint if IBM Cloud Service endpoints are being overridden,
13+ # as public and private may not be available. Direct requires additional IBM Cloud
14+ # Account configuration
15+ endpoint_type = local. cos_endpoint_type
716 resource_instance_id = var. cos_resource_instance_crn
817 region_location = var. region
918 storage_class = " smart"
@@ -13,6 +22,7 @@ resource "ibm_cos_bucket_object" "file" {
1322 bucket_crn = ibm_cos_bucket. images . crn
1423 bucket_location = ibm_cos_bucket. images . region_location
1524 content_file = var. image_filepath
25+ endpoint_type = local. cos_endpoint_type
1626 key = basename (var. image_filepath )
1727}
1828
Original file line number Diff line number Diff line change @@ -25,3 +25,7 @@ variable "tags" {
2525variable "cos_resource_instance_crn" {
2626 type = string
2727}
28+
29+ variable "endpoint_visibility" {
30+ type = string
31+ }
Original file line number Diff line number Diff line change @@ -48,6 +48,7 @@ module "image" {
4848 resource_group_id = local. resource_group_id
4949 tags = local. tags
5050 cos_resource_instance_crn = ibm_resource_instance. cos . crn
51+ endpoint_visibility = local. endpoint_visibility
5152}
5253
5354# ###########################################
Original file line number Diff line number Diff line change @@ -55,6 +55,12 @@ variable "ibmcloud_image_filepath" {
5555# Top-level module variables (optional)
5656# ######################################
5757
58+ variable "ibmcloud_endpoints_json_file" {
59+ type = string
60+ description = " JSON file containing IBM Cloud service endpoints"
61+ default = " "
62+ }
63+
5864variable "ibmcloud_preexisting_vpc" {
5965 type = bool
6066 description = " Specifies whether an existing VPC should be used or a new one created for installation."
You can’t perform that action at this time.
0 commit comments