From 4b0f89fe8844ee5bfbb4e7e9385e5d895ad760d4 Mon Sep 17 00:00:00 2001 From: Gabi Date: Wed, 2 Nov 2022 14:35:27 +0200 Subject: [PATCH 1/6] add version file Former-commit-id: 92d954cbd539a28618ecfc2e3a092401a14d0267 --- version | 1 + 1 file changed, 1 insertion(+) create mode 100644 version diff --git a/version b/version new file mode 100644 index 000000000..afaf360d3 --- /dev/null +++ b/version @@ -0,0 +1 @@ +1.0.0 \ No newline at end of file From 8d214ee59a9f7c9a22851a7242a03363d1e4b244 Mon Sep 17 00:00:00 2001 From: eytannnaim <80354890+eytannnaim@users.noreply.github.com> Date: Wed, 2 Nov 2022 14:38:49 +0200 Subject: [PATCH 2/6] Set base os to rhel8 (#5) * Setting base os to rhel8 * Update main.tf Former-commit-id: feb881218bb1b69193ae8fec9fb36958b0098fef --- deploy/modules/sonar_base_instance/main.tf | 2 +- deploy/modules/sonar_base_instance/variables.tf | 9 +++------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/deploy/modules/sonar_base_instance/main.tf b/deploy/modules/sonar_base_instance/main.tf index 7707eca93..1ecd41015 100644 --- a/deploy/modules/sonar_base_instance/main.tf +++ b/deploy/modules/sonar_base_instance/main.tf @@ -17,7 +17,7 @@ data "aws_ami" "redhat-7-ami" { filter { name = "name" - values = ["RHEL-7.9*"] + values = [var.dsf_base_ami_name_tag] } filter { diff --git a/deploy/modules/sonar_base_instance/variables.tf b/deploy/modules/sonar_base_instance/variables.tf index 314b2509a..826672d0f 100644 --- a/deploy/modules/sonar_base_instance/variables.tf +++ b/deploy/modules/sonar_base_instance/variables.tf @@ -46,10 +46,7 @@ variable "iam_instance_profile_id" { description = "DSF base ec2 IAM instance profile id" } -variable "dsf_base_amis_id" { - type = map(any) - default = { - us-east-1 = "ami-064196ba51ee65773" - eu-west-2 = "ami-03a6c38b3c0aa74f9" - } +variable "dsf_base_ami_name_tag" { + type = string + default = "RHEL-8.6.0_HVM-20220503-x86_64-2-Hourly2-GP2" # Exists on all regions } From 7b532994b820596ed39bc431a1828288d4361b64 Mon Sep 17 00:00:00 2001 From: Gabi Date: Wed, 2 Nov 2022 15:59:38 +0200 Subject: [PATCH 3/6] enable out init + plly for installer Former-commit-id: 7c49ddce61fe649c0c5fa0d6a0cdbb1ea21dab4f --- .../installer_machine/prepare_installer.tpl | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/deploy/installer_machine/prepare_installer.tpl b/deploy/installer_machine/prepare_installer.tpl index bd9506417..458284f5b 100644 --- a/deploy/installer_machine/prepare_installer.tpl +++ b/deploy/installer_machine/prepare_installer.tpl @@ -2,19 +2,20 @@ exec > >(tee /var/log/user-data.log|logger -t user-data -s 2>/dev/console) 2>&1 set -e -sudo yum -y install git +sudo su +yum -y install git -sudo yum install -y yum-utils -sudo yum-config-manager --add-repo https://rpm.releases.hashicorp.com/RHEL/hashicorp.repo -sudo yum -y install terraform -sudo yum -y install java +yum install -y yum-utils +yum-config-manager --add-repo https://rpm.releases.hashicorp.com/RHEL/hashicorp.repo +yum -y install terraform +yum -y install java -sudo git clone https://github.com/imperva/dsfkit.git +git clone https://github.com/imperva/dsfkit.git cd /dsfkit/deploy/examples/${example_name} -# export AWS_ACCESS_KEY_ID=${access_key} -# export AWS_SECRET_ACCESS_KEY=${secret_key} -# export AWS_REGION=${region} +export AWS_ACCESS_KEY_ID=${access_key} +export AWS_SECRET_ACCESS_KEY=${secret_key} +export AWS_REGION=${region} -# sudo terraform init -# sudo terraform apply -auto-approve -var='web_console_cidr=["${web_console_cidr}"]' \ No newline at end of file +terraform init +terraform apply -auto-approve -var='web_console_cidr=["${web_console_cidr}"]' \ No newline at end of file From 6cf3266de43c74ce8f212f83da89fdc972188c1b Mon Sep 17 00:00:00 2001 From: Gabi Date: Wed, 2 Nov 2022 19:02:54 +0200 Subject: [PATCH 4/6] fix wrong example name Former-commit-id: c1e563250f0217410e7f25acec167ef594a29fc3 --- deploy/installer_machine/variables.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deploy/installer_machine/variables.tf b/deploy/installer_machine/variables.tf index 0b011b621..486146af1 100644 --- a/deploy/installer_machine/variables.tf +++ b/deploy/installer_machine/variables.tf @@ -19,7 +19,7 @@ variable "aws_region" { variable "example_name" { type = string - default = "deploy/examples/se_demo" + default = "se_demo" } variable "web_console_cidr" { From 600e067cb3cbd0f436af0ec9e6d2585ea729fe00 Mon Sep 17 00:00:00 2001 From: Gabi Date: Wed, 2 Nov 2022 20:50:20 +0200 Subject: [PATCH 5/6] fix java ver Former-commit-id: 394f465b505db446fc82f9b305ce84e3548584d8 --- deploy/installer_machine/prepare_installer.tpl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/deploy/installer_machine/prepare_installer.tpl b/deploy/installer_machine/prepare_installer.tpl index 458284f5b..548c3519a 100644 --- a/deploy/installer_machine/prepare_installer.tpl +++ b/deploy/installer_machine/prepare_installer.tpl @@ -8,7 +8,8 @@ yum -y install git yum install -y yum-utils yum-config-manager --add-repo https://rpm.releases.hashicorp.com/RHEL/hashicorp.repo yum -y install terraform -yum -y install java +yum -y install java-11-openjdk-devel +export JAVA_HOME="/usr/lib/jvm/java-11-openjdk-11.0.17.0.8-2.el7_9.x86_64/bin/java" git clone https://github.com/imperva/dsfkit.git cd /dsfkit/deploy/examples/${example_name} From e537c581b5b7f884b7534775f3c3e048813c1711 Mon Sep 17 00:00:00 2001 From: Gabi Date: Thu, 3 Nov 2022 08:19:48 +0200 Subject: [PATCH 6/6] make installer machine use the same RHET version as CLI Mode + choose specific java version Former-commit-id: 2486a6ac35b18187320871b84ffd542d160c58a0 --- deploy/installer_machine/main.tf | 2 +- deploy/installer_machine/prepare_installer.tpl | 2 +- deploy/installer_machine/variables.tf | 6 ++++++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/deploy/installer_machine/main.tf b/deploy/installer_machine/main.tf index 8c8cc617b..d91a659fa 100644 --- a/deploy/installer_machine/main.tf +++ b/deploy/installer_machine/main.tf @@ -66,7 +66,7 @@ data "aws_ami" "installer-ami" { filter { name = "name" - values = ["RHEL-7.9*"] + values = [var.installer_ami_name_tag] } filter { diff --git a/deploy/installer_machine/prepare_installer.tpl b/deploy/installer_machine/prepare_installer.tpl index 548c3519a..bd7a44adf 100644 --- a/deploy/installer_machine/prepare_installer.tpl +++ b/deploy/installer_machine/prepare_installer.tpl @@ -8,7 +8,7 @@ yum -y install git yum install -y yum-utils yum-config-manager --add-repo https://rpm.releases.hashicorp.com/RHEL/hashicorp.repo yum -y install terraform -yum -y install java-11-openjdk-devel +yum -y install java-11-openjdk-devel-11.0.17.0.8-2.el8_6 export JAVA_HOME="/usr/lib/jvm/java-11-openjdk-11.0.17.0.8-2.el7_9.x86_64/bin/java" git clone https://github.com/imperva/dsfkit.git diff --git a/deploy/installer_machine/variables.tf b/deploy/installer_machine/variables.tf index 486146af1..c59f0ea9e 100644 --- a/deploy/installer_machine/variables.tf +++ b/deploy/installer_machine/variables.tf @@ -27,3 +27,9 @@ variable "web_console_cidr" { default = null } + +variable "installer_ami_name_tag" { + type = string + default = "RHEL-8.6.0_HVM-20220503-x86_64-2-Hourly2-GP2" # Exists on all regions +} +