Skip to content

Commit fe5c051

Browse files
authored
Merge pull request #77 from Sashwat-K/HPVM-2748
chore: update all examples from LogDNA to ICL
2 parents acca471 + 0f27676 commit fe5c051

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+245
-370
lines changed

terraform-hpvs/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
1. Make sure to have the [OpenSSL](https://www.openssl.org/) binary installed (see [details](#openssl))
66
2. Install the [terraform CLI](https://learn.hashicorp.com/tutorials/terraform/install-cli) for your environment
77
3. Follow the description for the [IBM Cloud Provider](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs#authentication) to get your API key
8-
4. Follow the description for [HPCR](https://cloud.ibm.com/docs/vpc?topic=vpc-about-se#hpcr_setup_logging) to setup a logging instance.
8+
4. Follow the description for [HPCR](https://cloud.ibm.com/docs/vpc?topic=vpc-logging-for-hyper-protect-virtual-servers-for-vpc) to setup a logging instance.
99
5. Set either environment variables or fill the template file according to the example README
1010

1111
## Examples

terraform-hpvs/attestation/README.md

Lines changed: 4 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ This sample deploys the [attestation](https://hub.docker.com/_/attestation) exam
44

55
### Prerequisite
66

7-
Prepare your environment according to [these steps](../README.md)
7+
Prepare your environment according to [these steps](../README.md). Make sure to setup IBM Cloud Logs Instance.
88

99
### Settings
1010

@@ -23,8 +23,8 @@ Set the following environment variables:
2323
IC_API_KEY=
2424
TF_VAR_zone=
2525
TF_VAR_region=
26-
TF_VAR_logdna_ingestion_key=
27-
TF_VAR_logdna_ingestion_hostname=
26+
TF_VAR_icl_iam_apikey=
27+
TF_VAR_icl_hostname=
2828
```
2929

3030
### Run the Example
@@ -41,32 +41,7 @@ Deploy the example:
4141
terraform apply
4242
```
4343

44-
This will create a sample virtual server instance. Monitor your logDNA instance for
45-
46-
```text
47-
hpcr-sample-attestation-vsi compose-helloworld-1 info
48-
hpcr-sample-attestation-vsi compose-helloworld-1 info Hello from Docker!
49-
hpcr-sample-attestation-vsi compose-helloworld-1 info This message shows that your installation appears to be working correctly.
50-
hpcr-sample-attestation-vsi compose-helloworld-1 info
51-
hpcr-sample-attestation-vsi compose-helloworld-1 info To generate this message, Docker took the following steps:
52-
hpcr-sample-attestation-vsi compose-helloworld-1 info 1. The Docker client contacted the Docker daemon.
53-
hpcr-sample-attestation-vsi compose-helloworld-1 info 2. The Docker daemon pulled the "attestation" image from the Docker Hub.
54-
hpcr-sample-attestation-vsi compose-helloworld-1 info (s390x)
55-
hpcr-sample-attestation-vsi compose-helloworld-1 info 3. The Docker daemon created a new container from that image which runs the
56-
hpcr-sample-attestation-vsi compose-helloworld-1 info executable that produces the output you are currently reading.
57-
hpcr-sample-attestation-vsi compose-helloworld-1 info 4. The Docker daemon streamed that output to the Docker client, which sent it
58-
hpcr-sample-attestation-vsi compose-helloworld-1 info to your terminal.
59-
hpcr-sample-attestation-vsi compose-helloworld-1 info
60-
hpcr-sample-attestation-vsi compose-helloworld-1 info To try something more ambitious, you can run an Ubuntu container with:
61-
hpcr-sample-attestation-vsi compose-helloworld-1 info $ docker run -it ubuntu bash
62-
hpcr-sample-attestation-vsi compose-helloworld-1 info
63-
hpcr-sample-attestation-vsi compose-helloworld-1 info Share images, automate workflows, and more with a free Docker ID:
64-
hpcr-sample-attestation-vsi compose-helloworld-1 info https://hub.docker.com/
65-
hpcr-sample-attestation-vsi compose-helloworld-1 info
66-
hpcr-sample-attestation-vsi compose-helloworld-1 info For more examples and ideas, visit:
67-
hpcr-sample-attestation-vsi compose-helloworld-1 info https://docs.docker.com/get-started/
68-
hpcr-sample-attestation-vsi compose-helloworld-1 info
69-
```
44+
This will create a sample virtual server instance. Monitor your ICL instance for logs.
7045

7146
Destroy the created resources:
7247

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
ibmcloud_api_key="Your IBM Cloud API key"
22
region="ca-tor" # Region to deploy to. Options include eu-gb, jp-tok, br-sao, ca-tor, us-east
33
zone="2" # Zone within region to create the HPVS into.
4-
logdna_ingestion_key="Your LogDNA ingestion key" # You can find this in "Linux/ubuntu" section of `Logging sources` tab of "IBM Log Analysis" instance in [cloud.ibm.com](https://cloud.ibm.com)
5-
logdna_ingestion_hostname="rsyslog endpoint of IBM Log Analysis instance"
6-
# Example: "syslog-a.<log_region>.logging.cloud.ibm.com". Where <log_region> is
7-
# the region on which IBM Log Analysis is deployed
8-
# Any other variable you want to set (see variables.tf)
4+
icl_hostname="Your ICL hostname"
5+
icl_iam_apikey="Your IBM Cloud API key"

terraform-hpvs/attestation/terraform.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,9 @@ locals {
122122
"env" : {
123123
"type" : "env",
124124
"logging" : {
125-
"logDNA" : {
126-
"ingestionKey" : var.logdna_ingestion_key,
127-
"hostname" : var.logdna_ingestion_hostname,
125+
"logRouter" : {
126+
"hostname" : var.icl_hostname,
127+
"iamApiKey" : var.icl_iam_apikey,
128128
}
129129
},
130130
"env" : {

terraform-hpvs/attestation/variables.tf

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,23 +33,19 @@ variable "zone" {
3333
}
3434
}
3535

36-
variable "logdna_ingestion_key" {
36+
variable "icl_hostname" {
3737
type = string
38-
sensitive = true
3938
description = <<-DESC
40-
Ingestion key for IBM Log Analysis instance. This can be
41-
obtained from "Linux/Ubuntu" section of "Logging resource"
42-
tab of IBM Log Analysis instance
39+
Host of IBM Cloud Logs. This can be
40+
obtained from cloud logs tab under Logging instances
4341
DESC
4442
}
4543

46-
variable "logdna_ingestion_hostname" {
44+
variable "icl_iam_apikey" {
4745
type = string
46+
sensitive = true
4847
description = <<-DESC
49-
rsyslog endpoint of IBM Log Analysis instance.
50-
Don't include the port. Example:
51-
syslog-a.<log_region>.logging.cloud.ibm.com
52-
log_region is the region where IBM Log Analysis is deployed
48+
This can be obtained from Access(IAM) under Manage
5349
DESC
5450
}
5551

terraform-hpvs/contract-expiry/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ the latest version of HPCR in the VPC cloud and then downloads the matching encr
55

66
### Prerequisite
77

8-
Prepare your environment according to [these steps](../README.md)
8+
Prepare your environment according to [these steps](../README.md). Make sure to setup IBM Cloud Logs Instance.
99

1010
### Settings
1111

@@ -39,8 +39,8 @@ Use one of the following options to set your settings:
3939
Set the following environment variables:
4040

4141
```text
42-
TF_VAR_logdna_ingestion_key="<logdna ingestion key>"
43-
TF_VAR_logdna_ingestion_hostname="<logdna hostname>"
42+
TF_VAR_icl_iam_apikey="<ICL IAM Key>"
43+
TF_VAR_icl_hostname="<ICL Hostname>"
4444
4545
TF_VAR_hpcr_csr_country="<CSR - Country>"
4646
TF_VAR_hpcr_csr_state="<CSR - State>"

terraform-hpvs/contract-expiry/my-settings.auto.tfvars-template

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
logdna_ingestion_key="<logdna-ingestion-key>"
2-
logdna_ingestion_hostname="<logdna-hostname>"
1+
icl_hostname="<ICL hostname>"
2+
icl_iam_apikey="<IBM Cloud API key>"
33

44
hpcr_csr_country="<CSR - Country>"
55
hpcr_csr_state="<CSR - State>"

terraform-hpvs/contract-expiry/terraform.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ locals {
1717
"env" : {
1818
"type" : "env",
1919
"logging" : {
20-
"logDNA" : {
21-
"ingestionKey" : var.logdna_ingestion_key,
22-
"hostname" : var.logdna_ingestion_hostname,
20+
"logRouter" : {
21+
"hostname" : var.icl_hostname,
22+
"iamApiKey" : var.icl_iam_apikey,
2323
},
2424
},
2525
},

terraform-hpvs/contract-expiry/variables.tf

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -53,22 +53,18 @@ variable "hpcr_contract_expiry_days" {
5353
description = "Number of days for contract to expire"
5454
}
5555

56-
variable "logdna_ingestion_key" {
56+
variable "icl_hostname" {
5757
type = string
58-
sensitive = true
5958
description = <<-DESC
60-
Ingestion key for IBM Log Analysis instance. This can be
61-
obtained from "Linux/Ubuntu" section of "Logging resource"
62-
tab of IBM Log Analysis instance
59+
Host of IBM Cloud Logs. This can be
60+
obtained from cloud logs tab under Logging instances
6361
DESC
6462
}
6563

66-
variable "logdna_ingestion_hostname" {
64+
variable "icl_iam_apikey" {
6765
type = string
66+
sensitive = true
6867
description = <<-DESC
69-
rsyslog endpoint of IBM Log Analysis instance.
70-
Don't include the port. Example:
71-
syslog-a.<log_region>.logging.cloud.ibm.com
72-
log_region is the region where IBM Log Analysis is deployed
68+
This can be obtained from Access(IAM) under Manage
7369
DESC
7470
}

terraform-hpvs/create-contract-download-encryption/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ the latest version of HPCR in the VPC cloud and then downloads the matching encr
55

66
### Prerequisite
77

8-
Prepare your environment according to [these steps](../README.md)
8+
Prepare your environment according to [these steps](../README.md). Make sure to setup IBM Cloud Logs Instance.
99

1010
### Settings
1111

@@ -21,8 +21,8 @@ Use one of the following options to set you settings:
2121
Set the following environment variables:
2222

2323
```text
24-
TF_VAR_logdna_ingestion_key=
25-
TF_VAR_logdna_ingestion_hostname=
24+
TF_VAR_icl_iam_apikey=
25+
TF_VAR_icl_hostname=
2626
```
2727

2828
### Run the Example

0 commit comments

Comments
 (0)