Skip to content

Commit 7918cc6

Browse files
feat: include secrets manager and certificate generation (#842)
1 parent 37d0906 commit 7918cc6

15 files changed

+369
-128
lines changed

.secrets.baseline

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"files": "go.sum|^.secrets.baseline$",
44
"lines": null
55
},
6-
"generated_at": "2024-05-14T18:42:22Z",
6+
"generated_at": "2024-05-24T00:49:11Z",
77
"plugins_used": [
88
{
99
"name": "AWSKeyDetector"
@@ -100,15 +100,15 @@
100100
"hashed_secret": "91199272d5d6a574a51722ca6f3d1148edb1a0e7",
101101
"is_secret": false,
102102
"is_verified": false,
103-
"line_number": 44,
103+
"line_number": 45,
104104
"type": "Secret Keyword",
105105
"verified_result": null
106106
},
107107
{
108108
"hashed_secret": "a67ef662b9a11a96b15936764d77e118c9f155dd",
109109
"is_secret": false,
110110
"is_verified": false,
111-
"line_number": 57,
111+
"line_number": 58,
112112
"type": "Secret Keyword",
113113
"verified_result": null
114114
}

ibm_catalog.json

+40
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,26 @@
247247
},
248248
{
249249
"key": "tags"
250+
},
251+
{
252+
"key": "sm_service_plan"
253+
},
254+
{
255+
"key": "existing_sm_instance_guid"
256+
},
257+
{
258+
"key": "existing_sm_instance_region",
259+
"custom_config": {
260+
"config_constraints": {
261+
"generationType": "2"
262+
},
263+
"grouping": "deployment",
264+
"original_grouping": "deployment",
265+
"type": "vpc_region"
266+
}
267+
},
268+
{
269+
"key": "certificate_template_name"
250270
}
251271
],
252272
"outputs": [
@@ -753,6 +773,26 @@
753773
},
754774
{
755775
"key": "tags"
776+
},
777+
{
778+
"key": "sm_service_plan"
779+
},
780+
{
781+
"key": "existing_sm_instance_guid"
782+
},
783+
{
784+
"key": "existing_sm_instance_region",
785+
"custom_config": {
786+
"config_constraints": {
787+
"generationType": "2"
788+
},
789+
"grouping": "deployment",
790+
"original_grouping": "deployment",
791+
"type": "vpc_region"
792+
}
793+
},
794+
{
795+
"key": "certificate_template_name"
756796
}
757797
],
758798
"outputs": [

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

+18-5
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,15 @@ This module provisions the following resources in IBM Cloud:
66
- A **VPC Infrastructure** with the following components:
77
- One VSI for one management (jump/bastion) VSI,
88
- One VSI for network-services configured as squid proxy, NTP and DNS servers(using Ansible Galaxy collection roles [ibm.power_linux_sap collection](https://galaxy.ansible.com/ui/repo/published/ibm/power_linux_sap/). This VSI also acts as central ansible execution node.
9-
- [Client to site VPN server](https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-client-to-site-overview)
10-
- [File storage share](https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-create&interface=ui)
11-
- [Application load balancer](https://cloud.ibm.com/docs/vpc?topic=vpc-load-balancers&interface=ui)
9+
- Optional [Client to site VPN server](https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-client-to-site-overview)
10+
- Optional [File storage share](https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-create&interface=ui)
11+
- Optional [Application load balancer](https://cloud.ibm.com/docs/vpc?topic=vpc-load-balancers&interface=ui)
1212
- IBM Cloud Object storage(COS) Virtual Private endpoint gateway(VPE)
1313
- IBM Cloud Object storage(COS) Instance and buckets
1414
- VPC flow logs
1515
- KMS keys
1616
- Activity tracker
17+
- Optional Secrets Manager Instance Instance with private certificate.
1718

1819
- A local **transit gateway**
1920

@@ -66,6 +67,10 @@ module "fullstack" {
6667
powervs_backup_network = var.powervs_backup_network #(optional. default check vars)
6768
powervs_image_names = var.powervs_image_names #(optional. default check vars)
6869
tags = var.tags #(optional. default check vars)
70+
sm_service_plan = var.sm_service_plan
71+
existing_sm_instance_guid = var.existing_sm_instance_guid #(optional. default check vars)
72+
existing_sm_instance_region = var.existing_sm_instance_region #(optional. default check vars)
73+
certificate_template_name = var.certificate_template_name #(optional. default check vars)
6974
}
7075
```
7176

@@ -94,10 +99,13 @@ Creates VPC Landing Zone | Performs VPC VSI OS Config | Creates PowerVS Infrastr
9499

95100
| Name | Source | Version |
96101
|------|--------|---------|
97-
| <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.1 |
102+
| <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.10 |
98103
| <a name="module_configure_network_services"></a> [configure\_network\_services](#module\_configure\_network\_services) | ./submodules/ansible | n/a |
99104
| <a name="module_landing_zone"></a> [landing\_zone](#module\_landing\_zone) | terraform-ibm-modules/landing-zone/ibm//patterns//vsi//module | 5.22.1 |
100105
| <a name="module_powervs_workspace"></a> [powervs\_workspace](#module\_powervs\_workspace) | terraform-ibm-modules/powervs-workspace/ibm | 2.0.0 |
106+
| <a name="module_private_secret_engine"></a> [private\_secret\_engine](#module\_private\_secret\_engine) | terraform-ibm-modules/secrets-manager-private-cert-engine/ibm | 1.2.2 |
107+
| <a name="module_secrets_manager_group"></a> [secrets\_manager\_group](#module\_secrets\_manager\_group) | terraform-ibm-modules/secrets-manager-secret-group/ibm | 1.1.4 |
108+
| <a name="module_secrets_manager_private_certificate"></a> [secrets\_manager\_private\_certificate](#module\_secrets\_manager\_private\_certificate) | terraform-ibm-modules/secrets-manager-private-cert/ibm | 1.1.3 |
101109
| <a name="module_vpc_file_share_alb"></a> [vpc\_file\_share\_alb](#module\_vpc\_file\_share\_alb) | ./submodules/fileshare-alb | n/a |
102110

103111
### Resources
@@ -106,16 +114,20 @@ Creates VPC Landing Zone | Performs VPC VSI OS Config | Creates PowerVS Infrastr
106114
|------|------|
107115
| [ibm_is_vpc_address_prefix.vpn_address_prefix](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/is_vpc_address_prefix) | resource |
108116
| [ibm_is_vpc_routing_table.transit](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/is_vpc_routing_table) | resource |
117+
| [ibm_resource_instance.secrets_manager](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/resource_instance) | resource |
109118

110119
### Inputs
111120

112121
| Name | Description | Type | Default | Required |
113122
|------|-------------|------|---------|:--------:|
114-
| <a name="input_client_to_site_vpn"></a> [client\_to\_site\_vpn](#input\_client\_to\_site\_vpn) | VPN configuration - the client ip pool, existing instance id(guid) of the secrets manager, CRN of the uploaded VPN server certificate in secrets manager and list of users email ids to access the environment. | <pre>object({<br> enable = bool<br> client_ip_pool = string<br> secrets_manager_id = string<br> server_cert_crn = string<br> vpn_client_access_group_users = list(string)<br> })</pre> | <pre>{<br> "client_ip_pool": "192.168.0.0/16",<br> "enable": false,<br> "secrets_manager_id": "",<br> "server_cert_crn": "",<br> "vpn_client_access_group_users": [<br> ""<br> ]<br>}</pre> | no |
123+
| <a name="input_certificate_template_name"></a> [certificate\_template\_name](#input\_certificate\_template\_name) | The name of the Certificate Template to create for a private\_cert secret engine. When `var.existing_sm_instance_guid` is not null, then it has to be the existing template name that exists in the private cert engine. | `string` | `"my-template"` | no |
124+
| <a name="input_client_to_site_vpn"></a> [client\_to\_site\_vpn](#input\_client\_to\_site\_vpn) | VPN configuration - the client ip pool and list of users email ids to access the environment. If enabled, then a Secret Manager instance is also provisioned with certificates generated. See optional parameters to reuse existing certificate from secrets manager instance. | <pre>object({<br> enable = bool<br> client_ip_pool = string<br> vpn_client_access_group_users = list(string)<br> })</pre> | <pre>{<br> "client_ip_pool": "192.168.0.0/16",<br> "enable": true,<br> "vpn_client_access_group_users": []<br>}</pre> | no |
115125
| <a name="input_configure_dns_forwarder"></a> [configure\_dns\_forwarder](#input\_configure\_dns\_forwarder) | Specify if DNS forwarder will be configured. This will allow you to use central DNS servers (e.g. IBM Cloud DNS servers) sitting outside of the created IBM PowerVS infrastructure. If yes, ensure 'dns\_forwarder\_config' optional variable is set properly. DNS forwarder will be installed on the network-services vsi. | `bool` | `false` | no |
116126
| <a name="input_configure_nfs_server"></a> [configure\_nfs\_server](#input\_configure\_nfs\_server) | Specify if NFS server will be configured. This will allow you easily to share files between PowerVS instances (e.g., SAP installation files). [File storage share and mount target](https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-create&interface=ui) in VPC will be created.. If yes, ensure 'nfs\_server\_config' optional variable is set properly below. Default value is '200GB' which will be mounted on specified directory in network-service vsi. | `bool` | `false` | no |
117127
| <a name="input_configure_ntp_forwarder"></a> [configure\_ntp\_forwarder](#input\_configure\_ntp\_forwarder) | Specify if NTP forwarder will be configured. This will allow you to synchronize time between IBM PowerVS instances. NTP forwarder will be installed on the network-services vsi. | `bool` | `false` | no |
118128
| <a name="input_dns_forwarder_config"></a> [dns\_forwarder\_config](#input\_dns\_forwarder\_config) | Configuration for the DNS forwarder to a DNS service that is not reachable directly from PowerVS. | <pre>object({<br> dns_servers = string<br> })</pre> | <pre>{<br> "dns_servers": "161.26.0.7; 161.26.0.8; 9.9.9.9;"<br>}</pre> | no |
129+
| <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 |
130+
| <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 |
119131
| <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 |
120132
| <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 |
121133
| <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 |
@@ -124,6 +136,7 @@ Creates VPC Landing Zone | Performs VPC VSI OS Config | Creates PowerVS Infrastr
124136
| <a name="input_powervs_resource_group_name"></a> [powervs\_resource\_group\_name](#input\_powervs\_resource\_group\_name) | Existing IBM Cloud resource group name. | `string` | n/a | yes |
125137
| <a name="input_powervs_zone"></a> [powervs\_zone](#input\_powervs\_zone) | IBM Cloud data center location where IBM PowerVS infrastructure will be created. | `string` | n/a | yes |
126138
| <a name="input_prefix"></a> [prefix](#input\_prefix) | A unique identifier for resources. Must begin with a lowercase letter and end with a lowercase letter or number. This prefix will be prepended to any resources provisioned by this template. Prefixes must be 16 or fewer characters. | `string` | n/a | yes |
139+
| <a name="input_sm_service_plan"></a> [sm\_service\_plan](#input\_sm\_service\_plan) | The service/pricing plan to use when provisioning a new Secrets Manager instance. Allowed values: `standard` and `trial`. Only used if `existing_sm_instance_guid` is set to null. | `string` | `"standard"` | no |
127140
| <a name="input_ssh_private_key"></a> [ssh\_private\_key](#input\_ssh\_private\_key) | Private SSH key (RSA format) used to login to IBM PowerVS instances. Should match to public SSH key referenced by 'ssh\_public\_key'. The key is not uploaded or stored. For more information about SSH keys, see [SSH keys](https://cloud.ibm.com/docs/vpc?topic=vpc-ssh-keys). | `string` | n/a | yes |
128141
| <a name="input_ssh_public_key"></a> [ssh\_public\_key](#input\_ssh\_public\_key) | Public SSH Key for VSI creation. Must be an RSA key with a key size of either 2048 bits or 4096 bits (recommended). Must be a valid SSH key that does not already exist in the deployment region. | `string` | n/a | yes |
129142
| <a name="input_tags"></a> [tags](#input\_tags) | List of tag names for the IBM Cloud PowerVS workspace | `list(string)` | `[]` | no |

0 commit comments

Comments
 (0)