Skip to content

Commit 20c4d9b

Browse files
committed
docs: further iteration on lab 2
1 parent 2159e43 commit 20c4d9b

7 files changed

+58
-34
lines changed

Diff for: docs/images/part-2/override-gui.png

21 KB
Loading

Diff for: docs/part1/50-going-further.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,10 @@ From a compliance perspective, record all interactive operator actions with a ba
2121

2222
In the lab, the workload is exposed through a public VPC load balancer that is attached to the workload VPC. With the following additions, you can make the solution more secure.
2323

24-
Introduce a web application firewall in the flow in one of two ways:
24+
1. Create the public VPC load balancer in a separate edge VPC. Route the traffic from the edge VPC to the application that is running on the workload VPC through a private load balancer (which is routable only from within the VPC topology). This approach ensures that no direct public network flows to the workload VPC. For more information, see [Connecting from public internet](https://cloud.ibm.com/docs/framework-financial-services?topic=framework-financial-services-vpc-architecture-connectivity-workload#consumer-provider-public-internet) in "Consumer connectivity to workload VPC".
2525

26+
2. Introduce a web application firewall in the flow in one of two ways:
2627
- As-a-service: Typically, you add a global load balancer, such as IBM Cloud CIS or Akamai, in front of the VPC load balancer. Then, you add a network ACL on the VPC load balancer to accept inbound traffic only from the global load balancer set of known IP addresses.
2728
- Hosted: You can host the application with a 3rd-party solution, such as BigIP F5. This solution is deployed and hosted on servers that you run, for example in VSIs in the landing-zone VPC topology. For a tutorial, see [Setting up a web application firewall with F5 BIG-IP](https://cloud.ibm.com/docs/framework-financial-services?topic=framework-financial-services-vpc-architecture-connectivity-waf-tutorial).
2829

29-
Create the public VPC load balancer in a separate edge VPC. Route the traffic from the edge VPC to the application that is running on the workload VPC through a private load balancer (which is routable only from within the VPC topology). This approach ensures that no direct public network flows to the workload VPC. For more information, see [Connecting from public internet](https://cloud.ibm.com/docs/framework-financial-services?topic=framework-financial-services-vpc-architecture-connectivity-workload#consumer-provider-public-internet) in "Consumer connectivity to workload VPC".
30+

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

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,6 @@
22

33
Lab 1 shows how you can leverage existing landing-zone automation to deploy most of the topology, and then customize and deploy on top of that infrastructure.
44

5-
The purpose of part 2 is to show of the manual steps in part 1 can be fully automated. Part 2 will also show how the fully automated custom solution can be shared with other users in your enterprise through the [IBM Cloud Catalog](https://cloud.ibm.com/catalog).
5+
The purpose of lab 2 is to show of the manual steps in lab 1 can be fully automated. Lab 2 will also show how the fully automated custom solution can be shared with other users in your enterprise through the [IBM Cloud Catalog](https://cloud.ibm.com/catalog).
6+
7+
Lab 2 assumes a basic knowledge of [Terraform](https://www.ibm.com/topics/terraform).

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

+18-14
Original file line numberDiff line numberDiff line change
@@ -10,28 +10,23 @@ two ways the topology can be customized:
1010
variables that can be used to tweaks aspects of the VPC topology
1111
that is deployed. See them as "knobs" that you can turn to slightly
1212
adjust the desired VPC topology.
13-
2. By using a json file, named override.json, which enables deeper and
14-
broader types of customizations. Using a JSON file, you can fully
13+
2. By using a json definition, which enables deeper and
14+
broader types of customizations. The Landing Zone module accepts a json input in the form of a file or through a string containing a json definition. Using a json definition, you can fully
1515
customize all aspects of the topology, beyond the use of the
1616
Terraform input variables.
1717

1818
## Defining our custom topology with a json definition
1919

2020
In this lab, we are going to use the json-based approach to define a
21-
topology that matches the manual steps followed in the part 1 of the
22-
lab. As a reminder:
23-
- A VPC-topology based on the standard SLZ pattern
24-
- A customization to expose one of the VSI in the management VPC
25-
through a public floating IP -- this is our "jump box".
26-
- Exposing one of the VSI in the workload VPC behind a public load
27-
balancer
28-
- All necessary adjustments to the network ACL and security group to
29-
accommodate inbound and outbound traffic to the management jump box
30-
and the workload.
21+
topology that matches the manual steps followed in lab 1 of the
22+
lab. Starting from the definition for the standard VSI landing zone pattern as a starting point, we make the following customizations:
23+
- Expose one of the VSI in the management VPC through a public floating IP -- this is our "jump box".
24+
- Add a public VPC load balancer serving public http traffic and distribiting requests to the VSIs in the workload VPC
25+
- All necessary adjustments to the network ACL and security group to accommodate inbound and outbound traffic to the management jump box (ssh access) and the workload (http).
3126

3227
### Creating the json definition
3328

34-
There are three ways to produce a json file that codify the desired
29+
There are three ways to produce a json definition that codify the desired
3530
topology -- ranked by order of complexity:
3631
1. The first way is to use the Graphical User Inferface tool provided
3732
at
@@ -56,5 +51,14 @@ topology -- ranked by order of complexity:
5651
### Creating the json definition
5752

5853
In this lab, we provide the JSON file containing those customizations
59-
[here](https://github.com/IBM/infra-to-app-with-landing-zone/blob/main/custom-slz/override.tftpl) .
54+
[here](https://github.com/IBM/infra-to-app-with-landing-zone/blob/main/custom-slz/override.tftpl) .
55+
56+
?> _TODO_ ensure the gui is updated before the lab
57+
58+
You may take a few moment to explore the content of the provided json definition:
59+
1. Import the json definition in the Graphical User Inferface tool provided at <https://slz-gui.15z7evpngrsf.us-south.codeengine.appdomain.cloud/>.
60+
2. Click the Import JSON button and copy paste the content of the JSON definition.
61+
![](../images/part-2/override-gui.png)
62+
3. After import, you can use the GUI to explore the various facet of the topology using the right-hand menu. Of particular interest in the scope of the customizations are the [VPC Access control](https://slz-gui.15z7evpngrsf.us-south.codeengine.appdomain.cloud/nacls), [Security Groups](https://slz-gui.15z7evpngrsf.us-south.codeengine.appdomain.cloud/securityGroups), and [Virtual Server Instances](https://slz-gui.15z7evpngrsf.us-south.codeengine.appdomain.cloud/vsi) sections.
63+
6064

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

+25-10
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,25 @@
55

66
In this step, you will be executing a terraform module that automates
77
the creation of the custom landing zone topology defined in the json
8-
file created in the [previous step](./10-customizing.md).
8+
definition created in the [previous step](./10-customizing.md).
99

1010
The objective is to provide a basic terraform module that can be easily
1111
consumed to create the custom VPC topology. See this module as a level
1212
of abstraction simplifying consumption: consumers of the module that we
1313
will create here do not need to understand landing zone, or even the
14-
json file containing the topology definition -- they can "just" run
15-
terraform apply with a minimal number of inputs to get the full custom
14+
json file containing the custom topology definition -- they can "just" run
15+
`terraform apply` with a minimal number of inputs to get the full custom
1616
VPC topology deployed in their account.
1717

1818
## Executing landing-zone with a json definition
1919

2020
The code for this step is located in the [custom-slz](https://github.com/IBM/infra-to-app-with-landing-zone/tree/main/custom-slz) directory. The custom-slz directory contains two
2121
important files:
22-
1. The [override.tftpl](https://github.com/IBM/infra-to-app-with-landing-zone/blob/main/custom-slz/override.tftpl) file -- which is a copy of the json definition for
23-
our custom topology created in the previous step of this lab.
22+
1. The [override.tftpl](https://github.com/IBM/infra-to-app-with-landing-zone/blob/main/custom-slz/override.tftpl) file -- which is a copy of the json definition for our custom topology created in the previous step of this lab.
23+
> In this lab, the file is a template file that contains the json definition, with one small addition: the file contains placeholders `${prefix}` that are replaced by an input variable at runtime to ensure that resource group names are unique in the account using the [templatefile](https://developer.hashicorp.com/terraform/language/functions/templatefile) function. This is necessary to ensure there is no clash in the resource group names from multiple attendees running the lab in the same IBM Cloud account.
2424
2. The [main.tf](https://github.com/IBM/infra-to-app-with-landing-zone/blob/main/custom-slz/main.tf) file which contains the terraform logic calling the landing zone module with the 'right' parameters. The logic is relatively minimal as it mainly delegates the effort to the landing zone module. Two noteworthy aspects:
2525

26-
a. The input named "override_json_string" is set to true. This instructs the landing zone module to look for and use the override.json file in the same directory.
26+
a. The input named `override_json_string` takes the full json definition. In this example, the json passed to the module goes through the templatefile function first to 'inject' the prefix. It is done to ensure uniqueness of the resource group names in the account as indicated in step 1.
2727

2828
b. The source is set to the standard vsi pattern and pointing to the latest version at the time this lab was written (v4.4.4).
2929

@@ -40,7 +40,7 @@ module "landing_zone" {
4040

4141
To run the terraform module on your local environment:
4242

43-
1. Clone the git repository locally with\
43+
1. Clone the git repository locally with
4444
```bash
4545
git clone https://github.com/IBM/infra-to-app-with-landing-zone
4646
```
@@ -56,8 +56,23 @@ To run the terraform module on your local environment:
5656
terraform workspace new lab
5757
```
5858

59-
4. Execute the module with terraform apply.
59+
4. Generate a SSH key pair. This is the key pair that will be used to ssh to the VSIs created by this execution.
60+
```
61+
ssh-keygen -t rsa -b 4096 -N '' -f ./lab2-key-tf
62+
```
63+
64+
5. Export the IBM Cloud API Key that will be used by terraform for the execution. See [instructions](https://cloud.ibm.com/docs/account?topic=account-userapikey&interface=ui)
65+
```
66+
export TF_VAR_ibmcloud_api_key=<your API key>
67+
```
68+
69+
6. Generate a plan. The plan lists of resources that are going to be created.
70+
```bash
71+
terraform plan --var=region=eu-gb -var=ssh-key="$(cat ./lab2-key-tf)" -var=prefix=lab-prefix
72+
```
73+
74+
7. (Optional) Execute the module with terraform apply.
75+
> This step may take up to 15 minutes to complete. We recommend to skip it if you are short on time. The automation will be run through the catalog onboarding in a subsequent step of this lab.
6076
```bash
61-
terraform apply --var=region=eu-gb -var=ssh-key="\$(cat pub
62-
key) -var=prefix=lab-prefix
77+
terraform apply --var=region=eu-gb -var=ssh-key="$(cat ./lab2-key-tf)" -var=prefix=lab-prefix
6378
```

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ In order to implement this automation, we leverage the native terraform
1010
remote resource and invokes a script on that machine.
1111

1212
In this step, we configure the remote-exec provisioner to run a script
13-
that installs Apache server on a worker VSI. The remote-exec provisioner
13+
that installs Apache server all VSIs in the workload VPC ("worker VSIs"). The remote-exec provisioner
1414
is configured to access the worker nodes through our management jump box
15-
that is publicly exposed. The same private ssh key is used in this
16-
example to connect to the jump box and to the worker vsis.
15+
that is publicly exposed through a floating IP. The same private ssh key is used in this
16+
example to connect to the jump box and to the worker VSIs.
1717

1818
![](../images/part-2/media/image21.png)
1919

Diff for: docs/part2/40-catalog-onboarding.md

+6-4
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,17 @@ The end result is a **secure webapp** tile in the IBM Cloud Catalog, that end-us
3232

3333
c. Repository type: **Public repository**
3434

35-
d. Source URL: `https://github.com/IBM/infra-to-app-with-landing-zone/releases/tag/1.0.0`.
35+
d. Source URL: `https://github.com/IBM/infra-to-app-with-landing-zone/releases/tag/1.0.0`.\
3636
:information_source: **Note** This URL is the direct link to the tar.gz asset file located in the [GitHub release page](https://github.com/IBM/infra-to-app-with-landing-zone/releases/tag/1.0.0).
3737

38-
e. Variation: **Standard**.
38+
e. Variation: **Standard**. \
3939
:information_source: **Note**: a Deployable Architecture may have multiple variations the user may choose from. For example, the VSI landing zone deployable architecture has got two variations: "quick start" and "standard". In this lab, our deployable architecture has got only one variation. It is a good practice to name this variation "Standard" - but you are free to input any name in this field.
4040

41-
f. Software Version: **1.0.0**. :information_source: **Note**: this is the version shown in the tile to the end-users in the catalog tile. It can be any string following the [semantic versioning conventions](https://semver.org/) and does not necessarily need to match the version in your source control management system.
41+
f. Software Version: **1.0.0**. \
42+
:information_source: **Note**: this is the version shown in the tile to the end-users in the catalog tile. It can be any string following the [semantic versioning conventions](https://semver.org/) and does not necessarily need to match the version in your source control management system.
4243

43-
g. Category: **Enterprise applications**. :information_source: **Note**: You may select a category that closely matches your deployable rchitecture. The catalog can be filtered by category.
44+
g. Category: **Enterprise applications**. \
45+
:information_source: **Note**: You may select a category that closely matches your deployable rchitecture. The catalog can be filtered by category.
4446

4547
h. Click **Add product**
4648

0 commit comments

Comments
 (0)