Skip to content

Commit 690c464

Browse files
feat: exposed network services vsi compute profile
BREAKING CHANGE: upgrade langing zone version to v6.0.0
1 parent f438569 commit 690c464

File tree

13 files changed

+101
-56
lines changed

13 files changed

+101
-56
lines changed

ibm_catalog.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,9 @@
227227
{
228228
"key": "transit_gateway_global"
229229
},
230+
{
231+
"key": "network_services_vsi_profile"
232+
},
230233
{
231234
"key": "configure_dns_forwarder"
232235
},
@@ -856,6 +859,9 @@
856859
{
857860
"key": "client_to_site_vpn"
858861
},
862+
{
863+
"key": "network_services_vsi_profile"
864+
},
859865
{
860866
"key": "sm_service_plan"
861867
},

modules/powervs-vpc-landing-zone/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ module "powervs-vpc-landing-zone" {
7171
existing_sm_instance_guid = var.existing_sm_instance_guid #(optional. default check vars)
7272
existing_sm_instance_region = var.existing_sm_instance_region #(optional. default check vars)
7373
certificate_template_name = var.certificate_template_name #(optional. default check vars)
74+
network_services_vsi_profile = var.network_services_vsi_profile #(optional. default check vars)
7475
}
7576
```
7677

@@ -101,7 +102,7 @@ Creates VPC Landing Zone | Performs VPC VSI OS Config | Creates PowerVS Infrastr
101102
|------|--------|---------|
102103
| <a name="module_client_to_site_vpn"></a> [client\_to\_site\_vpn](#module\_client\_to\_site\_vpn) | terraform-ibm-modules/client-to-site-vpn/ibm | 1.7.16 |
103104
| <a name="module_configure_network_services"></a> [configure\_network\_services](#module\_configure\_network\_services) | ./submodules/ansible | n/a |
104-
| <a name="module_landing_zone"></a> [landing\_zone](#module\_landing\_zone) | terraform-ibm-modules/landing-zone/ibm//patterns//vsi//module | 5.28.0 |
105+
| <a name="module_landing_zone"></a> [landing\_zone](#module\_landing\_zone) | terraform-ibm-modules/landing-zone/ibm//patterns//vsi//module | 6.0.0 |
105106
| <a name="module_powervs_workspace"></a> [powervs\_workspace](#module\_powervs\_workspace) | terraform-ibm-modules/powervs-workspace/ibm | 2.0.0 |
106107
| <a name="module_private_secret_engine"></a> [private\_secret\_engine](#module\_private\_secret\_engine) | terraform-ibm-modules/secrets-manager-private-cert-engine/ibm | 1.3.2 |
107108
| <a name="module_secrets_manager_group"></a> [secrets\_manager\_group](#module\_secrets\_manager\_group) | terraform-ibm-modules/secrets-manager-secret-group/ibm | 1.2.2 |
@@ -129,6 +130,7 @@ Creates VPC Landing Zone | Performs VPC VSI OS Config | Creates PowerVS Infrastr
129130
| <a name="input_existing_sm_instance_guid"></a> [existing\_sm\_instance\_guid](#input\_existing\_sm\_instance\_guid) | An existing Secrets Manager GUID. The existing Secret Manager instance must have private certificate engine configured. If not provided an new instance will be provisioned. | `string` | `null` | no |
130131
| <a name="input_existing_sm_instance_region"></a> [existing\_sm\_instance\_region](#input\_existing\_sm\_instance\_region) | Required if value is passed into `var.existing_sm_instance_guid`. | `string` | `null` | no |
131132
| <a name="input_external_access_ip"></a> [external\_access\_ip](#input\_external\_access\_ip) | Specify the source IP address or CIDR for login through SSH to the environment after deployment. Access to the environment will be allowed only from this IP address. Can be set to 'null' if you choose to use client to site vpn. | `string` | n/a | yes |
133+
| <a name="input_network_services_vsi_profile"></a> [network\_services\_vsi\_profile](#input\_network\_services\_vsi\_profile) | Compute profile configuration of the network services vsi (cpu and memory configuration). Must be one of the supported profiles. See [here](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles&interface=ui). | `string` | `"cx2-2x4"` | no |
132134
| <a name="input_nfs_server_config"></a> [nfs\_server\_config](#input\_nfs\_server\_config) | Configuration for the NFS server. 'size' is in GB, 'iops' is maximum input/output operation performance bandwidth per second, 'mount\_path' defines the target mount point on os. Set 'configure\_nfs\_server' to false to ignore creating file storage share. | <pre>object({<br> size = number<br> iops = number<br> mount_path = string<br> })</pre> | <pre>{<br> "iops": 600,<br> "mount_path": "/nfs",<br> "size": 200<br>}</pre> | no |
133135
| <a name="input_powervs_backup_network"></a> [powervs\_backup\_network](#input\_powervs\_backup\_network) | Name of the IBM Cloud PowerVS backup network and CIDR to create. | <pre>object({<br> name = string<br> cidr = string<br> })</pre> | <pre>{<br> "cidr": "10.52.0.0/24",<br> "name": "bkp_net"<br>}</pre> | no |
134136
| <a name="input_powervs_image_names"></a> [powervs\_image\_names](#input\_powervs\_image\_names) | List of Images to be imported into cloud account from catalog images. Supported values can be found [here](https://github.com/terraform-ibm-modules/terraform-ibm-powervs-workspace/blob/main/docs/catalog_images_list.md) | `list(string)` | <pre>[<br> "IBMi-75-03-2924-2",<br> "IBMi-74-09-2984-1",<br> "7200-05-07",<br> "7300-02-01",<br> "SLES15-SP5-SAP",<br> "SLES15-SP5-SAP-NETWEAVER",<br> "RHEL9-SP2-SAP",<br> "RHEL9-SP2-SAP-NETWEAVER"<br>]</pre> | no |

modules/powervs-vpc-landing-zone/locals.tf

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,10 @@ locals {
2929
external_access_ip = var.external_access_ip != null && var.external_access_ip != "" ? length(regexall("/", var.external_access_ip)) > 0 ? var.external_access_ip : "${var.external_access_ip}/32" : ""
3030
override_json_string = templatefile("${path.module}/presets/slz-preset.json.tftpl",
3131
{
32-
external_access_ip = local.external_access_ip,
33-
vsi_image = "ibm-redhat-8-8-amd64-sap-applications-1",
34-
transit_gateway_global = var.transit_gateway_global
32+
external_access_ip = local.external_access_ip,
33+
vsi_image = "ibm-redhat-8-8-amd64-sap-applications-1",
34+
network_services_vsi_profile = var.network_services_vsi_profile,
35+
transit_gateway_global = var.transit_gateway_global
3536
}
3637
)
3738
}
@@ -47,9 +48,10 @@ locals {
4748
key_floating_ip_exists = local.key_fip_vsi_exists ? contains(keys(module.landing_zone.fip_vsi[0]), "floating_ip") ? true : false : false
4849
access_host_or_ip = local.key_floating_ip_exists ? module.landing_zone.fip_vsi[0].floating_ip : ""
4950

50-
key_vsi_list_exists = contains(keys(module.landing_zone), "vsi_list") ? true : false
51-
network_services_vsi_exists = local.key_vsi_list_exists ? contains(module.landing_zone.vsi_names, "${var.prefix}-network-services-001") ? true : false : false
52-
network_services_vsi_ip = local.network_services_vsi_exists ? [for vsi in module.landing_zone.vsi_list : vsi.ipv4_address if vsi.name == "${var.prefix}-network-services-001"][0] : ""
51+
key_vsi_list_exists = contains(keys(module.landing_zone), "vsi_list") ? true : false
52+
# network_services_vsi_exists = local.key_vsi_list_exists ? contains(module.landing_zone.vsi_names, "${var.prefix}-network-services-001") ? true : false : false
53+
network_services_vsi_exists = local.key_vsi_list_exists ? length([for vsi_name in module.landing_zone.vsi_names : vsi_name if can(regex("${var.prefix}-network-services", vsi_name))]) > 0 ? true : false : false
54+
network_services_vsi_ip = local.network_services_vsi_exists ? [for vsi in module.landing_zone.vsi_list : vsi.ipv4_address if can(regex("${var.prefix}-network-services", vsi.name))][0] : ""
5355

5456
###### For preset floating ip and network services vsi should exist.
5557
valid_json_used = local.key_floating_ip_exists && local.network_services_vsi_exists ? true : false

modules/powervs-vpc-landing-zone/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
module "landing_zone" {
66
source = "terraform-ibm-modules/landing-zone/ibm//patterns//vsi//module"
7-
version = "5.28.0"
7+
version = "6.0.0"
88
providers = { ibm = ibm.ibm-is }
99

1010
ssh_public_key = var.ssh_public_key

modules/powervs-vpc-landing-zone/presets/slz-preset.json.tftpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,7 @@
533533
{
534534
"name": "network-services",
535535
"image_name": "${vsi_image}",
536-
"machine_type": "cx2-2x4",
536+
"machine_type": "${network_services_vsi_profile}",
537537
"vpc_name": "edge",
538538
"resource_group": "slz-edge-rg",
539539
"enable_floating_ip": false,

modules/powervs-vpc-landing-zone/submodules/ansible/main.tf

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,14 @@ locals {
1313
# 1. Execute shell script to install ansible roles/collections
1414
##############################################################
1515

16+
resource "terraform_data" "trigger_ansible_vars" {
17+
input = [var.playbook_template_vars, var.ansible_host_or_ip]
18+
}
19+
1620
resource "terraform_data" "setup_ansible_host" {
1721

22+
triggers_replace = terraform_data.trigger_ansible_vars
23+
1824
connection {
1925
type = "ssh"
2026
user = "root"
@@ -50,12 +56,10 @@ resource "terraform_data" "setup_ansible_host" {
5056
# 2. Execute ansible playbooks
5157
##############################################################
5258

53-
resource "terraform_data" "trigger_ansible_vars" {
54-
input = var.playbook_template_vars
55-
}
56-
5759
resource "terraform_data" "execute_playbooks" {
5860

61+
triggers_replace = terraform_data.trigger_ansible_vars
62+
5963
depends_on = [terraform_data.setup_ansible_host]
6064

6165
connection {
@@ -68,8 +72,6 @@ resource "terraform_data" "execute_playbooks" {
6872
timeout = "5m"
6973
}
7074

71-
triggers_replace = terraform_data.trigger_ansible_vars
72-
7375
# Create terraform scripts directory
7476
provisioner "remote-exec" {
7577
inline = ["mkdir -p ${local.dst_files_dir}", "chmod 777 ${local.dst_files_dir}", ]

modules/powervs-vpc-landing-zone/variables.tf

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,16 @@ variable "transit_gateway_global" {
5454
default = false
5555
}
5656

57+
#####################################################
58+
# Optional Parameter Network Services VSI Profile
59+
#####################################################
60+
61+
variable "network_services_vsi_profile" {
62+
description = "Compute profile configuration of the network services vsi (cpu and memory configuration). Must be one of the supported profiles. See [here](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles&interface=ui)."
63+
type = string
64+
default = "cx2-2x4"
65+
}
66+
5767
#####################################################
5868
# Optional Parameters VSI OS Management Services
5969
#####################################################

solutions/standard-plus-vsi/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ No resources.
7474
| <a name="input_existing_sm_instance_region"></a> [existing\_sm\_instance\_region](#input\_existing\_sm\_instance\_region) | Required if value is passed into `var.existing_sm_instance_guid`. | `string` | `null` | no |
7575
| <a name="input_external_access_ip"></a> [external\_access\_ip](#input\_external\_access\_ip) | Specify the source IP address or CIDR for login through SSH to the environment after deployment. Access to the environment will be allowed only from this IP address. Can be set to 'null' if you choose to use client to site vpn. | `string` | n/a | yes |
7676
| <a name="input_ibmcloud_api_key"></a> [ibmcloud\_api\_key](#input\_ibmcloud\_api\_key) | The IBM Cloud platform API key needed to deploy IAM enabled resources. | `string` | n/a | yes |
77+
| <a name="input_network_services_vsi_profile"></a> [network\_services\_vsi\_profile](#input\_network\_services\_vsi\_profile) | Compute profile configuration of the network services vsi (cpu and memory configuration). Must be one of the supported profiles. See [here](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles&interface=ui). | `string` | `"cx2-2x4"` | no |
7778
| <a name="input_nfs_server_config"></a> [nfs\_server\_config](#input\_nfs\_server\_config) | Configuration for the NFS server. 'size' is in GB, 'iops' is maximum input/output operation performance bandwidth per second, 'mount\_path' defines the target mount point on os. Set 'configure\_nfs\_server' to false to ignore creating file storage share. | <pre>object({<br> size = number<br> iops = number<br> mount_path = string<br> })</pre> | <pre>{<br> "iops": 600,<br> "mount_path": "/nfs",<br> "size": 200<br>}</pre> | no |
7879
| <a name="input_powervs_backup_network"></a> [powervs\_backup\_network](#input\_powervs\_backup\_network) | Name of the IBM Cloud PowerVS backup network and CIDR to create. | <pre>object({<br> name = string<br> cidr = string<br> })</pre> | <pre>{<br> "cidr": "10.52.0.0/24",<br> "name": "bkp_net"<br>}</pre> | no |
7980
| <a name="input_powervs_management_network"></a> [powervs\_management\_network](#input\_powervs\_management\_network) | Name of the IBM Cloud PowerVS management subnet and CIDR to create. | <pre>object({<br> name = string<br> cidr = string<br> })</pre> | <pre>{<br> "cidr": "10.51.0.0/24",<br> "name": "mgmt_net"<br>}</pre> | no |

solutions/standard-plus-vsi/main.tf

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,26 +7,27 @@ module "standard" {
77

88
providers = { ibm.ibm-is = ibm.ibm-is, ibm.ibm-pi = ibm.ibm-pi, ibm.ibm-sm = ibm.ibm-sm }
99

10-
powervs_zone = var.powervs_zone
11-
prefix = var.prefix
12-
external_access_ip = var.external_access_ip
13-
ssh_public_key = var.ssh_public_key
14-
ssh_private_key = var.ssh_private_key
15-
client_to_site_vpn = var.client_to_site_vpn
16-
configure_dns_forwarder = var.configure_dns_forwarder
17-
configure_ntp_forwarder = var.configure_ntp_forwarder
18-
configure_nfs_server = var.configure_nfs_server
19-
dns_forwarder_config = var.dns_forwarder_config
20-
nfs_server_config = var.nfs_server_config
21-
powervs_resource_group_name = var.powervs_resource_group_name
22-
powervs_management_network = var.powervs_management_network
23-
powervs_backup_network = var.powervs_backup_network
24-
powervs_image_names = [local.qs_tshirt_choice.image]
25-
tags = var.tags
26-
sm_service_plan = var.sm_service_plan
27-
existing_sm_instance_guid = var.existing_sm_instance_guid
28-
existing_sm_instance_region = var.existing_sm_instance_region
29-
certificate_template_name = var.certificate_template_name
10+
powervs_zone = var.powervs_zone
11+
prefix = var.prefix
12+
external_access_ip = var.external_access_ip
13+
ssh_public_key = var.ssh_public_key
14+
ssh_private_key = var.ssh_private_key
15+
client_to_site_vpn = var.client_to_site_vpn
16+
configure_dns_forwarder = var.configure_dns_forwarder
17+
configure_ntp_forwarder = var.configure_ntp_forwarder
18+
configure_nfs_server = var.configure_nfs_server
19+
dns_forwarder_config = var.dns_forwarder_config
20+
nfs_server_config = var.nfs_server_config
21+
powervs_resource_group_name = var.powervs_resource_group_name
22+
powervs_management_network = var.powervs_management_network
23+
powervs_backup_network = var.powervs_backup_network
24+
powervs_image_names = [local.qs_tshirt_choice.image]
25+
tags = var.tags
26+
sm_service_plan = var.sm_service_plan
27+
existing_sm_instance_guid = var.existing_sm_instance_guid
28+
existing_sm_instance_region = var.existing_sm_instance_region
29+
certificate_template_name = var.certificate_template_name
30+
network_services_vsi_profile = var.network_services_vsi_profile
3031
}
3132

3233
moved {

solutions/standard-plus-vsi/variables.tf

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,16 @@ variable "custom_profile" {
9999
}
100100
}
101101

102+
#####################################################
103+
# Optional Parameter Network Services VSI Profile
104+
#####################################################
105+
106+
variable "network_services_vsi_profile" {
107+
description = "Compute profile configuration of the network services vsi (cpu and memory configuration). Must be one of the supported profiles. See [here](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles&interface=ui)."
108+
type = string
109+
default = "cx2-2x4"
110+
}
111+
102112
#####################################################
103113
# Optional Parameters VSI OS Management Services
104114
#####################################################

0 commit comments

Comments
 (0)