Skip to content

Commit 6626133

Browse files
authored
feat: Exposed the service_endpoints input variable to all patterns, with a default value of public-and-private. The value will be used for App ID and Key Protect instance provisioning. (#663)
1 parent 83d4c24 commit 6626133

File tree

20 files changed

+95
-13
lines changed

20 files changed

+95
-13
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -914,7 +914,7 @@ module "cluster_pattern" {
914914
| <a name="input_region"></a> [region](#input\_region) | Region where VPC will be created. To find your VPC region, use `ibmcloud is regions` command to find available regions. | `string` | n/a | yes |
915915
| <a name="input_resource_groups"></a> [resource\_groups](#input\_resource\_groups) | Object describing resource groups to create or reference | <pre>list(<br> object({<br> name = string<br> create = optional(bool)<br> use_prefix = optional(bool)<br> })<br> )</pre> | n/a | yes |
916916
| <a name="input_security_groups"></a> [security\_groups](#input\_security\_groups) | Security groups for VPC | <pre>list(<br> object({<br> name = string<br> vpc_name = string<br> resource_group = optional(string)<br> access_tags = optional(list(string), [])<br> rules = list(<br> object({<br> name = string<br> direction = string<br> source = string<br> tcp = optional(<br> object({<br> port_max = number<br> port_min = number<br> })<br> )<br> udp = optional(<br> object({<br> port_max = number<br> port_min = number<br> })<br> )<br> icmp = optional(<br> object({<br> type = number<br> code = number<br> })<br> )<br> })<br> )<br> })<br> )</pre> | `[]` | no |
917-
| <a name="input_service_endpoints"></a> [service\_endpoints](#input\_service\_endpoints) | Service endpoints. Can be `public`, `private`, or `public-and-private` | `string` | `"private"` | no |
917+
| <a name="input_service_endpoints"></a> [service\_endpoints](#input\_service\_endpoints) | Service endpoints. Can be `public`, `private`, or `public-and-private` | `string` | `"public-and-private"` | no |
918918
| <a name="input_ssh_keys"></a> [ssh\_keys](#input\_ssh\_keys) | SSH keys to use to provision a VSI. Must be an RSA key with a key size of either 2048 bits or 4096 bits (recommended). If `public_key` is not provided, the named key will be looked up from data. If a resource group name is added, it must be included in `var.resource_groups`. See https://cloud.ibm.com/docs/vpc?topic=vpc-ssh-keys. | <pre>list(<br> object({<br> name = string<br> public_key = optional(string)<br> resource_group = optional(string)<br> })<br> )</pre> | n/a | yes |
919919
| <a name="input_tags"></a> [tags](#input\_tags) | List of resource tags to apply to resources created by this module. | `list(string)` | `[]` | no |
920920
| <a name="input_teleport_config_data"></a> [teleport\_config\_data](#input\_teleport\_config\_data) | Teleport config data. This is used to create a single template for all teleport instances to use. Creating a single template allows for values to remain sensitive | <pre>object({<br> teleport_license = optional(string)<br> https_cert = optional(string)<br> https_key = optional(string)<br> domain = optional(string)<br> cos_bucket_name = optional(string)<br> cos_key_name = optional(string)<br> teleport_version = optional(string)<br> message_of_the_day = optional(string)<br> hostname = optional(string)<br> app_id_key_name = optional(string)<br> claims_to_roles = optional(<br> list(<br> object({<br> email = string<br> roles = list(string)<br> })<br> )<br> )<br> })</pre> | `null` | no |

appid.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ resource "ibm_resource_instance" "appid" {
5353
location = var.region
5454
resource_group_id = local.resource_groups[var.appid.resource_group]
5555
tags = var.tags
56+
service_endpoints = var.service_endpoints
5657
}
5758

5859
##############################################################################

examples/one-vpc-one-vsi/override.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"enable_transit_gateway": false,
33
"transit_gateway_global": false,
44
"virtual_private_endpoints": [],
5-
"service_endpoints": "private",
5+
"service_endpoints": "public-and-private",
66
"security_groups": [],
77
"vpn_gateways": [],
88
"atracker": {

examples/override-example/override.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
]
4040
}
4141
],
42-
"service_endpoints": "private",
42+
"service_endpoints": "public-and-private",
4343
"security_groups": [],
4444
"vpn_gateways": [
4545
{

kms/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ resource "ibm_resource_instance" "kms" {
2525
location = var.region
2626
resource_group_id = var.key_management.resource_group_id
2727
tags = var.key_management.tags
28+
service_endpoints = var.service_endpoints
2829
}
2930

3031
resource "ibm_resource_tag" "tag" {

kms/variables.tf

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,4 +83,14 @@ variable "keys" {
8383
}
8484
}
8585

86+
variable "service_endpoints" {
87+
description = "Service endpoints. Can be `public`, `private`, or `public-and-private`"
88+
type = string
89+
default = "public-and-private"
90+
91+
validation {
92+
error_message = "Service endpoints can only be `public`, `private`, or `public-and-private`."
93+
condition = contains(["public", "private", "public-and-private"], var.service_endpoints)
94+
}
95+
}
8696
##############################################################################

patterns/mixed/config.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ locals {
254254
security_groups = lookup(local.override[local.override_type], "security_groups", local.config.security_groups)
255255
virtual_private_endpoints = lookup(local.override[local.override_type], "virtual_private_endpoints", local.config.virtual_private_endpoints)
256256
cos = lookup(local.override[local.override_type], "cos", local.config.object_storage)
257-
service_endpoints = lookup(local.override[local.override_type], "service_endpoints", "private")
257+
service_endpoints = lookup(local.override[local.override_type], "service_endpoints", var.service_endpoints)
258258
add_kms_block_storage_s2s = lookup(local.override[local.override_type], "add_kms_block_storage_s2s", local.config.add_kms_block_storage_s2s)
259259
key_management = lookup(local.override[local.override_type], "key_management", local.config.key_management)
260260
atracker = lookup(local.override[local.override_type], "atracker", local.config.atracker)

patterns/mixed/override.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@
133133
}
134134
],
135135
"security_groups": [],
136-
"service_endpoints": "private",
136+
"service_endpoints": "public-and-private",
137137
"ssh_keys": [
138138
{
139139
"name": "slz-ssh-key",

patterns/mixed/variables.tf

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -541,6 +541,22 @@ variable "add_kms_block_storage_s2s" {
541541

542542
##############################################################################
543543

544+
##############################################################################
545+
# KMS and App ID variables
546+
##############################################################################
547+
variable "service_endpoints" {
548+
description = "Service endpoints. Can be `public`, `private`, or `public-and-private`"
549+
type = string
550+
default = "public-and-private"
551+
552+
validation {
553+
error_message = "Service endpoints can only be `public`, `private`, or `public-and-private`."
554+
condition = contains(["public", "private", "public-and-private"], var.service_endpoints)
555+
}
556+
}
557+
558+
##############################################################################
559+
544560
##############################################################################
545561
# Override JSON
546562
##############################################################################

patterns/roks/module/config.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ locals {
234234
security_groups = lookup(local.override[local.override_type], "security_groups", local.config.security_groups)
235235
virtual_private_endpoints = lookup(local.override[local.override_type], "virtual_private_endpoints", local.config.virtual_private_endpoints)
236236
cos = lookup(local.override[local.override_type], "cos", local.config.object_storage)
237-
service_endpoints = lookup(local.override[local.override_type], "service_endpoints", "private")
237+
service_endpoints = lookup(local.override[local.override_type], "service_endpoints", var.service_endpoints)
238238
add_kms_block_storage_s2s = lookup(local.override[local.override_type], "add_kms_block_storage_s2s", local.config.add_kms_block_storage_s2s)
239239
key_management = lookup(local.override[local.override_type], "key_management", local.config.key_management)
240240
atracker = lookup(local.override[local.override_type], "atracker", local.config.atracker)

0 commit comments

Comments
 (0)