Skip to content

Commit e191f1f

Browse files
authored
docs: updates to doc based on reviews (#5)
* updates to doc Signed-off-by: Adam Geiger <[email protected]> * additional updates to doc Signed-off-by: Adam Geiger <[email protected]> --------- Signed-off-by: Adam Geiger <[email protected]>
1 parent ba97589 commit e191f1f

8 files changed

+99
-44
lines changed

Diff for: docs/index.html

+5-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
loadSidebar: "sidebar.md",
5656
auto2top: true,
5757
maxLevel: 3,
58-
subMaxLevel: 2,
58+
subMaxLevel: 0,
5959

6060
// 5. docsify-themeable
6161
themeable: {
@@ -66,6 +66,10 @@
6666
requestHeaders: {
6767
'cache-control': 'max-age=0',
6868
},
69+
pagination: {
70+
crossChapter: true,
71+
crossChapterText: true,
72+
},
6973
};
7074
</script>
7175

Diff for: docs/part1/00-objectives.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22

33
In lab 1, you provision a secure VPC-based topology that is aligned with the **VSI on VPC landing zone** deployable architecture, as shown in the following diagram.
44

5-
![VSI on VPC landing zone architecture diagram](https://raw.githubusercontent.com/terraform-ibm-modules/terraform-ibm-landing-zone/main/reference-architectures/vsi-vsi.drawio.svg 'size=60%' )
6-
5+
<img src="https://raw.githubusercontent.com/terraform-ibm-modules/terraform-ibm-landing-zone/main/reference-architectures/vsi-vsi.drawio.svg" width="75%" heigh="75%"/>
76

87
After you provision the VPC, you customize the deployed infrastructure in the following ways:
98
- Expose one of the VSI in the management VPC to act as a "jump box" for operator access. This jump box is the entry point for operators to access the VSIs in the workload VPC.

Diff for: docs/part1/10-project.md

+1
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
1. While you wait for the deployment to finish, consider doing these things:
6464

6565
- Look at the deployment logs:
66+
- The Terraform init step initializes the Terraform configuration files for use with Terraform.
6667
- The Terraform plan steps show the list of resources that are going to be created.
6768
- The Terraform apply steps shows the resources that are being created.
6869

Diff for: docs/part1/20-operator-access.md

+8-7
Original file line numberDiff line numberDiff line change
@@ -27,24 +27,25 @@ Complete the following steps to enable public SSH access to one of the VSI in th
2727

2828
![Floating IP address](../images/part-1/20-floating-ip.png)
2929

30-
5. In the [Security Groups for VPC](https://cloud.ibm.com/vpc-ext/network/securityGroups), click the one labeled `<your_initials>-management`.
31-
6. Go to the Rules section and allow port 22 for inbound by clicking **Create** in the _Inbound rules_ section.
30+
5. Click **Save**.
31+
6. In the [Security Groups for VPC](https://cloud.ibm.com/vpc-ext/network/securityGroups), click the one labeled `<your_initials>-management`.
32+
7. Go to the Rules section and allow port 22 for SSH inbound access by clicking **Create** in the _Inbound rules_ section.
3233

3334
:information_source: **Tip**: Security groups are stateful so you don’t need to add a corresponding outbound rule.
3435

3536
![Allow SSH in Security group](../images/part-1/20-ssh-sg.png)
3637

37-
7. Click **Create**.
38-
8. In the [Access control lists for VPC](https://cloud.ibm.com/vpc-ext/network/acl), click the one labeled `<your_initials>-management-acl`.
39-
9. Create the following ACL inbound rule:
38+
8. Click **Create**.
39+
9. In the [Access control lists for VPC](https://cloud.ibm.com/vpc-ext/network/acl), click the one labeled `<your_initials>-management-acl`.
40+
10. Create the following ACL inbound rule for SSH access:
4041

4142
![SSH ACL Inbound rule](../images/part-1/20-ssh-acl-inbound.png)
4243

43-
10. Create the following ACL outbound rule:
44+
11. Create the following ACL outbound rule for SSH access:
4445

4546
![SSH ACL Outbound rule](../images/part-1/20-ssh-acl-outbound.png)
4647

47-
11. You can now access the 'jump-box' through the public floating IP address that you provisioned earlier. On your computer, issue the following command from the terminal or command window:
48+
12. You can now access the 'jump-box' through the public floating IP address that you provisioned earlier. On your computer, issue the following command from the terminal or command window:
4849

4950
```sh
5051
ssh -i ./lab-key root@<Floating IP of Virtual server instance>

Diff for: docs/part2/10-customizing.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Customizing the landing zone topology
22

3-
## Two ways to customize
3+
## Ways to customize
44

55
The landing zone module is designed to enable both lightweight and deep customizations of the VPC topology, including all the services that are deployed to make the VPC topology compliant.
66

@@ -9,9 +9,9 @@ In a nutshell, you can customize the topology in two ways:
99
- By using Terraform input variables.
1010

1111
The module accepts more than 70 input variables that you can use to tweak the VPC topology. Consider the input variables as "knobs" that you can turn to adjust the topology.
12-
- By passing a JSON string value to the `override.json` variable.
12+
- By passing a JSON string value to the file `override.json` or through the module variable `override_json_string`.
1313

14-
The override file enables deeper and broader types of customizations. By using a JSON file, you can fully customize aspects of the topology beyond what you can achieve with Terraform input variables.
14+
The override enables deeper and broader types of customizations. By using a JSON definition, you can fully customize aspects of the topology beyond what you can achieve with Terraform input variables.
1515

1616
## Defining our custom topology with a JSON definition
1717

Diff for: docs/part2/20-custom-module.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ You can find the code for this step in the [custom-slz](https://github.com/IBM/i
1919
Notice these two settings in the `main.tf` file:
2020

2121
- The `override_json_string` input variable takes the full JSON definition. In this example, the JSON that is passed to the module through the `templatefile` function first to 'inject' the prefix. That process is done to ensure uniqueness of the resource group names in the account, as mentioned in the first item.
22-
- The `source` is set to the standard VSI pattern and points to the version 4.4.7 (the most recent version at the time that this lab was written).
22+
- The `source` is set to the standard VSI pattern and points to the version 4.5.4 (the most recent version at the time that this lab was written).
2323

2424
```hcl
2525
module "landing_zone" {
26-
source = "git::https://github.com/terraform-ibm-modules/terraform-ibm-landing-zone.git//patterns/vsi?ref=v4.4.7"
26+
source = "git::https://github.com/terraform-ibm-modules/terraform-ibm-landing-zone.git//patterns/vsi?ref=v4.5.4"
2727
prefix = var.prefix
2828
region = var.region
2929
ibmcloud_api_key = var.ibmcloud_api_key
@@ -67,13 +67,13 @@ To run the Terraform module in your local environment, follow these steps.
6767
6. Generate a plan. The plan lists of resources that are going to be created.
6868
6969
```sh
70-
terraform plan --var=region=eu-gb -var=ssh-key="$(cat ./lab2-key-tf)" -var=prefix=lab-prefix
70+
terraform plan --var=region=eu-gb -var=ssh_key="$(cat ./lab2-key-tf.pub)" -var=prefix=lab-prefix
7171
```
7272
7373
7. (Optional) Apply the changes.
7474
7575
This step might take up to 15 minutes to complete. You can skip it if you're short on time. The automation is run through the catalog onboarding in a later step of this lab.
7676
7777
```sh
78-
terraform apply --var=region=eu-gb -var=ssh-key="$(cat ./lab2-key-tf)" -var=prefix=lab-prefix
78+
terraform apply --var=region=eu-gb -var=ssh_key="$(cat ./lab2-key-tf.pub)" -var=prefix=lab-prefix
7979
```

Diff for: docs/part2/30-add-apache.md

+76-26
Original file line numberDiff line numberDiff line change
@@ -10,29 +10,79 @@ We configure the remote-exec provisioner to run a script that installs the Apach
1010

1111
![Diagram of the flow through the jump box to the workload VSIs](../images/part-2/media/image21.png)
1212

13-
## Steps
14-
15-
```hcl
16-
resource "null_resource" "application-install" {
17-
count = var.number_vsi_workload
18-
connection {
19-
type = "ssh"
20-
user = "root"
21-
bastion_host = var.floating_ip_address
22-
host = local.workload_ip_list[count.index]
23-
private_key = var.ssh_private_key
24-
agent = false
25-
timeout = "15m"
26-
}
27-
28-
provisioner "remote-exec" {
29-
inline = [
30-
"apt-get install apache2 -y"
31-
]
32-
}
33-
}
34-
```
35-
36-
You can find the full logic in the [app-install](https://github.com/IBM/infra-to-app-with-landing-zone/tree/main/app-install) directory.
37-
38-
?> _TODO_ add steps
13+
## Execute the Apache deployment logic
14+
15+
You can find the code for this step in the [app-install](https://github.com/IBM/infra-to-app-with-landing-zone/tree/main/app-install) directory. The directory contains the following important files:
16+
17+
- The [main.tf](https://github.com/IBM/infra-to-app-with-landing-zone/blob/main/app-install/main.tf) file which contains the terraform logic calling the remote-exec provisioner with the ‘right’ parameters.
18+
19+
Notice the following settings in the `main.tf` file:
20+
21+
- In the connection block, the `bastion_host` is set to the management server floating IP address that you will use as a jump host to connect to the workload server.
22+
- In the connection block, the `host` is set to the IP address of the workload server.
23+
- In the provisioner block, a list of the commands that will be executed on the workload server are listed.
24+
25+
```hcl
26+
resource "null_resource" "application-install" {
27+
count = var.number_vsi_workload
28+
connection {
29+
type = "ssh"
30+
user = "root"
31+
bastion_host = var.floating_ip_address
32+
host = local.workload_ip_list[count.index]
33+
private_key = var.ssh_private_key
34+
agent = false
35+
timeout = "15m"
36+
}
37+
38+
provisioner "remote-exec" {
39+
inline = [
40+
"apt-get install apache2 -y"
41+
]
42+
}
43+
}
44+
```
45+
46+
To run the Terraform module in your local environment, follow these steps.
47+
48+
1. Clone the repository locally with the following Git command, unless you cloned it in the previous step ([Executing the landing zone with a JSON definition](#/./part2/20-custom-module?id=executing-the-landing-zone-with-a-json-definition)):
49+
50+
```sh
51+
git clone https://github.com/IBM/infra-to-app-with-landing-zone
52+
```
53+
54+
2. Change to the `app-install` folder
55+
56+
```sh
57+
cd infra-to-app-with-slz/app-install
58+
```
59+
60+
3. Create a Terraform workspace. Replace `lab` with your own name in the following command.
61+
62+
```sh
63+
terraform workspace new lab
64+
```
65+
66+
Note: If you receive the error `Workspace "..." already exists`, issue the command:
67+
68+
```sh
69+
terraform workspace select lab
70+
```
71+
72+
4. Export the IBM Cloud API key that the Terraform will use for the execution. For instructions, see [Managing user API keys](https://cloud.ibm.com/docs/account?topic=account-userapikey&interface=ui).
73+
74+
```sh
75+
export TF_VAR_ibmcloud_api_key=<your API key>
76+
```
77+
78+
6. Generate a plan. The plan lists of resources that are going to be created.
79+
80+
```sh
81+
terraform plan --var=region=eu-gb -var=ssh_private_key="$(cat ./lab2-key-tf)" -var=floating_ip_address=<The floating point IP address of the jump box> -var=vpc_id=<ID of the workload VPC>
82+
```
83+
84+
7. (Optional) Apply the changes.
85+
86+
```sh
87+
terraform apply --var=region=eu-gb -var=ssh_private_key="$(cat ./lab2-key-tf)" -var=floating_ip_address=<The floating point IP address of the jump box> -var=vpc_id=<ID of the workload VPC>
88+
```

Diff for: main.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66

77
module "landing_zone" {
8-
source = "git::https://github.com/terraform-ibm-modules/terraform-ibm-landing-zone.git//patterns/vsi?ref=v4.4.4"
8+
source = "git::https://github.com/terraform-ibm-modules/terraform-ibm-landing-zone.git//patterns/vsi?ref=v4.5.4"
99
prefix = var.prefix
1010
region = var.region
1111
ibmcloud_api_key = var.ibmcloud_api_key

0 commit comments

Comments
 (0)