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 bd9506417..bd7a44adf 100644 --- a/deploy/installer_machine/prepare_installer.tpl +++ b/deploy/installer_machine/prepare_installer.tpl @@ -2,19 +2,21 @@ 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-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" -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 diff --git a/deploy/installer_machine/variables.tf b/deploy/installer_machine/variables.tf index 0b011b621..c59f0ea9e 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" { @@ -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 +} + 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 } 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