Skip to content

Commit fb7908b

Browse files
authored
feat: new bare vpc pattern (#378)
* feat: added standard pattern
1 parent ded7f6a commit fb7908b

File tree

23 files changed

+2188
-34
lines changed

23 files changed

+2188
-34
lines changed
289 KB
Loading

.docs/images/vpc.png

252 KB
Loading

.docs/patterns/vpc-pattern.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# IBM Secure Landing Zone for the vpc pattern
2+
3+
## Architecture diagram
4+
5+
![VPC pattern architecture diagram](../images/patterns/vpc-pattern.png)
6+
7+
## Configured components and services
8+
9+
The following common services are created:
10+
11+
- Resource groups
12+
- Access groups
13+
- Transit gateway
14+
15+
The following components are configured through automation.
16+
17+
| Multi-Zone Region (MZR) management | Multi-Zone Region (MZR) workload |
18+
|---|---|
19+
| Management access group | Workload access group |
20+
| Management KMS key | Workload KMS key |
21+
| Management Cloud Object Storage Instance and Cloud Object Storage buckets | Workload Cloud Object Storage instance and Cloud Object Storage buckets |
22+
| Management Cloud Object Storage Authorization for Hyper Protect Crypto Services and KeyProtect | Workload Cloud Object Storage Authorization for Hyper Protect Crypto Services and KeyProtect |
23+
| Management Flow Log, Flow log Cloud Object Storage buckets and authorization | Workload flow log, Flow log Cloud Object Storage buckets and authorization |
24+
| Management VPC | Workload VPC |
25+
| Management subnets for VPE and VPN resources | Workload VPE gateway (for Cloud Object Storage) |
26+
| Management VPE gateway (for Cloud Object Storage) | Workload VPE gateway (for Container Registry) |
27+
| Management VPE gateway (for Container Registry) | |

README.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,16 @@ Each of these patterns creates the following infrastructure:
2828

2929
Each pattern creates the following infrastructure on the VPC:
3030

31+
- The VPC pattern deploys a simple IBM Cloud VPC infrastructure without any compute resources like VSIs or Red Hat OpenShift clusters
3132
- The virtual server (VSI) pattern deploys identical virtual servers across the VSI subnet tier in each VPC
3233
- The Red Hat OpenShift Kubernetes (ROKS) pattern deploys identical clusters across the VSI subnet tier in each VPC
3334
- The mixed pattern provisions both of these elements
3435

3536
For more information about the default configuration, see [Default Secure Landing Zone configuration](.docs/pattern-defaults.md).
3637

37-
| Virtual server pattern | Red Hat OpenShift pattern | Mixed pattern |
38-
| -------------------------------- | -------------------------------- | ---------------------------------- |
39-
| ![VSI](./.docs/images/vsi.png) | ![ROKS](./.docs/images/roks.png) | ![Mixed](./.docs/images/mixed.png) |
38+
| VPC pattern | Virtual server pattern | Red Hat OpenShift pattern | Mixed pattern |
39+
| ------------------------------ | ------------------------------ | -------------------------------- | ---------------------------------- |
40+
| ![VPC](./.docs/images/vpc.png) | ![VSI](./.docs/images/vsi.png) | ![ROKS](./.docs/images/roks.png) | ![Mixed](./.docs/images/mixed.png) |
4041

4142
## Before you begin
4243

@@ -90,6 +91,7 @@ In the first method, you set a couple of required input variables of your respec
9091

9192
You can find the list of input variables in the `variables.tf` file of the pattern directory:
9293

94+
- [VPC pattern input variables](./patterns/vpc/variables.tf)
9395
- [VSI pattern input variables](./patterns/vsi/variables.tf)
9496
- [ROKS pattern input variables](./patterns/roks/variables.tf)
9597
- [Mixed pattern input variables](./patterns/mixed/variables.tf)
@@ -415,7 +417,9 @@ Users can add a name and optionally a public key. If `public_key` is not provide
415417
)
416418
```
417419

418-
#### vis variable
420+
#### vsi variable
421+
422+
Note - You can't make changes to the VSI image with this module. That restriction is in place so that you don't inadvertently create an outage or lose data.
419423

420424
The following example shows the `vsi` virtual server variable type.
421425

@@ -905,7 +909,7 @@ statement instead the previous block.
905909
| <a name="module_ssh_keys"></a> [ssh\_keys](#module\_ssh\_keys) | ./ssh_key | n/a |
906910
| <a name="module_teleport_config"></a> [teleport\_config](#module\_teleport\_config) | ./teleport_config | n/a |
907911
| <a name="module_vpc"></a> [vpc](#module\_vpc) | git::https://github.com/terraform-ibm-modules/terraform-ibm-landing-zone-vpc.git | v5.0.1 |
908-
| <a name="module_vsi"></a> [vsi](#module\_vsi) | git::https://github.com/terraform-ibm-modules/terraform-ibm-landing-zone-vsi.git | v2.0.0 |
912+
| <a name="module_vsi"></a> [vsi](#module\_vsi) | git::https://github.com/terraform-ibm-modules/terraform-ibm-landing-zone-vsi.git | v2.0.1 |
909913

910914
## Resources
911915

examples/no-compute-example/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# VPC landing zone (No compute example)
22

3-
![Architecture diagram for the Standard variation of VPC landing zone](https://raw.githubusercontent.com/terraform-ibm-modules/terraform-ibm-landing-zone/main/reference-architectures/vpc.drawio.svg)
3+
![Architecture diagram for the standard variation of VPC landing zone](https://raw.githubusercontent.com/terraform-ibm-modules/terraform-ibm-landing-zone/main/reference-architectures/vpc.drawio.svg)
44

55
You can use the VPC landing zone example to deploy a simple IBM Cloud VPC infrastructure without any compute resources like Virtual Server Instances (VSIs) or Red Hat OpenShift clusters.
66

examples/no-compute-example/main.tf

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@
33
##############################################################################
44

55
module "landing_zone" {
6-
source = "../../patterns/mixed"
7-
prefix = var.prefix
8-
region = var.region
9-
ibmcloud_api_key = var.ibmcloud_api_key
10-
ssh_public_key = var.ssh_key
11-
override = true
12-
tags = var.resource_tags
6+
source = "../../patterns/vpc"
7+
prefix = var.prefix
8+
region = var.region
9+
ibmcloud_api_key = var.ibmcloud_api_key
10+
tags = var.resource_tags
11+
network_cidr = var.network_cidr
12+
vpcs = var.vpcs
13+
enable_transit_gateway = var.enable_transit_gateway
14+
add_atracker_route = var.add_atracker_route
1315
}

examples/no-compute-example/override.json

Lines changed: 0 additions & 4 deletions
This file was deleted.

examples/no-compute-example/variables.tf

Lines changed: 36 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,44 @@ variable "region" {
2525
default = "us-south"
2626
}
2727

28-
variable "ssh_key" {
29-
description = "Public SSH Key for VSI creation. Must be a valid SSH key that does not already exist in the deployment region."
30-
type = string
31-
}
32-
3328
variable "resource_tags" {
3429
type = list(string)
3530
description = "Optional list of tags to be added to created resources"
3631
default = []
3732
}
33+
34+
##############################################################################
35+
# VPC Variables
36+
##############################################################################
37+
38+
variable "network_cidr" {
39+
description = "Network CIDR for the VPC. This is used to manage network ACL rules for cluster provisioning."
40+
type = string
41+
default = "10.0.0.0/8"
42+
}
43+
44+
variable "vpcs" {
45+
description = "List of VPCs to create. The first VPC in this list will always be considered the `management` VPC, and will be where the VPN Gateway is connected. VPCs names can only be a maximum of 16 characters and can only contain lowercase letters, numbers, and - characters. VPC names must begin with a lowercase letter and end with a lowercase letter or number."
46+
type = list(string)
47+
default = ["management", "workload"]
48+
49+
validation {
50+
error_message = "VPCs names can only be a maximum of 16 characters and can only contain lowercase letters, numbers, and - characters. Names must also begin with a lowercase letter and end with a lowercase letter or number."
51+
condition = length([
52+
for name in var.vpcs :
53+
name if length(name) > 16 || !can(regex("^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$", name))
54+
]) == 0
55+
}
56+
}
57+
58+
variable "enable_transit_gateway" {
59+
description = "Create transit gateway"
60+
type = bool
61+
default = true
62+
}
63+
64+
variable "add_atracker_route" {
65+
description = "Atracker can only have one route per zone. use this value to disable or enable the creation of atracker route"
66+
type = bool
67+
default = true
68+
}

module-metadata.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2805,7 +2805,7 @@
28052805
},
28062806
"vsi": {
28072807
"name": "vsi",
2808-
"source": "git::https://github.com/terraform-ibm-modules/terraform-ibm-landing-zone-vsi.git?ref=v2.0.0",
2808+
"source": "git::https://github.com/terraform-ibm-modules/terraform-ibm-landing-zone-vsi.git?ref=v2.0.1",
28092809
"attributes": {
28102810
"prefix": "prefix",
28112811
"tags": "tags"
@@ -2824,7 +2824,7 @@
28242824
},
28252825
"pos": {
28262826
"filename": ".terraform/modules/vsi/main.tf",
2827-
"line": 127
2827+
"line": 132
28282828
}
28292829
},
28302830
"ibm_is_floating_ip.vsi_fip": {
@@ -2840,7 +2840,7 @@
28402840
},
28412841
"pos": {
28422842
"filename": ".terraform/modules/vsi/main.tf",
2843-
"line": 120
2843+
"line": 125
28442844
}
28452845
},
28462846
"ibm_is_instance.vsi": {

patterns/roks/config.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ data "external" "format_output" {
380380

381381
locals {
382382
# Prevent users from inputting conflicting variables by checking regex
383-
# causeing plan to fail when true.
383+
# causing plan to fail when true.
384384
# > if both are false will pass
385385
# > if only one is true will pass
386386
# tflint-ignore: terraform_unused_declarations

0 commit comments

Comments
 (0)