Skip to content

Commit

Permalink
Merge pull request #6 from imperva/dev
Browse files Browse the repository at this point in the history
Dev

Former-commit-id: 2a1d310
  • Loading branch information
imperva-admin authored Nov 3, 2022
2 parents a41620d + e537c58 commit 9b75115
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 20 deletions.
2 changes: 1 addition & 1 deletion deploy/installer_machine/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ data "aws_ami" "installer-ami" {

filter {
name = "name"
values = ["RHEL-7.9*"]
values = [var.installer_ami_name_tag]
}

filter {
Expand Down
24 changes: 13 additions & 11 deletions deploy/installer_machine/prepare_installer.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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}"]'
terraform init
terraform apply -auto-approve -var='web_console_cidr=["${web_console_cidr}"]'
8 changes: 7 additions & 1 deletion deploy/installer_machine/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,17 @@ variable "aws_region" {

variable "example_name" {
type = string
default = "deploy/examples/se_demo"
default = "se_demo"
}

variable "web_console_cidr" {
type = string
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
}

2 changes: 1 addition & 1 deletion deploy/modules/sonar_base_instance/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
9 changes: 3 additions & 6 deletions deploy/modules/sonar_base_instance/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
1 change: 1 addition & 0 deletions version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.0.0

0 comments on commit 9b75115

Please sign in to comment.