Skip to content

Commit 7a2387a

Browse files
vbontempishemau
andauthored
feat: remove reserved_ips support for DA solution (#675)<br> - removed input variable for DA solution for reserved_ips<br> - adjusted DA documentation and adopter usage
* fix: enhanced description and docs * fix: removed reserved_ips from DA code as not needed --------- Co-authored-by: shemau <[email protected]>
1 parent 8199164 commit 7a2387a

File tree

6 files changed

+54
-71
lines changed

6 files changed

+54
-71
lines changed

ibm_catalog.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,6 @@
8181
},
8282
{
8383
"key": "service_endpoints"
84-
},
85-
{
86-
"key": "reserved_ips"
8784
}
8885
],
8986
"iam_permissions": [

modules/reserved-ips/README.md

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,23 @@
1-
# Reserved IP's Module
1+
# Reserved IPs Module
22

3-
The module creates reserved IPs (https://cloud.ibm.com/docs/vpc?topic=vpc-managing-ip-addresses) on existing subnets. Reserved IPs can be assigned to your resources, for example VPE endpoint gateways.
3+
The module creates a set of reserved IPs (https://cloud.ibm.com/docs/vpc?topic=vpc-managing-ip-addresses) on VPC existing subnets. Reserved IPs can be assigned to your resources, for example Virtual Private Endpoint gateways.
44

55
The module supports the following actions:
66
- Create reserved IP addresses
77

8+
It supports two different ways to specify the Reserved IPs to create:
9+
- by filling the input parameter `var.endpoint_ip_list` with a list of elements with the following attributes:
10+
- `ip_name`: unique name to use for the key of the map representing the reserved IPs structure in output
11+
- `subnet_id`: ID of the VPC subnet to create the reserved IP
12+
- `name`: name of the Reserved IP resource name
13+
- by filling the input parameters `var.subnet_zone_list`, `var.reserved_ip_cloud_services` and `var.cloud_service_by_crn` with the respective attributes: the module logic combines the two lists `var.reserved_ip_cloud_services` and `var.cloud_service_by_crn` into a single list of services by extracting the expected services details and then combines this list with the `var.subnet_zone_list` list to allocate a Reserved IP for each subnet and for each service, by generating a unique `ip_name` key for each element of the map
14+
15+
In both the cases the output of the module is:
16+
- `endpoint_ip_list` with the map of service name & subnet ID to create and bind to the Reserved IPs as map values of the related map key
17+
- `reserved_ip_map` with the map of the Reserved IPs resources created for each of the service name & subnet ID elements of the previous list, mapped by the unique map key.
18+
19+
The module supports also you to associate existing Reserved IPs resources from your VPC through `var.reserved_ips` with specific gateways: in order to associate an existing Reserved IP to a specific gateway add an element to this list with two attributes, the unique map key used or generated for the `endpoint_ip_list` and the related Reserved IP instance to associate it with.
20+
821
### Usage
922

1023
```hcl
@@ -98,7 +111,7 @@ No modules.
98111
| Name | Description | Type | Default | Required |
99112
|------|-------------|------|---------|:--------:|
100113
| <a name="input_cloud_service_by_crn"></a> [cloud\_service\_by\_crn](#input\_cloud\_service\_by\_crn) | List of cloud service CRNs. Each CRN will have a unique endpoint gateways created. For a list of supported services, see the docs [here](https://cloud.ibm.com/docs/vpc?topic=vpc-vpe-supported-services). | <pre>list(<br/> object({<br/> name = string # service name<br/> crn = string # service crn<br/> })<br/> )</pre> | `[]` | no |
101-
| <a name="input_endpoint_ip_list"></a> [endpoint\_ip\_list](#input\_endpoint\_ip\_list) | List of IPs to create. Each object contains an ip name and subnet id | <pre>list(<br/> object({<br/> ip_name = string # reserved ip name<br/> subnet_id = string # subnet id<br/> gateway_name = string # gateway name<br/> name = string # ip name<br/> })<br/> )</pre> | `[]` | no |
114+
| <a name="input_endpoint_ip_list"></a> [endpoint\_ip\_list](#input\_endpoint\_ip\_list) | List of IPs to create. Each object contains an ip name and subnet id | <pre>list(<br/> object({<br/> ip_name = string # reserved ip name<br/> subnet_id = string # subnet id<br/> name = string # ip name<br/> })<br/> )</pre> | `[]` | no |
102115
| <a name="input_prefix"></a> [prefix](#input\_prefix) | The prefix that you would like to append to your resources. Value is only used if no value is passed for the `vpe_name` option in the `reserved_ip_cloud_services` input variable. | `string` | `"vpe"` | no |
103116
| <a name="input_region"></a> [region](#input\_region) | The region to be used in the reserved ip naming convention. | `string` | `"us-south"` | no |
104117
| <a name="input_reserved_ip_cloud_services"></a> [reserved\_ip\_cloud\_services](#input\_reserved\_ip\_cloud\_services) | List of cloud services to create reserved ips for. The keys are the service names, the values (all optional) give some level of control on the created VPEs. | <pre>set(object({<br/> service_name = string<br/> vpe_name = optional(string),<br/> }))</pre> | `[]` | no |

modules/reserved-ips/variables.tf

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,9 @@ variable "endpoint_ip_list" {
6565
description = "List of IPs to create. Each object contains an ip name and subnet id"
6666
type = list(
6767
object({
68-
ip_name = string # reserved ip name
69-
subnet_id = string # subnet id
70-
gateway_name = string # gateway name
71-
name = string # ip name
68+
ip_name = string # reserved ip name
69+
subnet_id = string # subnet id
70+
name = string # ip name
7271
})
7372
)
7473
default = []
Lines changed: 34 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,39 @@
11
# Configuring complex inputs for Virtual Private Endpoint Gateways
22

3-
Several optional input variables in the IBM Cloud [VPE Gateway deployable architecture](https://cloud.ibm.com/catalog#deployable_architecture) use complex object types. You specify these inputs when you configure deployable architecture.
3+
IBM Cloud® Virtual Private Endpoints (VPE) for VPC enables you to connect to supported IBM Cloud services from your Virtual Privte Cloud (VPC) network by using the IP addresses of your choosing, allocated from a subnet within your VPC. For more details about Virtual Private Endpoint Gateways please refer to this [documentation page](https://cloud.ibm.com/docs/vpc?topic=vpc-about-vpe)
44

5-
You can specify a set of IBM Cloud services to create VPE endpoint gateways for. At least one of `cloud_services` or `cloud_service_by_crn` must be specified.
5+
IBM Cloud services either offer a service specific target or an instance specific target for the VPE gateway. In order to target a service specific endpoint, the service should be included in the `cloud_services` block. In order to target an instance specific endpoint the service CRN should be included in the `cloud_service_by_crn` block.
66

7-
- [Cloud Services by name](#cloud-services) (`cloud_services`)
8-
- [Cloud Services by CRN](#cloud-service-by-crn) (`cloud_service_by_crn`)
9-
- [Reserved IPs](#reserved-ips) (`reserved_ips`)
7+
For more details about the IBM Cloud services, their VPE configuration information and about creating gateways to Non-IBM Cloud services please refer to [this documentation page](https://cloud.ibm.com/docs/vpc?topic=vpc-vpe-supported-services)
108

11-
## Cloud Services by name <a name="cloud-services"></a>
9+
As alternative, the CLI command `ibmcloud is endpoint-gateway-targets` returns a list of IBM Cloud services supported in a specific region, including the services' names and their CRNs
1210

13-
You can specify a set of IBM Cloud services by service name to create VPE Endpoint Gateways for. Use `cloud-services` for services that offer general service endpoints.
11+
- [cloud_services](#cloud-services) : this input parameter allows to create a VPE gateway to a IBM Cloud service by specifying its service name
12+
- [cloud_service_by_crn](#cloud-service-by-crn) : this input parameter allows to create a VPE gateway to a IBM Cloud service its service CRN (Cloud Resource Name)
13+
14+
## VPE gateway to Cloud Services by service name <a name="cloud-services"></a>
15+
16+
By setting up this input parameter you can create VPE gateways in your VPC instance by specifying the name of the IBM Cloud services.
17+
18+
**Important note: ** you can use this structure only for IBM Cloud services offering global service endpoints.
1419

1520
- Variable name: `cloud_services`.
16-
- Type: A list of objects that represent IBM Cloud services
17-
- Default value: An empty list (`[]`)
21+
- Type: A list of objects that represent IBM Cloud services with attributes `service_name`, `vpe_name` and `allow_dns_resolution_binding`
22+
- Default value: the default value is an empty list (`[]`)
1823

19-
### Options for cloud_service
24+
### cloud_service attributes
2025

21-
- `service_name` (required): The IBM Cloud service name.
22-
- `vpe_name` (optional): Full control on the VPE name. If not specified, the VPE name will be computed based on prefix, vpc name and service name.
23-
- `allow_dns_resolution_binding` (optional): Indicates whether to allow this endpoint gateway to participate in DNS resolution bindings with a VPC that has dns.enable_hub set to true.
26+
- `service_name` (required): The IBM Cloud service name as per [this documentation page](https://cloud.ibm.com/docs/vpc?topic=vpc-vpe-supported-services) or the name value returned by the CLI command `ibmcloud is endpoint-gateway-targets`
27+
- `vpe_name` (optional): The desired name to assigne to the VPE gateway. If not specified, the VPE name will be computed based on prefix, vpc name and service name.
28+
- `allow_dns_resolution_binding` (optional): Indicates whether to allow this endpoint gateway to participate in DNS resolution bindings. For more details please refer to this [documentation page](https://cloud.ibm.com/docs/vpc?topic=vpc-vpe-dns-sharing-configure-hub&interface=ui). If not set default value is `true`.
2429

25-
### Example service credential
30+
### Example for cloud_services input parameter
2631

2732
```hcl
2833
[
2934
{
30-
"service_name": "kms",
31-
"vpe_name": "kms-gateway",
35+
"service_name": "global-search-tagging",
36+
"vpe_name": "global-search-gateway",
3237
"allow_dns_resolution_binding": false
3338
},
3439
{
@@ -37,56 +42,33 @@ You can specify a set of IBM Cloud services by service name to create VPE Endpoi
3742
]
3843
```
3944

40-
## Cloud Service by CRN <a name="cloud-service-by-crn"></a>
45+
## VPE gateway to Cloud Services by service CRN <a name="cloud-service-by-crn"></a>
4146

42-
You can specify a set of IBM Cloud services by CRN to create VPE Endpoint Gateways for. Use `cloud-service-by-crn` for services that generate instance specific VPE gateway targets.
47+
By setting up this input parameter you can create VPE gateways in your VPC instance by specifying the IBM Cloud services CRNs.
4348

4449
- Variable name: `cloud_service_by_crn`.
45-
- Type: A list of objects that represent IBM Cloud services
46-
- Default value: An empty list (`[]`)
50+
- Type: A list of objects that represent IBM Cloud services with attributes `crn`, `vpe_name`, `service_name` and `allow_dns_resolution_binding`
51+
- Default value: the default value is an empty list (`[]`)
4752

4853
### Options for cloud_service_by_crn
4954

50-
- `crn` (required): IBM Cloud service CRN.
51-
- `vpe_name` (optional): Full control on the VPE name. If not specified, the VPE name will be computed based on prefix, vpc name and service name.
52-
- `service_name` (optional):
53-
- `allow_dns_resolution_binding` (optional): Indicates whether to allow this endpoint gateway to participate in DNS resolution bindings with a VPC that has dns.enable_hub set to true.
55+
- `crn` (mandatory): IBM Cloud service CRN as per [this documentation page](https://cloud.ibm.com/docs/vpc?topic=vpc-vpe-supported-services))or the CRN value returned by the CLI command `ibmcloud is endpoint-gateway-targets`
56+
- `vpe_name` (optional): The desired name to assigne to the VPE gateway. If not specified, the VPE name will be computed based on prefix, vpc name and service name.
57+
- `service_name` (optional): The name of the service used to compute the name of the VPE gateway. If not provided the name is extracted from the CRN.
58+
- `allow_dns_resolution_binding` (optional): Indicates whether to allow this endpoint gateway to participate in DNS resolution bindings. For more details please refer to this [documentation page](https://cloud.ibm.com/docs/vpc?topic=vpc-vpe-dns-sharing-configure-hub&interface=ui). If not set default value is `true`.
5459

55-
### Example cloud_service_by_crn
60+
### Example for cloud_service_by_crn
5661

5762
```hcl
5863
[
5964
{
60-
"crn": "crn:version:cname:ctype:service-name:location:scope:service-instance::",
61-
"vpe_name": "service-gateway",
62-
"service_name": "service-name",
65+
"crn": "crn:v1:bluemix:public:kms:eu-es:::endpoint:private.eu-es.kms.cloud.ibm.com",
66+
"vpe_name": "kms-eu-es-gateway",
67+
"service_name": "kms",
6368
"allow_dns_resolution_binding": false
6469
},
6570
{
66-
"crn": "crn:version:cname:ctype:service-name:location:scope:service-instance::"
71+
"crn": " crn:v1:bluemix:public:iam-svcs:global:::endpoint:private.iam.cloud.ibm.com"
6772
}
6873
]
6974
```
70-
71-
## Reserved IPs <a name="reserved-ips"></a>
72-
73-
Map of existing reserved IP names and values. If you wish to create your reserved ips independently and not create new ones you can first run the `reserved-ips` submodule and then copy the output `reserved_ip_map` here."
74-
75-
- Variable name: `reserved_ips`
76-
- Type: A map of existing reserved IP names and ids
77-
- Default value: An empty map (`{}`)
78-
79-
### Example reserved IPs
80-
81-
The following example shows values for both disk and memory for the `reserved_ips` input.
82-
83-
```hcl
84-
{
85-
"vpc-cloud-object-storage-1" = "0717-12345678-1234-1234-1234-123456789abc"
86-
"vpc-cloud-object-storage-2" = "0727-12345678-1234-1234-1234-123456789abc"
87-
"vpc-cloud-object-storage-3" = "0737-12345678-1234-1234-1234-123456789abc"
88-
"vpc-kms-1" = "0717-12345678-1234-1234-1234-123456789abc"
89-
"vpc-kms-2" = "0727-12345678-1234-1234-1234-123456789abc"
90-
"vpc-kms-3" = "0737-12345678-1234-1234-1234-123456789abc"
91-
}
92-
```

solutions/fully-configurable/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,5 @@ module "vpe" {
4545
cloud_services = var.cloud_services
4646
cloud_service_by_crn = var.cloud_service_by_crn
4747
service_endpoints = var.service_endpoints
48-
reserved_ips = var.reserved_ips
48+
reserved_ips = {} # from a DA usage perspective this map is not needed
4949
}

solutions/fully-configurable/variables.tf

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -127,12 +127,4 @@ variable "service_endpoints" {
127127
}
128128
}
129129

130-
variable "reserved_ips" {
131-
description = "Map of existing reserved IP names and values. If you wish to create your reserved ips independently and not create new ones you can first run the `reserved-ips` submodule and then copy the output `reserved_ip_map` here. [Learn more](https://github.com/terraform-ibm-modules/terraform-ibm-vpe-gateway/tree/main/solutions/fully-configurable/DA-types.md#reserved_ips)."
132-
type = object({
133-
name = optional(string) # reserved ip name
134-
})
135-
default = {}
136-
}
137-
138130
##############################################################################

0 commit comments

Comments
 (0)