From 539f400dc37e4ed3f278217e7ae3ea9b84e54715 Mon Sep 17 00:00:00 2001 From: "segev.elmalech" Date: Tue, 10 Jan 2023 10:01:49 +0200 Subject: [PATCH 01/18] Change demo output key Add matrix - first try --- .../workflows/terraform_apply_simple_cli.yml | 23 ++++- .github/workflows/terraform_run_test.yml | 89 +++++++++++-------- deploy/examples/se_demo/outputs.tf | 2 +- 3 files changed, 74 insertions(+), 40 deletions(-) diff --git a/.github/workflows/terraform_apply_simple_cli.yml b/.github/workflows/terraform_apply_simple_cli.yml index 0c2844255..3b938f67f 100644 --- a/.github/workflows/terraform_apply_simple_cli.yml +++ b/.github/workflows/terraform_apply_simple_cli.yml @@ -1,4 +1,4 @@ -name: 'Terraform Apply Cli (simple)' +name: 'Terraform Apply Cli' on: workflow_dispatch: {} @@ -30,8 +30,25 @@ permissions: jobs: terraform: - name: 'Terraform' + + matrix: + workspace: [simple_cli, hadr_cli] + example_dir: [] + aws_region: [] + include: + - workspace: simple_cli + example_dir: ./deploy/examples/se_demo + aws_region: eu-west-2 + - workspace: hadr_cli + example_dir: ./deploy/examples/se_demo_hadr + aws_region: eu-west-1 + + name: 'Terraform ${{ matrix.workspace }}' runs-on: ubuntu-latest + env: + EXAMPLE_DIR: ${{ matrix.example_dir }} + TF_WORKSPACE: ${{ matrix.workspace }} + AWS_REGION: ${{ matrix.aws_region }} environment: test # Use the Bash shell regardless whether the GitHub Actions runner is ubuntu-latest, macos-latest, or windows-latest @@ -107,7 +124,7 @@ jobs: - name: Set Environment Variables run: | - echo hub_ip=$(terraform -chdir=$EXAMPLE_DIR output -json | jq -r '.dsf_hubs.value.primary_hub.public_address') >> $GITHUB_ENV + echo hub_ip=$(terraform -chdir=$EXAMPLE_DIR output -json | jq -r '.dsf_hubs.value.primary.public_address') >> $GITHUB_ENV echo gw_ip=$(terraform -chdir=$EXAMPLE_DIR output -json | jq -r '.dsf_agentless_gw_group.value."gw-0".private_address') >> $GITHUB_ENV echo dsf_ssh_key_file_name=$EXAMPLE_DIR/$(terraform -chdir=$EXAMPLE_DIR output -json | jq -r '.dsf_private_ssh_key_file_name.value') >> $GITHUB_ENV diff --git a/.github/workflows/terraform_run_test.yml b/.github/workflows/terraform_run_test.yml index 185ec9674..0e6c22852 100644 --- a/.github/workflows/terraform_run_test.yml +++ b/.github/workflows/terraform_run_test.yml @@ -22,8 +22,25 @@ permissions: jobs: terraform: - name: 'Terraform' + + matrix: + workspace: [simple_cli, hadr_cli] + example_dir: [] + aws_region: [] + include: + - workspace: simple_cli + example_dir: ./deploy/examples/se_demo + aws_region: eu-west-2 + - workspace: hadr_cli + example_dir: ./deploy/examples/se_demo_hadr + aws_region: eu-west-1 + + name: 'Terraform ${{ matrix.workspace }}' runs-on: ubuntu-latest + env: + EXAMPLE_DIR: ${{ matrix.example_dir }} + TF_WORKSPACE: ${{ matrix.workspace }} + AWS_REGION: ${{ matrix.aws_region }} environment: test # Use the Bash shell regardless whether the GitHub Actions runner is ubuntu-latest, macos-latest, or windows-latest @@ -51,33 +68,33 @@ jobs: echo 1. new_var is ${{ env.new_var }} # Send job failure to Slack - - name: Send Slack by action-slack - uses: 8398a7/action-slack@v3 - with: - status: ${{ job.status }} - fields: message,author,action,eventName,ref,workflow,job,pullRequest - env: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL_TEST }} - if: ${{ failure() }} - - - name: Slack Notification - Slack Notify - uses: rtCamp/action-slack-notify@v2 - env: - SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL_TEST }} - if: ${{ failure() }} - - - name: Send GitHub Action trigger data to Slack workflow - id: slack - uses: slackapi/slack-github-action@v1.23.0 - with: - payload: | - { - "key": "value", - "foo": "bar" - } - env: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL_TEST }} - if: ${{ always() }} + # - name: Send Slack by action-slack + # uses: 8398a7/action-slack@v3 + # with: + # status: ${{ job.status }} + # fields: message,author,action,eventName,ref,workflow,job,pullRequest + # env: + # SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL_TEST }} + # if: ${{ failure() }} + + # - name: Slack Notification - Slack Notify + # uses: rtCamp/action-slack-notify@v2 + # env: + # SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL_TEST }} + # if: ${{ failure() }} + + # - name: Send GitHub Action trigger data to Slack workflow + # id: slack + # uses: slackapi/slack-github-action@v1.23.0 + # with: + # payload: | + # { + # "key": "value", + # "foo": "bar" + # } + # env: + # SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL_TEST }} + # if: ${{ always() }} # - name: Sets env vars for environment # run: | @@ -99,15 +116,15 @@ jobs: # Install the latest version of Terraform CLI and configure the Terraform CLI configuration file with a Terraform Cloud user API token - # - name: Setup Terraform - # uses: hashicorp/setup-terraform@v1 - # with: - # terraform_wrapper: false + - name: Setup Terraform + uses: hashicorp/setup-terraform@v1 + with: + terraform_wrapper: false - # - name: Setup jq - # uses: sergeysova/jq-action@v2 - # with: - # cmd: jq -n env + - name: Setup jq + uses: sergeysova/jq-action@v2 + with: + cmd: jq -n env # Initialize a new or existing Terraform working directory by creating initial files, loading any remote state, downloading modules, etc. # - name: Terraform Init diff --git a/deploy/examples/se_demo/outputs.tf b/deploy/examples/se_demo/outputs.tf index bcc978325..3d9b512b4 100644 --- a/deploy/examples/se_demo/outputs.tf +++ b/deploy/examples/se_demo/outputs.tf @@ -13,7 +13,7 @@ output "dsf_agentless_gw_group" { output "dsf_hubs" { value = { - primary_hub = { + primary = { public_address = try(module.hub.public_address, null) private_address = try(module.hub.private_address, null) jsonar_uid = try(module.hub.jsonar_uid, null) From ce2df7d44c45a4faa3f9d3fdc19c31fbb33a93b6 Mon Sep 17 00:00:00 2001 From: "segev.elmalech" Date: Tue, 10 Jan 2023 10:05:30 +0200 Subject: [PATCH 02/18] fix env --- .github/workflows/terraform_apply_simple_cli.yml | 8 ++++---- .github/workflows/terraform_run_test.yml | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/terraform_apply_simple_cli.yml b/.github/workflows/terraform_apply_simple_cli.yml index 3b938f67f..14aa7eb53 100644 --- a/.github/workflows/terraform_apply_simple_cli.yml +++ b/.github/workflows/terraform_apply_simple_cli.yml @@ -45,10 +45,10 @@ jobs: name: 'Terraform ${{ matrix.workspace }}' runs-on: ubuntu-latest - env: - EXAMPLE_DIR: ${{ matrix.example_dir }} - TF_WORKSPACE: ${{ matrix.workspace }} - AWS_REGION: ${{ matrix.aws_region }} + env: + EXAMPLE_DIR: ${{ matrix.example_dir }} + TF_WORKSPACE: ${{ matrix.workspace }} + AWS_REGION: ${{ matrix.aws_region }} environment: test # Use the Bash shell regardless whether the GitHub Actions runner is ubuntu-latest, macos-latest, or windows-latest diff --git a/.github/workflows/terraform_run_test.yml b/.github/workflows/terraform_run_test.yml index 0e6c22852..eb7d6feef 100644 --- a/.github/workflows/terraform_run_test.yml +++ b/.github/workflows/terraform_run_test.yml @@ -37,10 +37,10 @@ jobs: name: 'Terraform ${{ matrix.workspace }}' runs-on: ubuntu-latest - env: - EXAMPLE_DIR: ${{ matrix.example_dir }} - TF_WORKSPACE: ${{ matrix.workspace }} - AWS_REGION: ${{ matrix.aws_region }} + env: + EXAMPLE_DIR: ${{ matrix.example_dir }} + TF_WORKSPACE: ${{ matrix.workspace }} + AWS_REGION: ${{ matrix.aws_region }} environment: test # Use the Bash shell regardless whether the GitHub Actions runner is ubuntu-latest, macos-latest, or windows-latest From 16da9e3b7b0842057c2659b7d2b154ca5049fdad Mon Sep 17 00:00:00 2001 From: "segev.elmalech" Date: Tue, 10 Jan 2023 10:13:25 +0200 Subject: [PATCH 03/18] Add strategy --- .github/workflows/terraform_run_test.yml | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/.github/workflows/terraform_run_test.yml b/.github/workflows/terraform_run_test.yml index eb7d6feef..f83ea9239 100644 --- a/.github/workflows/terraform_run_test.yml +++ b/.github/workflows/terraform_run_test.yml @@ -23,17 +23,18 @@ permissions: jobs: terraform: - matrix: - workspace: [simple_cli, hadr_cli] - example_dir: [] - aws_region: [] - include: - - workspace: simple_cli - example_dir: ./deploy/examples/se_demo - aws_region: eu-west-2 - - workspace: hadr_cli - example_dir: ./deploy/examples/se_demo_hadr - aws_region: eu-west-1 + strategy: + matrix: + workspace: [simple_cli, hadr_cli] + example_dir: [] + aws_region: [] + include: + - workspace: simple_cli + example_dir: ./deploy/examples/se_demo + aws_region: eu-west-2 + - workspace: hadr_cli + example_dir: ./deploy/examples/se_demo_hadr + aws_region: eu-west-1 name: 'Terraform ${{ matrix.workspace }}' runs-on: ubuntu-latest From 27d37ae76ebac4e1b492d9c461e60aa026eec380 Mon Sep 17 00:00:00 2001 From: "segev.elmalech" Date: Tue, 10 Jan 2023 10:14:06 +0200 Subject: [PATCH 04/18] Add strategy --- .../workflows/terraform_apply_simple_cli.yml | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/.github/workflows/terraform_apply_simple_cli.yml b/.github/workflows/terraform_apply_simple_cli.yml index 14aa7eb53..41801181a 100644 --- a/.github/workflows/terraform_apply_simple_cli.yml +++ b/.github/workflows/terraform_apply_simple_cli.yml @@ -31,17 +31,18 @@ permissions: jobs: terraform: - matrix: - workspace: [simple_cli, hadr_cli] - example_dir: [] - aws_region: [] - include: - - workspace: simple_cli - example_dir: ./deploy/examples/se_demo - aws_region: eu-west-2 - - workspace: hadr_cli - example_dir: ./deploy/examples/se_demo_hadr - aws_region: eu-west-1 + strategy: + matrix: + workspace: [simple_cli, hadr_cli] + example_dir: [] + aws_region: [] + include: + - workspace: simple_cli + example_dir: ./deploy/examples/se_demo + aws_region: eu-west-2 + - workspace: hadr_cli + example_dir: ./deploy/examples/se_demo_hadr + aws_region: eu-west-1 name: 'Terraform ${{ matrix.workspace }}' runs-on: ubuntu-latest From 0f08dc98d8aecc639f9ddea7e248e84ef0be7cb4 Mon Sep 17 00:00:00 2001 From: "segev.elmalech" Date: Tue, 10 Jan 2023 10:16:11 +0200 Subject: [PATCH 05/18] Add matrix params --- .github/workflows/terraform_apply_simple_cli.yml | 4 ++-- .github/workflows/terraform_run_test.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/terraform_apply_simple_cli.yml b/.github/workflows/terraform_apply_simple_cli.yml index 41801181a..d00956626 100644 --- a/.github/workflows/terraform_apply_simple_cli.yml +++ b/.github/workflows/terraform_apply_simple_cli.yml @@ -34,8 +34,8 @@ jobs: strategy: matrix: workspace: [simple_cli, hadr_cli] - example_dir: [] - aws_region: [] + example_dir: [./deploy/examples/se_demo, ./deploy/examples/se_demo_hadr] + aws_region: [eu-west-1, eu-west-2] include: - workspace: simple_cli example_dir: ./deploy/examples/se_demo diff --git a/.github/workflows/terraform_run_test.yml b/.github/workflows/terraform_run_test.yml index f83ea9239..50154dcfa 100644 --- a/.github/workflows/terraform_run_test.yml +++ b/.github/workflows/terraform_run_test.yml @@ -26,8 +26,8 @@ jobs: strategy: matrix: workspace: [simple_cli, hadr_cli] - example_dir: [] - aws_region: [] + example_dir: [./deploy/examples/se_demo, ./deploy/examples/se_demo_hadr] + aws_region: [eu-west-1, eu-west-2] include: - workspace: simple_cli example_dir: ./deploy/examples/se_demo From e500bb3bd211b590f18186d1ce4b430fff9b7366 Mon Sep 17 00:00:00 2001 From: "segev.elmalech" Date: Tue, 10 Jan 2023 10:25:56 +0200 Subject: [PATCH 06/18] improve the matrix --- .github/workflows/terraform_run_test.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/terraform_run_test.yml b/.github/workflows/terraform_run_test.yml index 50154dcfa..65833fa4e 100644 --- a/.github/workflows/terraform_run_test.yml +++ b/.github/workflows/terraform_run_test.yml @@ -25,9 +25,9 @@ jobs: strategy: matrix: - workspace: [simple_cli, hadr_cli] - example_dir: [./deploy/examples/se_demo, ./deploy/examples/se_demo_hadr] - aws_region: [eu-west-1, eu-west-2] + workspace: [simple_cli] + # example_dir: [./deploy/examples/se_demo] + # aws_region: [eu-west-2] include: - workspace: simple_cli example_dir: ./deploy/examples/se_demo From d5d27750e7b041a6bc40c235cc6077fbca60965e Mon Sep 17 00:00:00 2001 From: "segev.elmalech" Date: Tue, 10 Jan 2023 10:27:54 +0200 Subject: [PATCH 07/18] improve the matrix --- .github/workflows/terraform_apply_simple_cli.yml | 4 +--- .github/workflows/terraform_run_test.yml | 2 -- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/terraform_apply_simple_cli.yml b/.github/workflows/terraform_apply_simple_cli.yml index d00956626..e80726a37 100644 --- a/.github/workflows/terraform_apply_simple_cli.yml +++ b/.github/workflows/terraform_apply_simple_cli.yml @@ -33,9 +33,7 @@ jobs: strategy: matrix: - workspace: [simple_cli, hadr_cli] - example_dir: [./deploy/examples/se_demo, ./deploy/examples/se_demo_hadr] - aws_region: [eu-west-1, eu-west-2] + workspace: [simple_cli] include: - workspace: simple_cli example_dir: ./deploy/examples/se_demo diff --git a/.github/workflows/terraform_run_test.yml b/.github/workflows/terraform_run_test.yml index 65833fa4e..02cd03a37 100644 --- a/.github/workflows/terraform_run_test.yml +++ b/.github/workflows/terraform_run_test.yml @@ -26,8 +26,6 @@ jobs: strategy: matrix: workspace: [simple_cli] - # example_dir: [./deploy/examples/se_demo] - # aws_region: [eu-west-2] include: - workspace: simple_cli example_dir: ./deploy/examples/se_demo From 4cbcffa001259567be8e783ad52975792dc028bc Mon Sep 17 00:00:00 2001 From: "segev.elmalech" Date: Tue, 10 Jan 2023 13:32:19 +0200 Subject: [PATCH 08/18] delete hadr cli yml --- .../workflows/terraform_apply_hadr_cli.yml | 140 ------------------ 1 file changed, 140 deletions(-) delete mode 100644 .github/workflows/terraform_apply_hadr_cli.yml diff --git a/.github/workflows/terraform_apply_hadr_cli.yml b/.github/workflows/terraform_apply_hadr_cli.yml deleted file mode 100644 index d16ec7336..000000000 --- a/.github/workflows/terraform_apply_hadr_cli.yml +++ /dev/null @@ -1,140 +0,0 @@ -name: 'Terraform Apply Cli (hadr)' - -on: - workflow_dispatch: {} - push: - branches: - - 'master' - - 'dev' - pull_request: - types: - - 'opened' - - 'reopened' - branches: - - 'master' - - 'dev' - -env: - TF_WARN_OUTPUT_ERRORS: 1 - TF_CLI_ARGS: "-no-color" - TF_INPUT: 0 - TF_VAR_gw_count: 2 - EXAMPLE_DIR: ./deploy/examples/se_demo_hadr - TF_WORKSPACE: hadr_cli - AWS_REGION: eu-west-1 - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - -permissions: - contents: read - -jobs: - terraform: - name: 'Terraform' - runs-on: ubuntu-latest - environment: test - - # Use the Bash shell regardless whether the GitHub Actions runner is ubuntu-latest, macos-latest, or windows-latest - defaults: - run: - shell: bash - steps: - # Checkout the repository to the GitHub Actions runner - - name: Checkout - uses: actions/checkout@v3 - - - name: Change the modules source to local - run: | - find . -type f -exec sed -i 's/source *= \"github.com\/imperva\/dsfkit\//source = \"..\/..\/../' {} \; - ! grep -rnw '.' -e 'github\.com/imperva/dsfkit//deploy/modules' - - - name: Sets env vars for environment - run: | - echo "TF_VAR_tarball_s3_bucket=0ed58e18-0c0c-11ed-861d-0242ac120003" >> $GITHUB_ENV - if: github.ref != 'refs/heads/"master"' - - - name: Create terraform backend file - run: | - cat << EOF > $EXAMPLE_DIR/backend.tf - terraform { - backend "s3" { - bucket = "terraform-state-bucket-dsfkit-github-tests" - key = "states/terraform.tfstate" - dynamodb_table = "terraform-state-lock" - region = "us-east-1" - } - } - EOF - - # Install the latest version of Terraform CLI and configure the Terraform CLI configuration file with a Terraform Cloud user API token - - name: Setup Terraform - uses: hashicorp/setup-terraform@v1 - with: - terraform_wrapper: false - - - name: Setup jq - uses: sergeysova/jq-action@v2 - with: - cmd: jq -n env - - # Initialize a new or existing Terraform working directory by creating initial files, loading any remote state, downloading modules, etc. - - name: Terraform Init - run: terraform -chdir=$EXAMPLE_DIR init - - - name: Terraform Validate - run: terraform -chdir=$EXAMPLE_DIR validate - - # Generates an execution plan for Terraform - - name: Terraform Plan - run: terraform -chdir=$EXAMPLE_DIR plan -lock-timeout=1800s - - - name: Cleaning envrionment - run: | - mv $EXAMPLE_DIR/main.tf{,_} - mv $EXAMPLE_DIR/outputs.tf{,_} - terraform -chdir=$EXAMPLE_DIR destroy -auto-approve -lock-timeout=1800s - mv $EXAMPLE_DIR/main.tf{_,} - mv $EXAMPLE_DIR/outputs.tf{_,} - - # On push to "main", build or change infrastructure according to Terraform configuration files - # Note: It is recommended to set up a required "strict" status check in your repository for "Terraform Cloud". See the documentation on "strict" required status checks for more information: https://help.github.com/en/github/administering-a-repository/types-of-required-status-checks - - name: Terraform Apply - # if: github.ref == 'refs/heads/"master"' && github.event_name == 'push' || github.event_name == 'workflow_dispatch' - run: terraform -chdir=$EXAMPLE_DIR apply -auto-approve -lock-timeout=1800s - - - name: Terraform Output - run: terraform -chdir=$EXAMPLE_DIR output -json - - - name: Set Environment Variables - run: | - echo hub_ip=$(terraform -chdir=$EXAMPLE_DIR output -json | jq -r '.dsf_hubs.value.primary.public_address') >> $GITHUB_ENV - echo gw_ip=$(terraform -chdir=$EXAMPLE_DIR output -json | jq -r '.dsf_agentless_gw_group.value."gw-0".private_address') >> $GITHUB_ENV - echo dsf_ssh_key_file_name=$EXAMPLE_DIR/$(terraform -chdir=$EXAMPLE_DIR output -json | jq -r '.dsf_private_ssh_key_file_name.value') >> $GITHUB_ENV - - # Test the ssh connectivity to the Hub and GW, it checks both of them because the connection to the GW is allowed from the Hub only via proxy - - name: Check SSH Connectivity - uses: appleboy/ssh-action@v0.1.6 - with: - proxy_host: ${{ env.hub_ip }} - proxy_username: ec2-user - proxy_key_path: ${{ env.dsf_ssh_key_file_name }} - proxy_port: 22 - host: ${{ env.gw_ip }} - username: ec2-user - key_path: ${{ env.dsf_ssh_key_file_name }} - port: 22 - script: ifconfig | grep -Eo 'inet (addr:)?([0-9]*\.){3}[0-9]*' | grep -Eo '([0-9]*\.){3}[0-9]*' | grep -v '127.0.0.1' - - - name: Terraform Destroy - if: always() - run: terraform -chdir=$EXAMPLE_DIR destroy -auto-approve -lock-timeout=1800s - - # Send job failure to Slack - - name: Send Slack by action-slack - uses: 8398a7/action-slack@v3 - with: - status: ${{ job.status }} - fields: repo,message,commit,author,action,eventName,ref,workflow,job,took,pullRequest - env: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} - if: ${{ failure() }} From b19c958510a2e90f18ca30f68c8691f2f7e047ba Mon Sep 17 00:00:00 2001 From: "linda.nasredin" Date: Mon, 9 Jan 2023 16:29:40 +0200 Subject: [PATCH 09/18] Renamed examples --- .../workflows/terraform_apply_hadr_cli.yml | 2 +- .../workflows/terraform_apply_simple_cli.yml | 2 +- .github/workflows/terraform_run_test.yml | 2 +- .../terraform_simple_cli_dev_nightly.yml | 2 +- README.md | 24 +++++++++---------- .../main.tf | 0 .../outputs.tf | 0 .../variables.tf | 0 .../versions.tf | 0 .../{se_demo => poc/basic_deployment}/main.tf | 0 .../basic_deployment}/outputs.tf | 0 .../basic_deployment}/variables.tf | 0 .../basic_deployment}/versions.tf | 0 .../hadr_deployment}/main.tf | 0 .../hadr_deployment}/outputs.tf | 0 .../hadr_deployment}/variables.tf | 0 .../hadr_deployment}/versions.tf | 0 deploy/installer_machine/variables.tf | 2 +- 18 files changed, 17 insertions(+), 17 deletions(-) rename deploy/examples/{multi_account => multi_account_deployment}/main.tf (100%) rename deploy/examples/{multi_account => multi_account_deployment}/outputs.tf (100%) rename deploy/examples/{multi_account => multi_account_deployment}/variables.tf (100%) rename deploy/examples/{multi_account => multi_account_deployment}/versions.tf (100%) rename deploy/examples/{se_demo => poc/basic_deployment}/main.tf (100%) rename deploy/examples/{se_demo => poc/basic_deployment}/outputs.tf (100%) rename deploy/examples/{se_demo => poc/basic_deployment}/variables.tf (100%) rename deploy/examples/{se_demo => poc/basic_deployment}/versions.tf (100%) rename deploy/examples/{se_demo_hadr => poc/hadr_deployment}/main.tf (100%) rename deploy/examples/{se_demo_hadr => poc/hadr_deployment}/outputs.tf (100%) rename deploy/examples/{se_demo_hadr => poc/hadr_deployment}/variables.tf (100%) rename deploy/examples/{se_demo_hadr => poc/hadr_deployment}/versions.tf (100%) diff --git a/.github/workflows/terraform_apply_hadr_cli.yml b/.github/workflows/terraform_apply_hadr_cli.yml index d16ec7336..746f3e6a8 100644 --- a/.github/workflows/terraform_apply_hadr_cli.yml +++ b/.github/workflows/terraform_apply_hadr_cli.yml @@ -19,7 +19,7 @@ env: TF_CLI_ARGS: "-no-color" TF_INPUT: 0 TF_VAR_gw_count: 2 - EXAMPLE_DIR: ./deploy/examples/se_demo_hadr + EXAMPLE_DIR: ./deploy/examples/hadr_deployment TF_WORKSPACE: hadr_cli AWS_REGION: eu-west-1 AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} diff --git a/.github/workflows/terraform_apply_simple_cli.yml b/.github/workflows/terraform_apply_simple_cli.yml index e80726a37..d1c27fc2b 100644 --- a/.github/workflows/terraform_apply_simple_cli.yml +++ b/.github/workflows/terraform_apply_simple_cli.yml @@ -19,7 +19,7 @@ env: TF_CLI_ARGS: "-no-color" TF_INPUT: 0 TF_VAR_gw_count: 2 - EXAMPLE_DIR: ./deploy/examples/se_demo + EXAMPLE_DIR: ./deploy/examples/basic_deployment TF_WORKSPACE: simple_cli AWS_REGION: eu-west-2 AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} diff --git a/.github/workflows/terraform_run_test.yml b/.github/workflows/terraform_run_test.yml index 02cd03a37..363130302 100644 --- a/.github/workflows/terraform_run_test.yml +++ b/.github/workflows/terraform_run_test.yml @@ -11,7 +11,7 @@ env: TF_CLI_ARGS: "-no-color" TF_INPUT: 0 TF_VAR_gw_count: 1 - EXAMPLE_DIR: ./deploy/examples/se_demo + EXAMPLE_DIR: ./deploy/examples/basic_deployment TF_WORKSPACE: run_test AWS_REGION: ap-southeast-2 AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} diff --git a/.github/workflows/terraform_simple_cli_dev_nightly.yml b/.github/workflows/terraform_simple_cli_dev_nightly.yml index 54a24b46a..0895af7bd 100644 --- a/.github/workflows/terraform_simple_cli_dev_nightly.yml +++ b/.github/workflows/terraform_simple_cli_dev_nightly.yml @@ -10,7 +10,7 @@ env: TF_CLI_ARGS: "-no-color" TF_INPUT: 0 TF_VAR_gw_count: 2 - EXAMPLE_DIR: ./deploy/examples/se_demo + EXAMPLE_DIR: ./deploy/examples/basic_deployment TF_WORKSPACE: simple_cli AWS_REGION: eu-west-2 AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} diff --git a/README.md b/README.md index b6178e5f5..d8ac902f5 100644 --- a/README.md +++ b/README.md @@ -154,7 +154,7 @@ NOTE: Note: It may take several hours for access to be granted to AWS and Terraf When using DSFKit there is no need to manually download the DSF binaries, DSFKit will do that automatically based on the Sonar version specified in the Terraform recipe. -**File**: deploy/examples/se_demo/variables.tf +**File**: deploy/examples/basic_deployment/variables.tf ```bash variable "sonar_version" { type = string @@ -210,7 +210,7 @@ Follow these instructions to install DSFKit via the UI Installation Mode: * Click on the Advanced options button.
![Advanced options](https://user-images.githubusercontent.com/87799317/203774205-54db54e9-9e16-481b-8225-3ecee32fb148.png) - * Enter “deploy/examples/se_demo” into the Terraform working directory input field. To understand what the se_demo example consists of or the create a custom demo, please see more details in the [Customizing Demos - Examples/Recipes](#customizing-demos---examplesrecipes) section.
![deploy/examples/se_demo](https://user-images.githubusercontent.com/87799317/203820129-39804a8a-eb90-451c-bc66-b5adb4cb90f3.png) + * Enter “deploy/examples/basic_deployment” into the Terraform working directory input field. To understand what the basic_deployment example consists of or the create a custom demo, please see more details in the [Customizing Demos - Examples/Recipes](#customizing-demos---examplesrecipes) section.
![deploy/examples/basic_deployment](https://user-images.githubusercontent.com/87799317/203820129-39804a8a-eb90-451c-bc66-b5adb4cb90f3.png) * Select the “Auto apply” option as the Apply Method.
![Auto apply](https://user-images.githubusercontent.com/87799317/203820284-ea8479f7-b486-4040-8ce1-72c36fd22515.png) @@ -323,9 +323,9 @@ NOTE: Update the values for the required parameters to complete the installation ``` - DSFKit arrives with a built-in example “se_demo” which should meet most POC requirements. See “[Customizing Demos](#customizing-demos---examplesrecipes)” to understand the environment created with the “se_demo” example and to learn how to create specific requirements if needed.
For simplicity we will use the following: + DSFKit arrives with a built-in example “basic_deployment” which should meet most POC requirements. See “[Customizing Demos](#customizing-demos---examplesrecipes)” to understand the environment created with the “basic_deployment” example and to learn how to create specific requirements if needed.
For simplicity we will use the following: ```bash - cd dsfkit/deploy/examples/se_demo + cd dsfkit/deploy/examples/basic_deployment ``` 3. Terraform uses the AWS shell environment for AWS authentication. More details on how to authenticate with AWS are [here](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-quickstart.html). \ @@ -377,7 +377,7 @@ Complete these steps to manually create an installer machine: 4. Scroll down to find the “User data” input and paste [this bash script](https://github.com/imperva/dsfkit/blob/master/deploy/installer_machine/prepare_installer.tpl) into the “User data” textbox.
![User data](https://user-images.githubusercontent.com/87799317/203826003-661c829f-d704-43c4-adb7-854b8008577c.png) 5. Update the following parameter values in the bash script: - 1. example_name (i.e se_demo) + 1. example_name (e.g., basic_deployment) 2. aws_access_key_id 3. aws_secret_access_key 4. region @@ -398,7 +398,7 @@ NOTES: 7. When installation is done extract the web console password and DSF URL using: 1. ```bash - cd /dsfkit/deploy/examples/ + cd /dsfkit/deploy/examples/ ``` 2. ```bash terraform output "dsf_hub_web_console" @@ -447,7 +447,7 @@ DO NOT DESTROY THE INSTALLER MACHINE UNTIL YOU ARE DONE AND DESTROYED ALL THE OT which appears in the first phase output. 8. After the installation is completed, run ssh to the installer machine using the `installer_machine_ssh_command` which appears in the first phase output. 9. ```bash - cd /dsfkit/deploy/examples/ + cd /dsfkit/deploy/examples/ ``` 10. Extract the web console admin password and DSF URL using: ```bash @@ -463,7 +463,7 @@ NOTE: The Terraform script is OS-Safe, as it doesn't run any bash script. DSFKit ships 2 built-in examples/recipes which are already configured to deploy a basic Sonar environment: -1. “se_demo” recipe, consist of: +1. “basic_deployment” recipe, consist of: 1. New VPC 2. 1 Hub 3. 1 GW @@ -472,13 +472,13 @@ DSFKit ships 2 built-in examples/recipes which are already configured to deploy 6. Auto configuration of new “Demo DB” to enable native audit 7. Onboarding database into Sonar -2. “se_demo_hadr” recipe, consist of: +2. “hadr_deployment” recipe, consist of: 1. New VPC 2. 1 Primary Hub 3. 1 Secondary Hub 4. 1 GW 5. Federation - 6. HADR + 6. Hub HADR It is also possible to accommodate varying system requirements and deployments. To customize the demo, please complete the following steps: @@ -529,7 +529,7 @@ Please complete the following steps to completely uninstall the Imperva DSFKit a 1. cd into the installed “example”: ```bash - cd deploy/examples/se_demo + cd deploy/examples/ ``` 2. Run: ```bash @@ -542,7 +542,7 @@ Please complete the following steps to completely uninstall the Imperva DSFKit a 1. ssh into the “Installer Machine”. 2. cd into the installed “example”: ```bash - cd /dsfkit/deploy/examples/ + cd /dsfkit/deploy/examples/ ``` 3. Run: ```bash diff --git a/deploy/examples/multi_account/main.tf b/deploy/examples/multi_account_deployment/main.tf similarity index 100% rename from deploy/examples/multi_account/main.tf rename to deploy/examples/multi_account_deployment/main.tf diff --git a/deploy/examples/multi_account/outputs.tf b/deploy/examples/multi_account_deployment/outputs.tf similarity index 100% rename from deploy/examples/multi_account/outputs.tf rename to deploy/examples/multi_account_deployment/outputs.tf diff --git a/deploy/examples/multi_account/variables.tf b/deploy/examples/multi_account_deployment/variables.tf similarity index 100% rename from deploy/examples/multi_account/variables.tf rename to deploy/examples/multi_account_deployment/variables.tf diff --git a/deploy/examples/multi_account/versions.tf b/deploy/examples/multi_account_deployment/versions.tf similarity index 100% rename from deploy/examples/multi_account/versions.tf rename to deploy/examples/multi_account_deployment/versions.tf diff --git a/deploy/examples/se_demo/main.tf b/deploy/examples/poc/basic_deployment/main.tf similarity index 100% rename from deploy/examples/se_demo/main.tf rename to deploy/examples/poc/basic_deployment/main.tf diff --git a/deploy/examples/se_demo/outputs.tf b/deploy/examples/poc/basic_deployment/outputs.tf similarity index 100% rename from deploy/examples/se_demo/outputs.tf rename to deploy/examples/poc/basic_deployment/outputs.tf diff --git a/deploy/examples/se_demo/variables.tf b/deploy/examples/poc/basic_deployment/variables.tf similarity index 100% rename from deploy/examples/se_demo/variables.tf rename to deploy/examples/poc/basic_deployment/variables.tf diff --git a/deploy/examples/se_demo/versions.tf b/deploy/examples/poc/basic_deployment/versions.tf similarity index 100% rename from deploy/examples/se_demo/versions.tf rename to deploy/examples/poc/basic_deployment/versions.tf diff --git a/deploy/examples/se_demo_hadr/main.tf b/deploy/examples/poc/hadr_deployment/main.tf similarity index 100% rename from deploy/examples/se_demo_hadr/main.tf rename to deploy/examples/poc/hadr_deployment/main.tf diff --git a/deploy/examples/se_demo_hadr/outputs.tf b/deploy/examples/poc/hadr_deployment/outputs.tf similarity index 100% rename from deploy/examples/se_demo_hadr/outputs.tf rename to deploy/examples/poc/hadr_deployment/outputs.tf diff --git a/deploy/examples/se_demo_hadr/variables.tf b/deploy/examples/poc/hadr_deployment/variables.tf similarity index 100% rename from deploy/examples/se_demo_hadr/variables.tf rename to deploy/examples/poc/hadr_deployment/variables.tf diff --git a/deploy/examples/se_demo_hadr/versions.tf b/deploy/examples/poc/hadr_deployment/versions.tf similarity index 100% rename from deploy/examples/se_demo_hadr/versions.tf rename to deploy/examples/poc/hadr_deployment/versions.tf diff --git a/deploy/installer_machine/variables.tf b/deploy/installer_machine/variables.tf index 08204a6fd..b7c1fa392 100644 --- a/deploy/installer_machine/variables.tf +++ b/deploy/installer_machine/variables.tf @@ -19,7 +19,7 @@ variable "_3_aws_region" { variable "example_name" { type = string - default = "se_demo" + default = "basic_deployment" } variable "web_console_cidr" { From 8d0abd5544bf7067f760b81ac507b431806fffa1 Mon Sep 17 00:00:00 2001 From: "linda.nasredin" Date: Mon, 9 Jan 2023 16:40:51 +0200 Subject: [PATCH 10/18] Renamed examples --- .github/workflows/terraform_plan.yml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/terraform_plan.yml b/.github/workflows/terraform_plan.yml index 9583a31b3..1a9864960 100644 --- a/.github/workflows/terraform_plan.yml +++ b/.github/workflows/terraform_plan.yml @@ -10,9 +10,12 @@ on: env: TF_WARN_OUTPUT_ERRORS: 1 - TF_WORKSPACE: dsfkit-ci-cd TF_CLI_ARGS: "-no-color" TF_INPUT: 0 + EXAMPLE_DIR: ./deploy/examples/basic_deployment + AWS_REGION: us-west-2 + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} permissions: contents: read @@ -46,10 +49,10 @@ jobs: # Initialize a new or existing Terraform working directory by creating initial files, loading any remote state, downloading modules, etc. - name: Terraform Init - run: terraform init + run: terraform -chdir=$EXAMPLE_DIR init - name: Terraform Validate - run: terraform validate + run: terraform -chdir=$EXAMPLE_DIR validate # Checks that all Terraform configuration files adhere to a canonical format - name: Terraform Format @@ -58,7 +61,7 @@ jobs: # Generates an execution plan for Terraform - name: Terraform Plan (simple) - run: terraform plan + run: terraform -chdir=$EXAMPLE_DIR plan - - name: Terraform Plan (hadr) - run: TF_WORKSPACE=dsfkit-ci-cd-hadr terraform plan +# - name: Terraform Plan (hadr) +# run: TF_WORKSPACE=dsfkit-ci-cd-hadr terraform plan From f1f57f3d925aff8beddde80b7e71bcf9372c629e Mon Sep 17 00:00:00 2001 From: "linda.nasredin" Date: Mon, 9 Jan 2023 16:45:59 +0200 Subject: [PATCH 11/18] Renamed examples --- .github/workflows/terraform_apply_simple_cli.yml | 2 +- .github/workflows/terraform_plan.yml | 2 +- .github/workflows/terraform_run_test.yml | 2 +- .github/workflows/terraform_simple_cli_dev_nightly.yml | 2 +- README.md | 6 +++--- deploy/installer_machine/variables.tf | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/terraform_apply_simple_cli.yml b/.github/workflows/terraform_apply_simple_cli.yml index d1c27fc2b..16a154e22 100644 --- a/.github/workflows/terraform_apply_simple_cli.yml +++ b/.github/workflows/terraform_apply_simple_cli.yml @@ -19,7 +19,7 @@ env: TF_CLI_ARGS: "-no-color" TF_INPUT: 0 TF_VAR_gw_count: 2 - EXAMPLE_DIR: ./deploy/examples/basic_deployment + EXAMPLE_DIR: ./deploy/examples/poc/basic_deployment TF_WORKSPACE: simple_cli AWS_REGION: eu-west-2 AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} diff --git a/.github/workflows/terraform_plan.yml b/.github/workflows/terraform_plan.yml index 1a9864960..0e3e35b18 100644 --- a/.github/workflows/terraform_plan.yml +++ b/.github/workflows/terraform_plan.yml @@ -12,7 +12,7 @@ env: TF_WARN_OUTPUT_ERRORS: 1 TF_CLI_ARGS: "-no-color" TF_INPUT: 0 - EXAMPLE_DIR: ./deploy/examples/basic_deployment + EXAMPLE_DIR: ./deploy/examples/poc/basic_deployment AWS_REGION: us-west-2 AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} diff --git a/.github/workflows/terraform_run_test.yml b/.github/workflows/terraform_run_test.yml index 363130302..dd01dea87 100644 --- a/.github/workflows/terraform_run_test.yml +++ b/.github/workflows/terraform_run_test.yml @@ -11,7 +11,7 @@ env: TF_CLI_ARGS: "-no-color" TF_INPUT: 0 TF_VAR_gw_count: 1 - EXAMPLE_DIR: ./deploy/examples/basic_deployment + EXAMPLE_DIR: ./deploy/examples/poc/basic_deployment TF_WORKSPACE: run_test AWS_REGION: ap-southeast-2 AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} diff --git a/.github/workflows/terraform_simple_cli_dev_nightly.yml b/.github/workflows/terraform_simple_cli_dev_nightly.yml index 0895af7bd..51a989f93 100644 --- a/.github/workflows/terraform_simple_cli_dev_nightly.yml +++ b/.github/workflows/terraform_simple_cli_dev_nightly.yml @@ -10,7 +10,7 @@ env: TF_CLI_ARGS: "-no-color" TF_INPUT: 0 TF_VAR_gw_count: 2 - EXAMPLE_DIR: ./deploy/examples/basic_deployment + EXAMPLE_DIR: ./deploy/examples/poc/basic_deployment TF_WORKSPACE: simple_cli AWS_REGION: eu-west-2 AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} diff --git a/README.md b/README.md index d8ac902f5..a893a6893 100644 --- a/README.md +++ b/README.md @@ -154,7 +154,7 @@ NOTE: Note: It may take several hours for access to be granted to AWS and Terraf When using DSFKit there is no need to manually download the DSF binaries, DSFKit will do that automatically based on the Sonar version specified in the Terraform recipe. -**File**: deploy/examples/basic_deployment/variables.tf +**File**: deploy/examples/poc/basic_deployment/variables.tf ```bash variable "sonar_version" { type = string @@ -210,7 +210,7 @@ Follow these instructions to install DSFKit via the UI Installation Mode: * Click on the Advanced options button.
![Advanced options](https://user-images.githubusercontent.com/87799317/203774205-54db54e9-9e16-481b-8225-3ecee32fb148.png) - * Enter “deploy/examples/basic_deployment” into the Terraform working directory input field. To understand what the basic_deployment example consists of or the create a custom demo, please see more details in the [Customizing Demos - Examples/Recipes](#customizing-demos---examplesrecipes) section.
![deploy/examples/basic_deployment](https://user-images.githubusercontent.com/87799317/203820129-39804a8a-eb90-451c-bc66-b5adb4cb90f3.png) + * Enter “deploy/examples/poc/basic_deployment” into the Terraform working directory input field. To understand what the basic_deployment example consists of or the create a custom demo, please see more details in the [Customizing Demos - Examples/Recipes](#customizing-demos---examplesrecipes) section.
![deploy/examples/basic_deployment](https://user-images.githubusercontent.com/87799317/203820129-39804a8a-eb90-451c-bc66-b5adb4cb90f3.png) * Select the “Auto apply” option as the Apply Method.
![Auto apply](https://user-images.githubusercontent.com/87799317/203820284-ea8479f7-b486-4040-8ce1-72c36fd22515.png) @@ -325,7 +325,7 @@ NOTE: Update the values for the required parameters to complete the installation DSFKit arrives with a built-in example “basic_deployment” which should meet most POC requirements. See “[Customizing Demos](#customizing-demos---examplesrecipes)” to understand the environment created with the “basic_deployment” example and to learn how to create specific requirements if needed.
For simplicity we will use the following: ```bash - cd dsfkit/deploy/examples/basic_deployment + cd dsfkit/deploy/examples/poc/basic_deployment ``` 3. Terraform uses the AWS shell environment for AWS authentication. More details on how to authenticate with AWS are [here](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-quickstart.html). \ diff --git a/deploy/installer_machine/variables.tf b/deploy/installer_machine/variables.tf index b7c1fa392..75ba23c57 100644 --- a/deploy/installer_machine/variables.tf +++ b/deploy/installer_machine/variables.tf @@ -19,7 +19,7 @@ variable "_3_aws_region" { variable "example_name" { type = string - default = "basic_deployment" + default = "poc/basic_deployment" } variable "web_console_cidr" { From ddcd3898bb85380627d0efa4e878d0cb8d139733 Mon Sep 17 00:00:00 2001 From: "linda.nasredin" Date: Mon, 9 Jan 2023 16:59:02 +0200 Subject: [PATCH 12/18] Renamed examples --- .github/workflows/terraform_apply.yml | 2 +- .github/workflows/terraform_apply_hadr.yml | 2 +- .github/workflows/terraform_apply_hadr_cli.yml | 2 +- .github/workflows/terraform_apply_simple_cli.yml | 2 +- .github/workflows/terraform_plan.yml | 2 +- .github/workflows/terraform_run_test.yml | 2 +- .github/workflows/terraform_simple_cli_dev_nightly.yml | 2 +- .../{ => installation}/multi_account_deployment/main.tf | 0 .../{ => installation}/multi_account_deployment/outputs.tf | 0 .../{ => installation}/multi_account_deployment/variables.tf | 0 .../{ => installation}/multi_account_deployment/versions.tf | 0 11 files changed, 7 insertions(+), 7 deletions(-) rename deploy/examples/{ => installation}/multi_account_deployment/main.tf (100%) rename deploy/examples/{ => installation}/multi_account_deployment/outputs.tf (100%) rename deploy/examples/{ => installation}/multi_account_deployment/variables.tf (100%) rename deploy/examples/{ => installation}/multi_account_deployment/versions.tf (100%) diff --git a/.github/workflows/terraform_apply.yml b/.github/workflows/terraform_apply.yml index 7dc8583db..d71ff2030 100644 --- a/.github/workflows/terraform_apply.yml +++ b/.github/workflows/terraform_apply.yml @@ -43,7 +43,7 @@ jobs: - name: Change the modules source to local run: | - find . -type f -exec sed -i 's/source *= \"github.com\/imperva\/dsfkit\//source = \"..\/..\/../' {} \; + find . -type f -exec sed -i 's/source *= \"github.com\/imperva\/dsfkit\//source = \"..\/..\/..\/../' {} \; ! grep -rnw '.' -e 'github\.com/imperva/dsfkit//deploy/modules' - name: Sets env vars for environment diff --git a/.github/workflows/terraform_apply_hadr.yml b/.github/workflows/terraform_apply_hadr.yml index 0a65bec58..56537f0fc 100644 --- a/.github/workflows/terraform_apply_hadr.yml +++ b/.github/workflows/terraform_apply_hadr.yml @@ -43,7 +43,7 @@ jobs: - name: Change the modules source to local run: | - find . -type f -exec sed -i 's/source *= \"github.com\/imperva\/dsfkit\//source = \"..\/..\/../' {} \; + find . -type f -exec sed -i 's/source *= \"github.com\/imperva\/dsfkit\//source = \"..\/..\/..\/../' {} \; ! grep -rnw '.' -e 'github\.com/imperva/dsfkit//deploy/modules' - name: Sets env vars for environment diff --git a/.github/workflows/terraform_apply_hadr_cli.yml b/.github/workflows/terraform_apply_hadr_cli.yml index 746f3e6a8..82e3a3929 100644 --- a/.github/workflows/terraform_apply_hadr_cli.yml +++ b/.github/workflows/terraform_apply_hadr_cli.yml @@ -45,7 +45,7 @@ jobs: - name: Change the modules source to local run: | - find . -type f -exec sed -i 's/source *= \"github.com\/imperva\/dsfkit\//source = \"..\/..\/../' {} \; + find . -type f -exec sed -i 's/source *= \"github.com\/imperva\/dsfkit\//source = \"..\/..\/..\/../' {} \; ! grep -rnw '.' -e 'github\.com/imperva/dsfkit//deploy/modules' - name: Sets env vars for environment diff --git a/.github/workflows/terraform_apply_simple_cli.yml b/.github/workflows/terraform_apply_simple_cli.yml index 16a154e22..ee0519ff6 100644 --- a/.github/workflows/terraform_apply_simple_cli.yml +++ b/.github/workflows/terraform_apply_simple_cli.yml @@ -61,7 +61,7 @@ jobs: - name: Change the modules source to local run: | - find . -type f -exec sed -i 's/source *= \"github.com\/imperva\/dsfkit\//source = \"..\/..\/../' {} \; + find . -type f -exec sed -i 's/source *= \"github.com\/imperva\/dsfkit\//source = \"..\/..\/..\/../' {} \; ! grep -rnw '.' -e 'github\.com/imperva/dsfkit//deploy/modules' - name: Sets env vars for environment diff --git a/.github/workflows/terraform_plan.yml b/.github/workflows/terraform_plan.yml index 0e3e35b18..a3bf6366e 100644 --- a/.github/workflows/terraform_plan.yml +++ b/.github/workflows/terraform_plan.yml @@ -38,7 +38,7 @@ jobs: - name: Change the modules source to local run: | - find . -type f -exec sed -i 's/source *= \"github.com\/imperva\/dsfkit\//source = \"..\/..\/../' {} \; + find . -type f -exec sed -i 's/source *= \"github.com\/imperva\/dsfkit\//source = \"..\/..\/..\/../' {} \; ! grep -rnw '.' -e 'github\.com/imperva/dsfkit//deploy/modules' # Install the latest version of Terraform CLI and configure the Terraform CLI configuration file with a Terraform Cloud user API token diff --git a/.github/workflows/terraform_run_test.yml b/.github/workflows/terraform_run_test.yml index dd01dea87..5d7530343 100644 --- a/.github/workflows/terraform_run_test.yml +++ b/.github/workflows/terraform_run_test.yml @@ -53,7 +53,7 @@ jobs: - name: Change the modules source to local run: | - find . -type f -exec sed -i 's/source *= \"github.com\/imperva\/dsfkit\//source = \"..\/..\/../' {} \; + find . -type f -exec sed -i 's/source *= \"github.com\/imperva\/dsfkit\//source = \"..\/..\/..\/../' {} \; ! grep -rnw '.' -e 'github\.com/imperva/dsfkit//deploy/modules' - name: Set Environment Variables diff --git a/.github/workflows/terraform_simple_cli_dev_nightly.yml b/.github/workflows/terraform_simple_cli_dev_nightly.yml index 51a989f93..48be180c6 100644 --- a/.github/workflows/terraform_simple_cli_dev_nightly.yml +++ b/.github/workflows/terraform_simple_cli_dev_nightly.yml @@ -38,7 +38,7 @@ jobs: - name: Change the modules source to local run: | - find . -type f -exec sed -i 's/source *= \"github.com\/imperva\/dsfkit\//source = \"..\/..\/../' {} \; + find . -type f -exec sed -i 's/source *= \"github.com\/imperva\/dsfkit\//source = \"..\/..\/..\/../' {} \; ! grep -rnw '.' -e 'github\.com/imperva/dsfkit//deploy/modules' - name: Sets env vars for environment diff --git a/deploy/examples/multi_account_deployment/main.tf b/deploy/examples/installation/multi_account_deployment/main.tf similarity index 100% rename from deploy/examples/multi_account_deployment/main.tf rename to deploy/examples/installation/multi_account_deployment/main.tf diff --git a/deploy/examples/multi_account_deployment/outputs.tf b/deploy/examples/installation/multi_account_deployment/outputs.tf similarity index 100% rename from deploy/examples/multi_account_deployment/outputs.tf rename to deploy/examples/installation/multi_account_deployment/outputs.tf diff --git a/deploy/examples/multi_account_deployment/variables.tf b/deploy/examples/installation/multi_account_deployment/variables.tf similarity index 100% rename from deploy/examples/multi_account_deployment/variables.tf rename to deploy/examples/installation/multi_account_deployment/variables.tf diff --git a/deploy/examples/multi_account_deployment/versions.tf b/deploy/examples/installation/multi_account_deployment/versions.tf similarity index 100% rename from deploy/examples/multi_account_deployment/versions.tf rename to deploy/examples/installation/multi_account_deployment/versions.tf From c320e1cd8833f5ad5cfd85ddf52d31e73fbc226c Mon Sep 17 00:00:00 2001 From: "linda.nasredin" Date: Mon, 9 Jan 2023 17:12:33 +0200 Subject: [PATCH 13/18] Renamed examples --- .github/workflows/terraform_plan.yml | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/.github/workflows/terraform_plan.yml b/.github/workflows/terraform_plan.yml index a3bf6366e..ecd9d5990 100644 --- a/.github/workflows/terraform_plan.yml +++ b/.github/workflows/terraform_plan.yml @@ -12,7 +12,6 @@ env: TF_WARN_OUTPUT_ERRORS: 1 TF_CLI_ARGS: "-no-color" TF_INPUT: 0 - EXAMPLE_DIR: ./deploy/examples/poc/basic_deployment AWS_REGION: us-west-2 AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} @@ -31,6 +30,9 @@ jobs: run: shell: bash + strategy: + matrix: + example: ['./deploy/examples/poc/basic_deployment', './deploy/examples/poc/hadr_deployment'] steps: # Checkout the repository to the GitHub Actions runner - name: Checkout @@ -49,10 +51,14 @@ jobs: # Initialize a new or existing Terraform working directory by creating initial files, loading any remote state, downloading modules, etc. - name: Terraform Init - run: terraform -chdir=$EXAMPLE_DIR init + with: + example: ${{ matrix.example }} + run: terraform -chdir=${{ example }} init - name: Terraform Validate - run: terraform -chdir=$EXAMPLE_DIR validate + with: + example: ${{ matrix.example }} + run: terraform -chdir=${{ example }} validate # Checks that all Terraform configuration files adhere to a canonical format - name: Terraform Format @@ -61,7 +67,7 @@ jobs: # Generates an execution plan for Terraform - name: Terraform Plan (simple) - run: terraform -chdir=$EXAMPLE_DIR plan + with: + example: ${{ matrix.example }} + run: terraform -chdir=${{ example }} plan -# - name: Terraform Plan (hadr) -# run: TF_WORKSPACE=dsfkit-ci-cd-hadr terraform plan From bb074442bd77c3bf5ea9f6f95d4871d14c84afc3 Mon Sep 17 00:00:00 2001 From: "linda.nasredin" Date: Mon, 9 Jan 2023 17:18:17 +0200 Subject: [PATCH 14/18] Renamed examples --- .github/workflows/terraform_plan.yml | 68 ++++++++++++++-------------- 1 file changed, 35 insertions(+), 33 deletions(-) diff --git a/.github/workflows/terraform_plan.yml b/.github/workflows/terraform_plan.yml index ecd9d5990..d9d86cd67 100644 --- a/.github/workflows/terraform_plan.yml +++ b/.github/workflows/terraform_plan.yml @@ -12,6 +12,9 @@ env: TF_WARN_OUTPUT_ERRORS: 1 TF_CLI_ARGS: "-no-color" TF_INPUT: 0 + # TODO run all examples, not just these two in a generic manner + EXAMPLE_DIR1: ./deploy/examples/poc/basic_deployment + EXAMPLE_DIR2: ./deploy/examples/poc/hadr_deployment AWS_REGION: us-west-2 AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} @@ -30,44 +33,43 @@ jobs: run: shell: bash - strategy: - matrix: - example: ['./deploy/examples/poc/basic_deployment', './deploy/examples/poc/hadr_deployment'] steps: - # Checkout the repository to the GitHub Actions runner - - name: Checkout - uses: actions/checkout@v3 + # Checkout the repository to the GitHub Actions runner + - name: Checkout + uses: actions/checkout@v3 - - name: Change the modules source to local - run: | - find . -type f -exec sed -i 's/source *= \"github.com\/imperva\/dsfkit\//source = \"..\/..\/..\/../' {} \; - ! grep -rnw '.' -e 'github\.com/imperva/dsfkit//deploy/modules' + - name: Change the modules source to local + run: | + find . -type f -exec sed -i 's/source *= \"github.com\/imperva\/dsfkit\//source = \"..\/..\/..\/../' {} \; + ! grep -rnw '.' -e 'github\.com/imperva/dsfkit//deploy/modules' - # Install the latest version of Terraform CLI and configure the Terraform CLI configuration file with a Terraform Cloud user API token - - name: Setup Terraform - uses: hashicorp/setup-terraform@v1 - with: - cli_config_credentials_token: ${{ secrets.TF_API_TOKEN }} + # Install the latest version of Terraform CLI and configure the Terraform CLI configuration file with a Terraform Cloud user API token + - name: Setup Terraform + uses: hashicorp/setup-terraform@v1 + with: + cli_config_credentials_token: ${{ secrets.TF_API_TOKEN }} - # Initialize a new or existing Terraform working directory by creating initial files, loading any remote state, downloading modules, etc. - - name: Terraform Init - with: - example: ${{ matrix.example }} - run: terraform -chdir=${{ example }} init + # Initialize a new or existing Terraform working directory by creating initial files, loading any remote state, downloading modules, etc. + - name: Terraform Init + run: terraform -chdir=$EXAMPLE_DIR1 init - - name: Terraform Validate - with: - example: ${{ matrix.example }} - run: terraform -chdir=${{ example }} validate + - name: Terraform Init + run: terraform -chdir=$EXAMPLE_DIR2 init - # Checks that all Terraform configuration files adhere to a canonical format - - name: Terraform Format - run: terraform fmt -check - continue-on-error: true + - name: Terraform Validate + run: terraform -chdir=$EXAMPLE_DIR1 validate - # Generates an execution plan for Terraform - - name: Terraform Plan (simple) - with: - example: ${{ matrix.example }} - run: terraform -chdir=${{ example }} plan + - name: Terraform Validate + run: terraform -chdir=$EXAMPLE_DIR2 validate + # Checks that all Terraform configuration files adhere to a canonical format + - name: Terraform Format + run: terraform fmt -check + continue-on-error: true + + # Generates an execution plan for Terraform + - name: Terraform Plan (simple) + run: terraform -chdir=$EXAMPLE_DIR1 plan + + - name: Terraform Plan (hadr) + run: terraform -chdir=$EXAMPLE_DIR2 plan From 08418e9157ab964f742fbddeb6461d9a8ae48cec Mon Sep 17 00:00:00 2001 From: "linda.nasredin" Date: Mon, 9 Jan 2023 17:19:14 +0200 Subject: [PATCH 15/18] Renamed examples --- .github/workflows/terraform_plan.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/terraform_plan.yml b/.github/workflows/terraform_plan.yml index d9d86cd67..8c2cd7cf8 100644 --- a/.github/workflows/terraform_plan.yml +++ b/.github/workflows/terraform_plan.yml @@ -12,7 +12,6 @@ env: TF_WARN_OUTPUT_ERRORS: 1 TF_CLI_ARGS: "-no-color" TF_INPUT: 0 - # TODO run all examples, not just these two in a generic manner EXAMPLE_DIR1: ./deploy/examples/poc/basic_deployment EXAMPLE_DIR2: ./deploy/examples/poc/hadr_deployment AWS_REGION: us-west-2 From 6fee6b141748b220e0f7e14068bf798b0a0f1525 Mon Sep 17 00:00:00 2001 From: "linda.nasredin" Date: Mon, 9 Jan 2023 17:32:11 +0200 Subject: [PATCH 16/18] Renamed examples --- .github/workflows/terraform_plan.yml | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/.github/workflows/terraform_plan.yml b/.github/workflows/terraform_plan.yml index 8c2cd7cf8..8a0071aa8 100644 --- a/.github/workflows/terraform_plan.yml +++ b/.github/workflows/terraform_plan.yml @@ -12,8 +12,6 @@ env: TF_WARN_OUTPUT_ERRORS: 1 TF_CLI_ARGS: "-no-color" TF_INPUT: 0 - EXAMPLE_DIR1: ./deploy/examples/poc/basic_deployment - EXAMPLE_DIR2: ./deploy/examples/poc/hadr_deployment AWS_REGION: us-west-2 AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} @@ -32,6 +30,10 @@ jobs: run: shell: bash + strategy: + matrix: + example: ['./deploy/examples/poc/basic_deployment', './deploy/examples/poc/hadr_deployment'] + steps: # Checkout the repository to the GitHub Actions runner - name: Checkout @@ -50,16 +52,10 @@ jobs: # Initialize a new or existing Terraform working directory by creating initial files, loading any remote state, downloading modules, etc. - name: Terraform Init - run: terraform -chdir=$EXAMPLE_DIR1 init - - - name: Terraform Init - run: terraform -chdir=$EXAMPLE_DIR2 init - - - name: Terraform Validate - run: terraform -chdir=$EXAMPLE_DIR1 validate + run: terraform -chdir=${{ matrix.example }} init - name: Terraform Validate - run: terraform -chdir=$EXAMPLE_DIR2 validate + run: terraform -chdir=${{ matrix.example }} validate # Checks that all Terraform configuration files adhere to a canonical format - name: Terraform Format @@ -68,7 +64,5 @@ jobs: # Generates an execution plan for Terraform - name: Terraform Plan (simple) - run: terraform -chdir=$EXAMPLE_DIR1 plan + run: terraform -chdir=${{ matrix.example }} plan - - name: Terraform Plan (hadr) - run: terraform -chdir=$EXAMPLE_DIR2 plan From 4dc6f41abd359c454fc9e082ac17a89c889ded77 Mon Sep 17 00:00:00 2001 From: "linda.nasredin" Date: Tue, 10 Jan 2023 14:03:56 +0200 Subject: [PATCH 17/18] Renamed examples --- .github/workflows/terraform_apply_simple_cli.yml | 4 ++-- .github/workflows/terraform_run_test.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/terraform_apply_simple_cli.yml b/.github/workflows/terraform_apply_simple_cli.yml index ee0519ff6..95c4c6dc9 100644 --- a/.github/workflows/terraform_apply_simple_cli.yml +++ b/.github/workflows/terraform_apply_simple_cli.yml @@ -36,10 +36,10 @@ jobs: workspace: [simple_cli] include: - workspace: simple_cli - example_dir: ./deploy/examples/se_demo + example_dir: ./deploy/examples/poc/basic_deployment aws_region: eu-west-2 - workspace: hadr_cli - example_dir: ./deploy/examples/se_demo_hadr + example_dir: ./deploy/examples/poc/hadr_deployment aws_region: eu-west-1 name: 'Terraform ${{ matrix.workspace }}' diff --git a/.github/workflows/terraform_run_test.yml b/.github/workflows/terraform_run_test.yml index 5d7530343..c7f19c703 100644 --- a/.github/workflows/terraform_run_test.yml +++ b/.github/workflows/terraform_run_test.yml @@ -28,10 +28,10 @@ jobs: workspace: [simple_cli] include: - workspace: simple_cli - example_dir: ./deploy/examples/se_demo + example_dir: ./deploy/examples/poc/basic_deployment aws_region: eu-west-2 - workspace: hadr_cli - example_dir: ./deploy/examples/se_demo_hadr + example_dir: ./deploy/examples/poc/hadr_deployment aws_region: eu-west-1 name: 'Terraform ${{ matrix.workspace }}' From 75b58fce90c3a3d676d7b2161be6215ad8f20434 Mon Sep 17 00:00:00 2001 From: Linda Nasredin Date: Wed, 11 Jan 2023 11:57:17 +0200 Subject: [PATCH 18/18] Deleted 'deploy' directory and created 'aws' directory under 'modules' (#51) * Deleted 'deploy' directory and created 'aws' directory under 'modules' * Deleted 'deploy' directory and created 'aws' directory under 'modules' * Deleted 'deploy' directory and created 'aws' directory under 'modules' * Deleted 'deploy' directory and created 'aws' directory under 'modules' * Deleted 'deploy' directory and created 'aws' directory under 'modules' * Deleted 'deploy' directory and created 'aws' directory under 'modules' * Deleted 'deploy' directory and created 'aws' directory under 'modules' * Deleted 'deploy' directory and created 'aws' directory under 'modules' --- .github/workflows/terraform_apply.yml | 4 +-- .github/workflows/terraform_apply_hadr.yml | 4 +-- .../workflows/terraform_apply_simple_cli.yml | 10 +++---- .github/workflows/terraform_plan.yml | 6 ++-- .github/workflows/terraform_run_test.yml | 10 +++---- .../terraform_simple_cli_dev_nightly.yml | 6 ++-- README.md | 30 +++++++++---------- .../multi_account_deployment/main.tf | 12 ++++---- .../multi_account_deployment/outputs.tf | 0 .../multi_account_deployment/variables.tf | 0 .../multi_account_deployment/versions.tf | 0 .../examples => examples}/octo/1-init/main.tf | 0 .../octo/1-init/outputs.tf | 0 .../octo/1-init/variables.template | 0 .../examples => examples}/octo/2-dsf/main.tf | 0 .../octo/2-dsf/outputs.tf | 0 .../octo/2-dsf/variables.template | 0 .../init/init_db.sql.template | 0 .../octo/3-rds-aurora-mysql-cluster/main.tf | 0 .../variables.template | 0 .../3-rds-mysql-db/init/init_db.sql.template | 0 .../octo/3-rds-mysql-db/init/isbt_db.sql | 0 .../octo/3-rds-mysql-db/main.tf | 0 .../octo/3-rds-mysql-db/variables.template | 0 .../octo/4-dsf-db-onboarding-configs/main.tf | 2 +- .../variables.template | 0 .../examples => examples}/octo/README_octo.md | 0 .../poc/basic_deployment/main.tf | 16 +++++----- .../poc/basic_deployment/outputs.tf | 0 .../poc/basic_deployment/variables.tf | 0 .../poc/basic_deployment/versions.tf | 0 .../poc/hadr_deployment/main.tf | 20 ++++++------- .../poc/hadr_deployment/outputs.tf | 0 .../poc/hadr_deployment/variables.tf | 0 .../poc/hadr_deployment/versions.tf | 0 .../main.tf | 2 +- .../outputs.tf | 0 .../prepare_installer.tpl | 2 +- .../variables.tf | 0 .../versions.tf | 0 .../aws}/agentless-gw/README.md | 8 ++--- .../aws}/agentless-gw/iam_role.tf | 0 .../aws}/agentless-gw/main.tf | 2 +- .../aws}/agentless-gw/outputs.tf | 0 .../aws}/agentless-gw/variables.tf | 0 .../aws}/agentless-gw/versions.tf | 0 .../aws}/config-import-discover-dbs/main.tf | 0 .../config-import-discover-dbs/variables.tf | 0 .../config-import-discover-dbs/versions.tf | 0 .../aws}/config-servicenow-cmdb-mx/main.tf | 0 .../config-servicenow-cmdb-mx/variables.tf | 0 .../config-servicenow-cmdb-mx/versions.tf | 0 .../aws}/core/globals/main.tf | 0 .../aws}/core/globals/outputs.tf | 0 .../aws}/core/globals/variables.tf | 0 .../aws}/core/globals/versions.tf | 0 .../aws}/core/key_pair/main.tf | 0 .../aws}/core/key_pair/outputs.tf | 0 .../aws}/core/key_pair/variables.tf | 0 .../aws}/db-onboarder/main.tf | 0 .../aws}/db-onboarder/onboard.tpl | 0 .../aws}/db-onboarder/variables.tf | 0 .../aws}/db-onboarder/versions.tf | 0 .../aws}/federation/federate_gw.tpl | 0 .../aws}/federation/federate_hub.tpl | 0 .../aws}/federation/grab_lock.sh | 0 .../aws}/federation/main.tf | 0 .../aws}/federation/variables.tf | 0 .../aws}/federation/versions.tf | 0 {deploy/modules => modules/aws}/hadr/main.tf | 0 .../modules => modules/aws}/hadr/variables.tf | 0 .../modules => modules/aws}/hadr/versions.tf | 0 {deploy/modules => modules/aws}/hub/README.md | 8 ++--- .../modules => modules/aws}/hub/iam_role.tf | 0 {deploy/modules => modules/aws}/hub/main.tf | 2 +- .../modules => modules/aws}/hub/outputs.tf | 0 {deploy/modules => modules/aws}/hub/secret.tf | 0 .../modules => modules/aws}/hub/variables.tf | 0 .../modules => modules/aws}/hub/versions.tf | 0 .../aws}/rds-aurora-mysql/main.tf | 0 .../aws}/rds-aurora-mysql/output.tf | 0 .../aws}/rds-aurora-mysql/variables.tf | 0 .../aws}/rds-aurora-mysql/versions.tf | 0 .../aws}/rds-mysql-db/main.tf | 0 .../aws}/rds-mysql-db/output.tf | 0 .../aws}/rds-mysql-db/variables.tf | 0 .../aws}/rds-mysql-db/versions.tf | 0 .../aws}/sonar-base-instance/main.tf | 0 .../aws}/sonar-base-instance/outputs.tf | 0 .../aws}/sonar-base-instance/setup.tpl | 0 .../aws}/sonar-base-instance/sg.tf | 0 .../aws}/sonar-base-instance/userdata.tf | 0 .../aws}/sonar-base-instance/variables.tf | 0 .../aws}/sonar-base-instance/versions.tf | 0 .../aws}/statistics/main.tf | 2 +- .../aws}/statistics/statistics.tpl | 0 .../CreateNetworkResourcesPermissions.txt | 0 .../GeneralRequiredPermissions.txt | 0 .../OnboardMysqlRdsPermissions.txt | 0 99 files changed, 73 insertions(+), 73 deletions(-) rename {deploy/examples => examples}/installation/multi_account_deployment/main.tf (96%) rename {deploy/examples => examples}/installation/multi_account_deployment/outputs.tf (100%) rename {deploy/examples => examples}/installation/multi_account_deployment/variables.tf (100%) rename {deploy/examples => examples}/installation/multi_account_deployment/versions.tf (100%) rename {deploy/examples => examples}/octo/1-init/main.tf (100%) rename {deploy/examples => examples}/octo/1-init/outputs.tf (100%) rename {deploy/examples => examples}/octo/1-init/variables.template (100%) rename {deploy/examples => examples}/octo/2-dsf/main.tf (100%) rename {deploy/examples => examples}/octo/2-dsf/outputs.tf (100%) rename {deploy/examples => examples}/octo/2-dsf/variables.template (100%) rename {deploy/examples => examples}/octo/3-rds-aurora-mysql-cluster/init/init_db.sql.template (100%) rename {deploy/examples => examples}/octo/3-rds-aurora-mysql-cluster/main.tf (100%) rename {deploy/examples => examples}/octo/3-rds-aurora-mysql-cluster/variables.template (100%) rename {deploy/examples => examples}/octo/3-rds-mysql-db/init/init_db.sql.template (100%) rename {deploy/examples => examples}/octo/3-rds-mysql-db/init/isbt_db.sql (100%) rename {deploy/examples => examples}/octo/3-rds-mysql-db/main.tf (100%) rename {deploy/examples => examples}/octo/3-rds-mysql-db/variables.template (100%) rename {deploy/examples => examples}/octo/4-dsf-db-onboarding-configs/main.tf (94%) rename {deploy/examples => examples}/octo/4-dsf-db-onboarding-configs/variables.template (100%) rename {deploy/examples => examples}/octo/README_octo.md (100%) rename {deploy/examples => examples}/poc/basic_deployment/main.tf (96%) rename {deploy/examples => examples}/poc/basic_deployment/outputs.tf (100%) rename {deploy/examples => examples}/poc/basic_deployment/variables.tf (100%) rename {deploy/examples => examples}/poc/basic_deployment/versions.tf (100%) rename {deploy/examples => examples}/poc/hadr_deployment/main.tf (96%) rename {deploy/examples => examples}/poc/hadr_deployment/outputs.tf (100%) rename {deploy/examples => examples}/poc/hadr_deployment/variables.tf (100%) rename {deploy/examples => examples}/poc/hadr_deployment/versions.tf (100%) rename {deploy/installer_machine => installer_machine}/main.tf (98%) rename {deploy/installer_machine => installer_machine}/outputs.tf (100%) rename {deploy/installer_machine => installer_machine}/prepare_installer.tpl (94%) rename {deploy/installer_machine => installer_machine}/variables.tf (100%) rename {deploy/installer_machine => installer_machine}/versions.tf (100%) rename {deploy/modules => modules/aws}/agentless-gw/README.md (96%) rename {deploy/modules => modules/aws}/agentless-gw/iam_role.tf (100%) rename {deploy/modules => modules/aws}/agentless-gw/main.tf (95%) rename {deploy/modules => modules/aws}/agentless-gw/outputs.tf (100%) rename {deploy/modules => modules/aws}/agentless-gw/variables.tf (100%) rename {deploy/modules => modules/aws}/agentless-gw/versions.tf (100%) rename {deploy/modules => modules/aws}/config-import-discover-dbs/main.tf (100%) rename {deploy/modules => modules/aws}/config-import-discover-dbs/variables.tf (100%) rename {deploy/modules => modules/aws}/config-import-discover-dbs/versions.tf (100%) rename {deploy/modules => modules/aws}/config-servicenow-cmdb-mx/main.tf (100%) rename {deploy/modules => modules/aws}/config-servicenow-cmdb-mx/variables.tf (100%) rename {deploy/modules => modules/aws}/config-servicenow-cmdb-mx/versions.tf (100%) rename {deploy/modules => modules/aws}/core/globals/main.tf (100%) rename {deploy/modules => modules/aws}/core/globals/outputs.tf (100%) rename {deploy/modules => modules/aws}/core/globals/variables.tf (100%) rename {deploy/modules => modules/aws}/core/globals/versions.tf (100%) rename {deploy/modules => modules/aws}/core/key_pair/main.tf (100%) rename {deploy/modules => modules/aws}/core/key_pair/outputs.tf (100%) rename {deploy/modules => modules/aws}/core/key_pair/variables.tf (100%) rename {deploy/modules => modules/aws}/db-onboarder/main.tf (100%) rename {deploy/modules => modules/aws}/db-onboarder/onboard.tpl (100%) rename {deploy/modules => modules/aws}/db-onboarder/variables.tf (100%) rename {deploy/modules => modules/aws}/db-onboarder/versions.tf (100%) rename {deploy/modules => modules/aws}/federation/federate_gw.tpl (100%) rename {deploy/modules => modules/aws}/federation/federate_hub.tpl (100%) rename {deploy/modules => modules/aws}/federation/grab_lock.sh (100%) rename {deploy/modules => modules/aws}/federation/main.tf (100%) rename {deploy/modules => modules/aws}/federation/variables.tf (100%) rename {deploy/modules => modules/aws}/federation/versions.tf (100%) rename {deploy/modules => modules/aws}/hadr/main.tf (100%) rename {deploy/modules => modules/aws}/hadr/variables.tf (100%) rename {deploy/modules => modules/aws}/hadr/versions.tf (100%) rename {deploy/modules => modules/aws}/hub/README.md (97%) rename {deploy/modules => modules/aws}/hub/iam_role.tf (100%) rename {deploy/modules => modules/aws}/hub/main.tf (95%) rename {deploy/modules => modules/aws}/hub/outputs.tf (100%) rename {deploy/modules => modules/aws}/hub/secret.tf (100%) rename {deploy/modules => modules/aws}/hub/variables.tf (100%) rename {deploy/modules => modules/aws}/hub/versions.tf (100%) rename {deploy/modules => modules/aws}/rds-aurora-mysql/main.tf (100%) rename {deploy/modules => modules/aws}/rds-aurora-mysql/output.tf (100%) rename {deploy/modules => modules/aws}/rds-aurora-mysql/variables.tf (100%) rename {deploy/modules => modules/aws}/rds-aurora-mysql/versions.tf (100%) rename {deploy/modules => modules/aws}/rds-mysql-db/main.tf (100%) rename {deploy/modules => modules/aws}/rds-mysql-db/output.tf (100%) rename {deploy/modules => modules/aws}/rds-mysql-db/variables.tf (100%) rename {deploy/modules => modules/aws}/rds-mysql-db/versions.tf (100%) rename {deploy/modules => modules/aws}/sonar-base-instance/main.tf (100%) rename {deploy/modules => modules/aws}/sonar-base-instance/outputs.tf (100%) rename {deploy/modules => modules/aws}/sonar-base-instance/setup.tpl (100%) rename {deploy/modules => modules/aws}/sonar-base-instance/sg.tf (100%) rename {deploy/modules => modules/aws}/sonar-base-instance/userdata.tf (100%) rename {deploy/modules => modules/aws}/sonar-base-instance/variables.tf (100%) rename {deploy/modules => modules/aws}/sonar-base-instance/versions.tf (100%) rename {deploy/modules => modules/aws}/statistics/main.tf (94%) rename {deploy/modules => modules/aws}/statistics/statistics.tpl (100%) rename {deploy/permissions_samples => permissions_samples}/CreateNetworkResourcesPermissions.txt (100%) rename {deploy/permissions_samples => permissions_samples}/GeneralRequiredPermissions.txt (100%) rename {deploy/permissions_samples => permissions_samples}/OnboardMysqlRdsPermissions.txt (100%) diff --git a/.github/workflows/terraform_apply.yml b/.github/workflows/terraform_apply.yml index d71ff2030..c22a6b0f5 100644 --- a/.github/workflows/terraform_apply.yml +++ b/.github/workflows/terraform_apply.yml @@ -43,8 +43,8 @@ jobs: - name: Change the modules source to local run: | - find . -type f -exec sed -i 's/source *= \"github.com\/imperva\/dsfkit\//source = \"..\/..\/..\/../' {} \; - ! grep -rnw '.' -e 'github\.com/imperva/dsfkit//deploy/modules' + find . -type f -exec sed -i -e 's/source *= \"github.com\/imperva\/dsfkit\/\/deploy\/modules/source = \"..\/..\/..\/modules\/aws/' -e 's/?ref=.*/"/' {} \; + ! grep -rnw '.' -e 'github\.com/imperva/dsfkit//modules' - name: Sets env vars for environment run: | diff --git a/.github/workflows/terraform_apply_hadr.yml b/.github/workflows/terraform_apply_hadr.yml index 56537f0fc..a7330a48d 100644 --- a/.github/workflows/terraform_apply_hadr.yml +++ b/.github/workflows/terraform_apply_hadr.yml @@ -43,8 +43,8 @@ jobs: - name: Change the modules source to local run: | - find . -type f -exec sed -i 's/source *= \"github.com\/imperva\/dsfkit\//source = \"..\/..\/..\/../' {} \; - ! grep -rnw '.' -e 'github\.com/imperva/dsfkit//deploy/modules' + find . -type f -exec sed -i -e 's/source *= \"github.com\/imperva\/dsfkit\/\/deploy\/modules/source = \"..\/..\/..\/modules\/aws/' -e 's/?ref=.*/"/' {} \; + ! grep -rnw '.' -e 'github\.com/imperva/dsfkit//modules' - name: Sets env vars for environment run: | diff --git a/.github/workflows/terraform_apply_simple_cli.yml b/.github/workflows/terraform_apply_simple_cli.yml index 95c4c6dc9..886f3146c 100644 --- a/.github/workflows/terraform_apply_simple_cli.yml +++ b/.github/workflows/terraform_apply_simple_cli.yml @@ -19,7 +19,7 @@ env: TF_CLI_ARGS: "-no-color" TF_INPUT: 0 TF_VAR_gw_count: 2 - EXAMPLE_DIR: ./deploy/examples/poc/basic_deployment + EXAMPLE_DIR: ./examples/poc/basic_deployment TF_WORKSPACE: simple_cli AWS_REGION: eu-west-2 AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} @@ -36,10 +36,10 @@ jobs: workspace: [simple_cli] include: - workspace: simple_cli - example_dir: ./deploy/examples/poc/basic_deployment + example_dir: ./examples/poc/basic_deployment aws_region: eu-west-2 - workspace: hadr_cli - example_dir: ./deploy/examples/poc/hadr_deployment + example_dir: ./examples/poc/hadr_deployment aws_region: eu-west-1 name: 'Terraform ${{ matrix.workspace }}' @@ -61,8 +61,8 @@ jobs: - name: Change the modules source to local run: | - find . -type f -exec sed -i 's/source *= \"github.com\/imperva\/dsfkit\//source = \"..\/..\/..\/../' {} \; - ! grep -rnw '.' -e 'github\.com/imperva/dsfkit//deploy/modules' + find . -type f -exec sed -i -e 's/source *= \"github.com\/imperva\/dsfkit\/\/deploy\/modules/source = \"..\/..\/..\/modules\/aws/' -e 's/?ref=.*/"/' {} \; + ! grep -rnw '.' -e 'github\.com/imperva/dsfkit//modules' - name: Sets env vars for environment run: | diff --git a/.github/workflows/terraform_plan.yml b/.github/workflows/terraform_plan.yml index 8a0071aa8..0ebbf6429 100644 --- a/.github/workflows/terraform_plan.yml +++ b/.github/workflows/terraform_plan.yml @@ -32,7 +32,7 @@ jobs: strategy: matrix: - example: ['./deploy/examples/poc/basic_deployment', './deploy/examples/poc/hadr_deployment'] + example: ['./examples/poc/basic_deployment', './examples/poc/hadr_deployment'] steps: # Checkout the repository to the GitHub Actions runner @@ -41,8 +41,8 @@ jobs: - name: Change the modules source to local run: | - find . -type f -exec sed -i 's/source *= \"github.com\/imperva\/dsfkit\//source = \"..\/..\/..\/../' {} \; - ! grep -rnw '.' -e 'github\.com/imperva/dsfkit//deploy/modules' + find . -type f -exec sed -i -e 's/source *= \"github.com\/imperva\/dsfkit\/\/deploy\/modules/source = \"..\/..\/..\/modules\/aws/' -e 's/?ref=.*/"/' {} \; + ! grep -rnw '.' -e 'github\.com/imperva/dsfkit//modules' # Install the latest version of Terraform CLI and configure the Terraform CLI configuration file with a Terraform Cloud user API token - name: Setup Terraform diff --git a/.github/workflows/terraform_run_test.yml b/.github/workflows/terraform_run_test.yml index c7f19c703..f6766aa45 100644 --- a/.github/workflows/terraform_run_test.yml +++ b/.github/workflows/terraform_run_test.yml @@ -11,7 +11,7 @@ env: TF_CLI_ARGS: "-no-color" TF_INPUT: 0 TF_VAR_gw_count: 1 - EXAMPLE_DIR: ./deploy/examples/poc/basic_deployment + EXAMPLE_DIR: ./examples/poc/basic_deployment TF_WORKSPACE: run_test AWS_REGION: ap-southeast-2 AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} @@ -28,10 +28,10 @@ jobs: workspace: [simple_cli] include: - workspace: simple_cli - example_dir: ./deploy/examples/poc/basic_deployment + example_dir: ./examples/poc/basic_deployment aws_region: eu-west-2 - workspace: hadr_cli - example_dir: ./deploy/examples/poc/hadr_deployment + example_dir: ./examples/poc/hadr_deployment aws_region: eu-west-1 name: 'Terraform ${{ matrix.workspace }}' @@ -53,8 +53,8 @@ jobs: - name: Change the modules source to local run: | - find . -type f -exec sed -i 's/source *= \"github.com\/imperva\/dsfkit\//source = \"..\/..\/..\/../' {} \; - ! grep -rnw '.' -e 'github\.com/imperva/dsfkit//deploy/modules' + find . -type f -exec sed -i -e 's/source *= \"github.com\/imperva\/dsfkit\/\/deploy\/modules/source = \"..\/..\/..\/modules\/aws/' -e 's/?ref=.*/"/' {} \; + ! grep -rnw '.' -e 'github\.com/imperva/dsfkit//modules' - name: Set Environment Variables if: always() diff --git a/.github/workflows/terraform_simple_cli_dev_nightly.yml b/.github/workflows/terraform_simple_cli_dev_nightly.yml index 48be180c6..94edeeaaa 100644 --- a/.github/workflows/terraform_simple_cli_dev_nightly.yml +++ b/.github/workflows/terraform_simple_cli_dev_nightly.yml @@ -10,7 +10,7 @@ env: TF_CLI_ARGS: "-no-color" TF_INPUT: 0 TF_VAR_gw_count: 2 - EXAMPLE_DIR: ./deploy/examples/poc/basic_deployment + EXAMPLE_DIR: ./examples/poc/basic_deployment TF_WORKSPACE: simple_cli AWS_REGION: eu-west-2 AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} @@ -38,8 +38,8 @@ jobs: - name: Change the modules source to local run: | - find . -type f -exec sed -i 's/source *= \"github.com\/imperva\/dsfkit\//source = \"..\/..\/..\/../' {} \; - ! grep -rnw '.' -e 'github\.com/imperva/dsfkit//deploy/modules' + find . -type f -exec sed -i -e 's/source *= \"github.com\/imperva\/dsfkit\/\/deploy\/modules/source = \"..\/..\/..\/modules\/aws/' -e 's/?ref=.*/"/' {} \; + ! grep -rnw '.' -e 'github\.com/imperva/dsfkit//modules' - name: Sets env vars for environment run: | diff --git a/README.md b/README.md index a893a6893..ea6e8b8d3 100644 --- a/README.md +++ b/README.md @@ -154,7 +154,7 @@ NOTE: Note: It may take several hours for access to be granted to AWS and Terraf When using DSFKit there is no need to manually download the DSF binaries, DSFKit will do that automatically based on the Sonar version specified in the Terraform recipe. -**File**: deploy/examples/poc/basic_deployment/variables.tf +**File**: examples/poc/basic_deployment/variables.tf ```bash variable "sonar_version" { type = string @@ -210,7 +210,7 @@ Follow these instructions to install DSFKit via the UI Installation Mode: * Click on the Advanced options button.
![Advanced options](https://user-images.githubusercontent.com/87799317/203774205-54db54e9-9e16-481b-8225-3ecee32fb148.png) - * Enter “deploy/examples/poc/basic_deployment” into the Terraform working directory input field. To understand what the basic_deployment example consists of or the create a custom demo, please see more details in the [Customizing Demos - Examples/Recipes](#customizing-demos---examplesrecipes) section.
![deploy/examples/basic_deployment](https://user-images.githubusercontent.com/87799317/203820129-39804a8a-eb90-451c-bc66-b5adb4cb90f3.png) + * Enter “examples/poc/basic_deployment” into the Terraform working directory input field. To understand what the basic_deployment example consists of or the create a custom demo, please see more details in the [Customizing Demos - Examples/Recipes](#customizing-demos---examplesrecipes) section.
![deploy/examples/basic_deployment](https://user-images.githubusercontent.com/87799317/203820129-39804a8a-eb90-451c-bc66-b5adb4cb90f3.png) * Select the “Auto apply” option as the Apply Method.
![Auto apply](https://user-images.githubusercontent.com/87799317/203820284-ea8479f7-b486-4040-8ce1-72c36fd22515.png) @@ -319,13 +319,13 @@ NOTE: Update the values for the required parameters to complete the installation 2. Navigate to the directory "examples": ```bash - cd dsfkit/deploy/examples/${example_name} + cd dsfkit/examples/${example_name} ``` DSFKit arrives with a built-in example “basic_deployment” which should meet most POC requirements. See “[Customizing Demos](#customizing-demos---examplesrecipes)” to understand the environment created with the “basic_deployment” example and to learn how to create specific requirements if needed.
For simplicity we will use the following: ```bash - cd dsfkit/deploy/examples/poc/basic_deployment + cd dsfkit/examples/poc/basic_deployment ``` 3. Terraform uses the AWS shell environment for AWS authentication. More details on how to authenticate with AWS are [here](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-quickstart.html). \ @@ -374,7 +374,7 @@ Complete these steps to manually create an installer machine: 3. Expand the “Advanced details” panel:
![Advanced details](https://user-images.githubusercontent.com/87799317/203825918-31879c4b-ca61-48e3-a522-c325335c4419.png) -4. Scroll down to find the “User data” input and paste [this bash script](https://github.com/imperva/dsfkit/blob/master/deploy/installer_machine/prepare_installer.tpl) into the “User data” textbox.
![User data](https://user-images.githubusercontent.com/87799317/203826003-661c829f-d704-43c4-adb7-854b8008577c.png) +4. Scroll down to find the “User data” input and paste [this bash script](https://github.com/imperva/dsfkit/blob/master/installer_machine/prepare_installer.tpl) into the “User data” textbox.
![User data](https://user-images.githubusercontent.com/87799317/203826003-661c829f-d704-43c4-adb7-854b8008577c.png) 5. Update the following parameter values in the bash script: 1. example_name (e.g., basic_deployment) @@ -398,7 +398,7 @@ NOTES: 7. When installation is done extract the web console password and DSF URL using: 1. ```bash - cd /dsfkit/deploy/examples/ + cd /dsfkit/examples/ ``` 2. ```bash terraform output "dsf_hub_web_console" @@ -416,7 +416,7 @@ To use the Terraform installer example follow the following step: git -C dsfkit checkout tags/${version} ``` 2. ```bash - cd dsfkit/deploy/installer_machine + cd dsfkit/installer_machine ``` 3. ```bash terraform init @@ -447,7 +447,7 @@ DO NOT DESTROY THE INSTALLER MACHINE UNTIL YOU ARE DONE AND DESTROYED ALL THE OT which appears in the first phase output. 8. After the installation is completed, run ssh to the installer machine using the `installer_machine_ssh_command` which appears in the first phase output. 9. ```bash - cd /dsfkit/deploy/examples/ + cd /dsfkit/examples/ ``` 10. Extract the web console admin password and DSF URL using: ```bash @@ -487,7 +487,7 @@ It is also possible to accommodate varying system requirements and deployments. 2. In the Git account assemble a new Terraform recipe that meets the necessary requirements. ```bash - cd deploy/examples/ + cd examples/ terraform init terraform appy -auto-approve ``` @@ -497,9 +497,9 @@ It is also possible to accommodate varying system requirements and deployments. To be able to create AWS resources inside any AWS Account, you need to provide an AWS User with the required permissions in order to run DSFKit Terraform. The permissions are separated to 3 different policies. Use the relevant policies according to your needs: -1. For general required permissions such as create an EC2, security group, etc., use the permissions specified here - [general required permissions](/deploy/permissions_samples/GeneralRequiredPermissions.txt). -2. In order to create network resources such as VPC, NAT Gateway, Internet Gateway etc., use the permissions specified here - [create network resources permissions](/deploy/permissions_samples/CreateNetworkResourcesPermissions.txt). -3. In order to onboard a MySQL RDS with CloudWatch configured, use the permissions specified here - [onboard MySQL RDS permissions](/deploy/permissions_samples/OnboardMysqlRdsPermissions.txt). +1. For general required permissions such as create an EC2, security group, etc., use the permissions specified here - [general required permissions](/permissions_samples/GeneralRequiredPermissions.txt). +2. In order to create network resources such as VPC, NAT Gateway, Internet Gateway etc., use the permissions specified here - [create network resources permissions](/permissions_samples/CreateNetworkResourcesPermissions.txt). +3. In order to onboard a MySQL RDS with CloudWatch configured, use the permissions specified here - [onboard MySQL RDS permissions](/permissions_samples/OnboardMysqlRdsPermissions.txt). ``` NOTE: The permissions specified in option 2 are irrelevant for customers who prefer to use their own network objects, such as VPC, NAT Gateway, Internet Gateway, etc. @@ -529,7 +529,7 @@ Please complete the following steps to completely uninstall the Imperva DSFKit a 1. cd into the installed “example”: ```bash - cd deploy/examples/ + cd examples/ ``` 2. Run: ```bash @@ -542,7 +542,7 @@ Please complete the following steps to completely uninstall the Imperva DSFKit a 1. ssh into the “Installer Machine”. 2. cd into the installed “example”: ```bash - cd /dsfkit/deploy/examples/ + cd /dsfkit/examples/ ``` 3. Run: ```bash @@ -559,7 +559,7 @@ Please complete the following steps to completely uninstall the Imperva DSFKit a #### Automated Installer Machine 1. Exit from the “Installer Machine”. -2. On the local machine, cd into deploy/installer_machine/. +2. On the local machine, cd into installer_machine/. 3. ```bash terraform destroy -auto-approve ``` diff --git a/deploy/examples/installation/multi_account_deployment/main.tf b/examples/installation/multi_account_deployment/main.tf similarity index 96% rename from deploy/examples/installation/multi_account_deployment/main.tf rename to examples/installation/multi_account_deployment/main.tf index 2e98d49d0..918b3616d 100644 --- a/deploy/examples/installation/multi_account_deployment/main.tf +++ b/examples/installation/multi_account_deployment/main.tf @@ -16,7 +16,7 @@ provider "aws" { } module "globals" { - source = "github.com/imperva/dsfkit//deploy/modules/core/globals" + source = "github.com/imperva/dsfkit//deploy/modules/core/globals?ref=1.3.0" } locals { @@ -39,13 +39,13 @@ locals { ############################## module "key_pair_hub" { - source = "github.com/imperva/dsfkit//deploy/modules/core/key_pair" + source = "github.com/imperva/dsfkit//deploy/modules/core/key_pair?ref=1.3.0" key_name_prefix = "imperva-dsf-hub" private_key_pem_filename = "ssh_keys/dsf_ssh_key-hub-${terraform.workspace}" } module "key_pair_gw" { - source = "github.com/imperva/dsfkit//deploy/modules/core/key_pair" + source = "github.com/imperva/dsfkit//deploy/modules/core/key_pair?ref=1.3.0" key_name_prefix = "imperva-dsf-gw" private_key_pem_filename = "ssh_keys/dsf_ssh_key-gw-${terraform.workspace}" providers = { @@ -58,7 +58,7 @@ module "key_pair_hub" { ############################## module "hub" { - source = "github.com/imperva/dsfkit//deploy/modules/hub" + source = "github.com/imperva/dsfkit//deploy/modules/hub?ref=1.3.0" friendly_name = join("-", [local.deployment_name_salted, "hub", "primary"]) subnet_id = var.subnet_hub binaries_location = local.tarball_location @@ -81,7 +81,7 @@ module "hub" { module "agentless_gw_group" { count = var.gw_count - source = "github.com/imperva/dsfkit//deploy/modules/agentless-gw" + source = "github.com/imperva/dsfkit//deploy/modules/agentless-gw?ref=1.3.0" friendly_name = join("-", [local.deployment_name_salted, "gw", count.index]) instance_type = var.gw_instance_type ami_name_tag = var.gw_ami_name @@ -112,7 +112,7 @@ module "hub" { module "federation" { for_each = { for idx, val in module.agentless_gw_group : idx => val } - source = "github.com/imperva/dsfkit//deploy/modules/federation" + source = "github.com/imperva/dsfkit//deploy/modules/federation?ref=1.3.0" gws_info = { gw_ip_address = each.value.private_address gw_private_ssh_key_path = module.key_pair_gw.key_pair_private_pem.filename diff --git a/deploy/examples/installation/multi_account_deployment/outputs.tf b/examples/installation/multi_account_deployment/outputs.tf similarity index 100% rename from deploy/examples/installation/multi_account_deployment/outputs.tf rename to examples/installation/multi_account_deployment/outputs.tf diff --git a/deploy/examples/installation/multi_account_deployment/variables.tf b/examples/installation/multi_account_deployment/variables.tf similarity index 100% rename from deploy/examples/installation/multi_account_deployment/variables.tf rename to examples/installation/multi_account_deployment/variables.tf diff --git a/deploy/examples/installation/multi_account_deployment/versions.tf b/examples/installation/multi_account_deployment/versions.tf similarity index 100% rename from deploy/examples/installation/multi_account_deployment/versions.tf rename to examples/installation/multi_account_deployment/versions.tf diff --git a/deploy/examples/octo/1-init/main.tf b/examples/octo/1-init/main.tf similarity index 100% rename from deploy/examples/octo/1-init/main.tf rename to examples/octo/1-init/main.tf diff --git a/deploy/examples/octo/1-init/outputs.tf b/examples/octo/1-init/outputs.tf similarity index 100% rename from deploy/examples/octo/1-init/outputs.tf rename to examples/octo/1-init/outputs.tf diff --git a/deploy/examples/octo/1-init/variables.template b/examples/octo/1-init/variables.template similarity index 100% rename from deploy/examples/octo/1-init/variables.template rename to examples/octo/1-init/variables.template diff --git a/deploy/examples/octo/2-dsf/main.tf b/examples/octo/2-dsf/main.tf similarity index 100% rename from deploy/examples/octo/2-dsf/main.tf rename to examples/octo/2-dsf/main.tf diff --git a/deploy/examples/octo/2-dsf/outputs.tf b/examples/octo/2-dsf/outputs.tf similarity index 100% rename from deploy/examples/octo/2-dsf/outputs.tf rename to examples/octo/2-dsf/outputs.tf diff --git a/deploy/examples/octo/2-dsf/variables.template b/examples/octo/2-dsf/variables.template similarity index 100% rename from deploy/examples/octo/2-dsf/variables.template rename to examples/octo/2-dsf/variables.template diff --git a/deploy/examples/octo/3-rds-aurora-mysql-cluster/init/init_db.sql.template b/examples/octo/3-rds-aurora-mysql-cluster/init/init_db.sql.template similarity index 100% rename from deploy/examples/octo/3-rds-aurora-mysql-cluster/init/init_db.sql.template rename to examples/octo/3-rds-aurora-mysql-cluster/init/init_db.sql.template diff --git a/deploy/examples/octo/3-rds-aurora-mysql-cluster/main.tf b/examples/octo/3-rds-aurora-mysql-cluster/main.tf similarity index 100% rename from deploy/examples/octo/3-rds-aurora-mysql-cluster/main.tf rename to examples/octo/3-rds-aurora-mysql-cluster/main.tf diff --git a/deploy/examples/octo/3-rds-aurora-mysql-cluster/variables.template b/examples/octo/3-rds-aurora-mysql-cluster/variables.template similarity index 100% rename from deploy/examples/octo/3-rds-aurora-mysql-cluster/variables.template rename to examples/octo/3-rds-aurora-mysql-cluster/variables.template diff --git a/deploy/examples/octo/3-rds-mysql-db/init/init_db.sql.template b/examples/octo/3-rds-mysql-db/init/init_db.sql.template similarity index 100% rename from deploy/examples/octo/3-rds-mysql-db/init/init_db.sql.template rename to examples/octo/3-rds-mysql-db/init/init_db.sql.template diff --git a/deploy/examples/octo/3-rds-mysql-db/init/isbt_db.sql b/examples/octo/3-rds-mysql-db/init/isbt_db.sql similarity index 100% rename from deploy/examples/octo/3-rds-mysql-db/init/isbt_db.sql rename to examples/octo/3-rds-mysql-db/init/isbt_db.sql diff --git a/deploy/examples/octo/3-rds-mysql-db/main.tf b/examples/octo/3-rds-mysql-db/main.tf similarity index 100% rename from deploy/examples/octo/3-rds-mysql-db/main.tf rename to examples/octo/3-rds-mysql-db/main.tf diff --git a/deploy/examples/octo/3-rds-mysql-db/variables.template b/examples/octo/3-rds-mysql-db/variables.template similarity index 100% rename from deploy/examples/octo/3-rds-mysql-db/variables.template rename to examples/octo/3-rds-mysql-db/variables.template diff --git a/deploy/examples/octo/4-dsf-db-onboarding-configs/main.tf b/examples/octo/4-dsf-db-onboarding-configs/main.tf similarity index 94% rename from deploy/examples/octo/4-dsf-db-onboarding-configs/main.tf rename to examples/octo/4-dsf-db-onboarding-configs/main.tf index 9656c6b2e..d437193f1 100644 --- a/deploy/examples/octo/4-dsf-db-onboarding-configs/main.tf +++ b/examples/octo/4-dsf-db-onboarding-configs/main.tf @@ -19,7 +19,7 @@ data "terraform_remote_state" "dsf" { } module "config-import-discover-dbs" { - source = "../../../modules/config-import-discover-dbs" + source = "../../../modules/aws/config-import-discover-dbs" dsf_iam_role_name = data.terraform_remote_state.dsf.outputs.gw1_iam_role hub_ip = data.terraform_remote_state.dsf.outputs.hub_ip hub_uuid = data.terraform_remote_state.dsf.outputs.hub_uuid diff --git a/deploy/examples/octo/4-dsf-db-onboarding-configs/variables.template b/examples/octo/4-dsf-db-onboarding-configs/variables.template similarity index 100% rename from deploy/examples/octo/4-dsf-db-onboarding-configs/variables.template rename to examples/octo/4-dsf-db-onboarding-configs/variables.template diff --git a/deploy/examples/octo/README_octo.md b/examples/octo/README_octo.md similarity index 100% rename from deploy/examples/octo/README_octo.md rename to examples/octo/README_octo.md diff --git a/deploy/examples/poc/basic_deployment/main.tf b/examples/poc/basic_deployment/main.tf similarity index 96% rename from deploy/examples/poc/basic_deployment/main.tf rename to examples/poc/basic_deployment/main.tf index 9fe6073a5..bf683dc0b 100644 --- a/deploy/examples/poc/basic_deployment/main.tf +++ b/examples/poc/basic_deployment/main.tf @@ -5,11 +5,11 @@ provider "aws" { } module "globals" { - source = "github.com/imperva/dsfkit//deploy/modules/core/globals" + source = "github.com/imperva/dsfkit//deploy/modules/core/globals?ref=1.3.0" } module "key_pair" { - source = "github.com/imperva/dsfkit//deploy/modules/core/key_pair" + source = "github.com/imperva/dsfkit//deploy/modules/core/key_pair?ref=1.3.0" key_name_prefix = "imperva-dsf-" private_key_pem_filename = "ssh_keys/dsf_ssh_key-${terraform.workspace}" } @@ -55,7 +55,7 @@ module "vpc" { ############################## module "hub" { - source = "github.com/imperva/dsfkit//deploy/modules/hub" + source = "github.com/imperva/dsfkit//deploy/modules/hub?ref=1.3.0" friendly_name = join("-", [local.deployment_name_salted, "hub", "primary"]) subnet_id = module.vpc.public_subnets[0] binaries_location = local.tarball_location @@ -78,7 +78,7 @@ module "hub" { module "agentless_gw_group" { count = var.gw_count - source = "github.com/imperva/dsfkit//deploy/modules/agentless-gw" + source = "github.com/imperva/dsfkit//deploy/modules/agentless-gw?ref=1.3.0" friendly_name = join("-", [local.deployment_name_salted, "gw", count.index]) subnet_id = module.vpc.private_subnets[0] ebs = var.gw_group_ebs_details @@ -106,7 +106,7 @@ module "agentless_gw_group" { module "federation" { for_each = { for idx, val in module.agentless_gw_group : idx => val } - source = "github.com/imperva/dsfkit//deploy/modules/federation" + source = "github.com/imperva/dsfkit//deploy/modules/federation?ref=1.3.0" gws_info = { gw_ip_address = each.value.private_address gw_private_ssh_key_path = module.key_pair.key_pair_private_pem.filename @@ -125,14 +125,14 @@ module "federation" { module "rds_mysql" { count = 1 - source = "github.com/imperva/dsfkit//deploy/modules/rds-mysql-db" + source = "github.com/imperva/dsfkit//deploy/modules/rds-mysql-db?ref=1.3.0" rds_subnet_ids = module.vpc.public_subnets security_group_ingress_cidrs = local.workstation_cidr } module "db_onboarding" { for_each = { for idx, val in module.rds_mysql : idx => val } - source = "github.com/imperva/dsfkit//deploy/modules/db-onboarder" + source = "github.com/imperva/dsfkit//deploy/modules/db-onboarder?ref=1.3.0" sonar_version = module.globals.tarball_location.version hub_info = { hub_ip_address = module.hub.public_address @@ -157,7 +157,7 @@ module "db_onboarding" { } module "statistics" { - source = "github.com/imperva/dsfkit//deploy/modules/statistics" + source = "github.com/imperva/dsfkit//deploy/modules/statistics?ref=1.3.0" } output "db_details" { diff --git a/deploy/examples/poc/basic_deployment/outputs.tf b/examples/poc/basic_deployment/outputs.tf similarity index 100% rename from deploy/examples/poc/basic_deployment/outputs.tf rename to examples/poc/basic_deployment/outputs.tf diff --git a/deploy/examples/poc/basic_deployment/variables.tf b/examples/poc/basic_deployment/variables.tf similarity index 100% rename from deploy/examples/poc/basic_deployment/variables.tf rename to examples/poc/basic_deployment/variables.tf diff --git a/deploy/examples/poc/basic_deployment/versions.tf b/examples/poc/basic_deployment/versions.tf similarity index 100% rename from deploy/examples/poc/basic_deployment/versions.tf rename to examples/poc/basic_deployment/versions.tf diff --git a/deploy/examples/poc/hadr_deployment/main.tf b/examples/poc/hadr_deployment/main.tf similarity index 96% rename from deploy/examples/poc/hadr_deployment/main.tf rename to examples/poc/hadr_deployment/main.tf index a56fcb088..cd35da967 100644 --- a/deploy/examples/poc/hadr_deployment/main.tf +++ b/examples/poc/hadr_deployment/main.tf @@ -5,11 +5,11 @@ provider "aws" { } module "globals" { - source = "github.com/imperva/dsfkit//deploy/modules/core/globals" + source = "github.com/imperva/dsfkit//deploy/modules/core/globals?ref=1.3.0" } module "key_pair" { - source = "github.com/imperva/dsfkit//deploy/modules/core/key_pair" + source = "github.com/imperva/dsfkit//deploy/modules/core/key_pair?ref=1.3.0" key_name_prefix = "imperva-dsf-" private_key_pem_filename = "ssh_keys/dsf_ssh_key-${terraform.workspace}" } @@ -54,7 +54,7 @@ module "vpc" { # Generating deployment ############################## module "hub" { - source = "github.com/imperva/dsfkit//deploy/modules/hub" + source = "github.com/imperva/dsfkit//deploy/modules/hub?ref=1.3.0" friendly_name = join("-", [local.deployment_name_salted, "hub", "primary"]) subnet_id = module.vpc.public_subnets[0] binaries_location = local.tarball_location @@ -76,7 +76,7 @@ module "hub" { } module "hub_secondary" { - source = "github.com/imperva/dsfkit//deploy/modules/hub" + source = "github.com/imperva/dsfkit//deploy/modules/hub?ref=1.3.0" friendly_name = join("-", [local.deployment_name_salted, "hub", "secondary"]) subnet_id = module.vpc.public_subnets[1] binaries_location = local.tarball_location @@ -102,7 +102,7 @@ module "hub_secondary" { module "agentless_gw_group" { count = var.gw_count - source = "github.com/imperva/dsfkit//deploy/modules/agentless-gw" + source = "github.com/imperva/dsfkit//deploy/modules/agentless-gw?ref=1.3.0" friendly_name = join("-", [local.deployment_name_salted, "gw", count.index]) subnet_id = module.vpc.private_subnets[0] ebs = var.gw_group_ebs_details @@ -139,7 +139,7 @@ locals { module "federation" { count = length(local.hub_gw_combinations) - source = "github.com/imperva/dsfkit//deploy/modules/federation" + source = "github.com/imperva/dsfkit//deploy/modules/federation?ref=1.3.0" gws_info = { gw_ip_address = local.hub_gw_combinations[count.index][1].private_address gw_private_ssh_key_path = module.key_pair.key_pair_private_pem.filename @@ -158,7 +158,7 @@ module "federation" { } module "hadr" { - source = "github.com/imperva/dsfkit//deploy/modules/hadr" + source = "github.com/imperva/dsfkit//deploy/modules/hadr?ref=1.3.0" dsf_hub_primary_public_ip = module.hub.public_address dsf_hub_primary_private_ip = module.hub.private_address dsf_hub_secondary_public_ip = module.hub_secondary.public_address @@ -174,14 +174,14 @@ module "hadr" { module "rds_mysql" { count = 1 - source = "github.com/imperva/dsfkit//deploy/modules/rds-mysql-db" + source = "github.com/imperva/dsfkit//deploy/modules/rds-mysql-db?ref=1.3.0" rds_subnet_ids = module.vpc.public_subnets security_group_ingress_cidrs = local.workstation_cidr } module "db_onboarding" { for_each = { for idx, val in module.rds_mysql : idx => val } - source = "github.com/imperva/dsfkit//deploy/modules/db-onboarder" + source = "github.com/imperva/dsfkit//deploy/modules/db-onboarder?ref=1.3.0" sonar_version = module.globals.tarball_location.version hub_info = { hub_ip_address = module.hub.public_address @@ -207,7 +207,7 @@ module "db_onboarding" { } module "statistics" { - source = "github.com/imperva/dsfkit//deploy/modules/statistics" + source = "github.com/imperva/dsfkit//deploy/modules/statistics?ref=1.3.0" } output "db_details" { diff --git a/deploy/examples/poc/hadr_deployment/outputs.tf b/examples/poc/hadr_deployment/outputs.tf similarity index 100% rename from deploy/examples/poc/hadr_deployment/outputs.tf rename to examples/poc/hadr_deployment/outputs.tf diff --git a/deploy/examples/poc/hadr_deployment/variables.tf b/examples/poc/hadr_deployment/variables.tf similarity index 100% rename from deploy/examples/poc/hadr_deployment/variables.tf rename to examples/poc/hadr_deployment/variables.tf diff --git a/deploy/examples/poc/hadr_deployment/versions.tf b/examples/poc/hadr_deployment/versions.tf similarity index 100% rename from deploy/examples/poc/hadr_deployment/versions.tf rename to examples/poc/hadr_deployment/versions.tf diff --git a/deploy/installer_machine/main.tf b/installer_machine/main.tf similarity index 98% rename from deploy/installer_machine/main.tf rename to installer_machine/main.tf index d04d305e6..e90e39b5f 100644 --- a/deploy/installer_machine/main.tf +++ b/installer_machine/main.tf @@ -5,7 +5,7 @@ provider "aws" { } module "globals" { - source = "../modules/core/globals" + source = "../modules/aws/core/globals" } data "http" "myip" { diff --git a/deploy/installer_machine/outputs.tf b/installer_machine/outputs.tf similarity index 100% rename from deploy/installer_machine/outputs.tf rename to installer_machine/outputs.tf diff --git a/deploy/installer_machine/prepare_installer.tpl b/installer_machine/prepare_installer.tpl similarity index 94% rename from deploy/installer_machine/prepare_installer.tpl rename to installer_machine/prepare_installer.tpl index 16bb8a339..bddf4b776 100644 --- a/deploy/installer_machine/prepare_installer.tpl +++ b/installer_machine/prepare_installer.tpl @@ -16,7 +16,7 @@ unzip awscliv2.zip export PATH=$PATH:/usr/local/bin git clone https://github.com/imperva/dsfkit.git -cd /dsfkit/deploy/examples/${example_name} +cd /dsfkit/examples/${example_name} export AWS_ACCESS_KEY_ID=${access_key} export AWS_SECRET_ACCESS_KEY=${secret_key} diff --git a/deploy/installer_machine/variables.tf b/installer_machine/variables.tf similarity index 100% rename from deploy/installer_machine/variables.tf rename to installer_machine/variables.tf diff --git a/deploy/installer_machine/versions.tf b/installer_machine/versions.tf similarity index 100% rename from deploy/installer_machine/versions.tf rename to installer_machine/versions.tf diff --git a/deploy/modules/agentless-gw/README.md b/modules/aws/agentless-gw/README.md similarity index 96% rename from deploy/modules/agentless-gw/README.md rename to modules/aws/agentless-gw/README.md index 1cc6cd2b8..077814f0c 100644 --- a/deploy/modules/agentless-gw/README.md +++ b/modules/aws/agentless-gw/README.md @@ -57,11 +57,11 @@ provider "aws" { } module "globals" { - source = "github.com/imperva/dsfkit//deploy/modules/core/globals" + source = "github.com/imperva/dsfkit//deploy/modules/core/globals?ref=1.3.0" } module "dsf_gw" { - source = "github.com/imperva/dsfkit//deploy/modules/agentless-gw" + source = "github.com/imperva/dsfkit//deploy/modules/agentless-gw?ref=1.3.0" subnet_id = "${aws_subnet.example.id}" ssh_key_pair = { @@ -86,12 +86,12 @@ module "dsf_gw" { } ``` -To see a complete example of how to use this module in a DSF deployment with other modules, check out the [examples](../../examples/) directory. +To see a complete example of how to use this module in a DSF deployment with other modules, check out the [examples](../../../examples/) directory. If you want to use a specific version of the module, you can specify the version by adding the ref parameter to the source URL. For example: ``` module "dsf_gw" { - source = "github.com/imperva/dsfkit//deploy/modules/agentless-gw?ref=1.2.0" + source = "github.com/imperva/dsfkit//deploy/modules/agentless-gw?ref=1.3.0" } ``` diff --git a/deploy/modules/agentless-gw/iam_role.tf b/modules/aws/agentless-gw/iam_role.tf similarity index 100% rename from deploy/modules/agentless-gw/iam_role.tf rename to modules/aws/agentless-gw/iam_role.tf diff --git a/deploy/modules/agentless-gw/main.tf b/modules/aws/agentless-gw/main.tf similarity index 95% rename from deploy/modules/agentless-gw/main.tf rename to modules/aws/agentless-gw/main.tf index 6e04c15b9..ed9254d21 100644 --- a/deploy/modules/agentless-gw/main.tf +++ b/modules/aws/agentless-gw/main.tf @@ -5,7 +5,7 @@ resource "random_string" "gw_id" { } module "gw_instance" { - source = "../../modules/sonar-base-instance" + source = "../../../modules/aws/sonar-base-instance" resource_type = "gw" name = var.friendly_name subnet_id = var.subnet_id diff --git a/deploy/modules/agentless-gw/outputs.tf b/modules/aws/agentless-gw/outputs.tf similarity index 100% rename from deploy/modules/agentless-gw/outputs.tf rename to modules/aws/agentless-gw/outputs.tf diff --git a/deploy/modules/agentless-gw/variables.tf b/modules/aws/agentless-gw/variables.tf similarity index 100% rename from deploy/modules/agentless-gw/variables.tf rename to modules/aws/agentless-gw/variables.tf diff --git a/deploy/modules/agentless-gw/versions.tf b/modules/aws/agentless-gw/versions.tf similarity index 100% rename from deploy/modules/agentless-gw/versions.tf rename to modules/aws/agentless-gw/versions.tf diff --git a/deploy/modules/config-import-discover-dbs/main.tf b/modules/aws/config-import-discover-dbs/main.tf similarity index 100% rename from deploy/modules/config-import-discover-dbs/main.tf rename to modules/aws/config-import-discover-dbs/main.tf diff --git a/deploy/modules/config-import-discover-dbs/variables.tf b/modules/aws/config-import-discover-dbs/variables.tf similarity index 100% rename from deploy/modules/config-import-discover-dbs/variables.tf rename to modules/aws/config-import-discover-dbs/variables.tf diff --git a/deploy/modules/config-import-discover-dbs/versions.tf b/modules/aws/config-import-discover-dbs/versions.tf similarity index 100% rename from deploy/modules/config-import-discover-dbs/versions.tf rename to modules/aws/config-import-discover-dbs/versions.tf diff --git a/deploy/modules/config-servicenow-cmdb-mx/main.tf b/modules/aws/config-servicenow-cmdb-mx/main.tf similarity index 100% rename from deploy/modules/config-servicenow-cmdb-mx/main.tf rename to modules/aws/config-servicenow-cmdb-mx/main.tf diff --git a/deploy/modules/config-servicenow-cmdb-mx/variables.tf b/modules/aws/config-servicenow-cmdb-mx/variables.tf similarity index 100% rename from deploy/modules/config-servicenow-cmdb-mx/variables.tf rename to modules/aws/config-servicenow-cmdb-mx/variables.tf diff --git a/deploy/modules/config-servicenow-cmdb-mx/versions.tf b/modules/aws/config-servicenow-cmdb-mx/versions.tf similarity index 100% rename from deploy/modules/config-servicenow-cmdb-mx/versions.tf rename to modules/aws/config-servicenow-cmdb-mx/versions.tf diff --git a/deploy/modules/core/globals/main.tf b/modules/aws/core/globals/main.tf similarity index 100% rename from deploy/modules/core/globals/main.tf rename to modules/aws/core/globals/main.tf diff --git a/deploy/modules/core/globals/outputs.tf b/modules/aws/core/globals/outputs.tf similarity index 100% rename from deploy/modules/core/globals/outputs.tf rename to modules/aws/core/globals/outputs.tf diff --git a/deploy/modules/core/globals/variables.tf b/modules/aws/core/globals/variables.tf similarity index 100% rename from deploy/modules/core/globals/variables.tf rename to modules/aws/core/globals/variables.tf diff --git a/deploy/modules/core/globals/versions.tf b/modules/aws/core/globals/versions.tf similarity index 100% rename from deploy/modules/core/globals/versions.tf rename to modules/aws/core/globals/versions.tf diff --git a/deploy/modules/core/key_pair/main.tf b/modules/aws/core/key_pair/main.tf similarity index 100% rename from deploy/modules/core/key_pair/main.tf rename to modules/aws/core/key_pair/main.tf diff --git a/deploy/modules/core/key_pair/outputs.tf b/modules/aws/core/key_pair/outputs.tf similarity index 100% rename from deploy/modules/core/key_pair/outputs.tf rename to modules/aws/core/key_pair/outputs.tf diff --git a/deploy/modules/core/key_pair/variables.tf b/modules/aws/core/key_pair/variables.tf similarity index 100% rename from deploy/modules/core/key_pair/variables.tf rename to modules/aws/core/key_pair/variables.tf diff --git a/deploy/modules/db-onboarder/main.tf b/modules/aws/db-onboarder/main.tf similarity index 100% rename from deploy/modules/db-onboarder/main.tf rename to modules/aws/db-onboarder/main.tf diff --git a/deploy/modules/db-onboarder/onboard.tpl b/modules/aws/db-onboarder/onboard.tpl similarity index 100% rename from deploy/modules/db-onboarder/onboard.tpl rename to modules/aws/db-onboarder/onboard.tpl diff --git a/deploy/modules/db-onboarder/variables.tf b/modules/aws/db-onboarder/variables.tf similarity index 100% rename from deploy/modules/db-onboarder/variables.tf rename to modules/aws/db-onboarder/variables.tf diff --git a/deploy/modules/db-onboarder/versions.tf b/modules/aws/db-onboarder/versions.tf similarity index 100% rename from deploy/modules/db-onboarder/versions.tf rename to modules/aws/db-onboarder/versions.tf diff --git a/deploy/modules/federation/federate_gw.tpl b/modules/aws/federation/federate_gw.tpl similarity index 100% rename from deploy/modules/federation/federate_gw.tpl rename to modules/aws/federation/federate_gw.tpl diff --git a/deploy/modules/federation/federate_hub.tpl b/modules/aws/federation/federate_hub.tpl similarity index 100% rename from deploy/modules/federation/federate_hub.tpl rename to modules/aws/federation/federate_hub.tpl diff --git a/deploy/modules/federation/grab_lock.sh b/modules/aws/federation/grab_lock.sh similarity index 100% rename from deploy/modules/federation/grab_lock.sh rename to modules/aws/federation/grab_lock.sh diff --git a/deploy/modules/federation/main.tf b/modules/aws/federation/main.tf similarity index 100% rename from deploy/modules/federation/main.tf rename to modules/aws/federation/main.tf diff --git a/deploy/modules/federation/variables.tf b/modules/aws/federation/variables.tf similarity index 100% rename from deploy/modules/federation/variables.tf rename to modules/aws/federation/variables.tf diff --git a/deploy/modules/federation/versions.tf b/modules/aws/federation/versions.tf similarity index 100% rename from deploy/modules/federation/versions.tf rename to modules/aws/federation/versions.tf diff --git a/deploy/modules/hadr/main.tf b/modules/aws/hadr/main.tf similarity index 100% rename from deploy/modules/hadr/main.tf rename to modules/aws/hadr/main.tf diff --git a/deploy/modules/hadr/variables.tf b/modules/aws/hadr/variables.tf similarity index 100% rename from deploy/modules/hadr/variables.tf rename to modules/aws/hadr/variables.tf diff --git a/deploy/modules/hadr/versions.tf b/modules/aws/hadr/versions.tf similarity index 100% rename from deploy/modules/hadr/versions.tf rename to modules/aws/hadr/versions.tf diff --git a/deploy/modules/hub/README.md b/modules/aws/hub/README.md similarity index 97% rename from deploy/modules/hub/README.md rename to modules/aws/hub/README.md index 915c3aa84..8ef969dd5 100644 --- a/deploy/modules/hub/README.md +++ b/modules/aws/hub/README.md @@ -60,11 +60,11 @@ provider "aws" { } module "globals" { - source = "github.com/imperva/dsfkit//deploy/modules/core/globals" + source = "github.com/imperva/dsfkit//deploy/modules/core/globals?ref=1.3.0" } module "dsf_hub" { - source = "github.com/imperva/dsfkit//deploy/modules/hub" + source = "github.com/imperva/dsfkit//deploy/modules/hub?ref=1.3.0" subnet_id = "${aws_subnet.example.id}" ssh_key_pair = { @@ -88,12 +88,12 @@ module "dsf_hub" { } ``` -To see a complete example of how to use this module in a DSF deployment with other modules, check out the [examples](../../examples/) directory. +To see a complete example of how to use this module in a DSF deployment with other modules, check out the [examples](../../../examples/) directory. If you want to use a specific version of the module, you can specify the version by adding the ref parameter to the source URL. For example: ``` module "dsf_hub" { - source = "github.com/imperva/dsfkit//deploy/modules/hub?ref=1.2.0" + source = "github.com/imperva/dsfkit//deploy/modules/hub?ref=1.3.0" } ``` diff --git a/deploy/modules/hub/iam_role.tf b/modules/aws/hub/iam_role.tf similarity index 100% rename from deploy/modules/hub/iam_role.tf rename to modules/aws/hub/iam_role.tf diff --git a/deploy/modules/hub/main.tf b/modules/aws/hub/main.tf similarity index 95% rename from deploy/modules/hub/main.tf rename to modules/aws/hub/main.tf index 85220e8cc..efef7d93c 100644 --- a/deploy/modules/hub/main.tf +++ b/modules/aws/hub/main.tf @@ -3,7 +3,7 @@ ################################# module "hub_instance" { - source = "../../modules/sonar-base-instance" + source = "../../../modules/aws/sonar-base-instance" resource_type = "hub" name = var.friendly_name subnet_id = var.subnet_id diff --git a/deploy/modules/hub/outputs.tf b/modules/aws/hub/outputs.tf similarity index 100% rename from deploy/modules/hub/outputs.tf rename to modules/aws/hub/outputs.tf diff --git a/deploy/modules/hub/secret.tf b/modules/aws/hub/secret.tf similarity index 100% rename from deploy/modules/hub/secret.tf rename to modules/aws/hub/secret.tf diff --git a/deploy/modules/hub/variables.tf b/modules/aws/hub/variables.tf similarity index 100% rename from deploy/modules/hub/variables.tf rename to modules/aws/hub/variables.tf diff --git a/deploy/modules/hub/versions.tf b/modules/aws/hub/versions.tf similarity index 100% rename from deploy/modules/hub/versions.tf rename to modules/aws/hub/versions.tf diff --git a/deploy/modules/rds-aurora-mysql/main.tf b/modules/aws/rds-aurora-mysql/main.tf similarity index 100% rename from deploy/modules/rds-aurora-mysql/main.tf rename to modules/aws/rds-aurora-mysql/main.tf diff --git a/deploy/modules/rds-aurora-mysql/output.tf b/modules/aws/rds-aurora-mysql/output.tf similarity index 100% rename from deploy/modules/rds-aurora-mysql/output.tf rename to modules/aws/rds-aurora-mysql/output.tf diff --git a/deploy/modules/rds-aurora-mysql/variables.tf b/modules/aws/rds-aurora-mysql/variables.tf similarity index 100% rename from deploy/modules/rds-aurora-mysql/variables.tf rename to modules/aws/rds-aurora-mysql/variables.tf diff --git a/deploy/modules/rds-aurora-mysql/versions.tf b/modules/aws/rds-aurora-mysql/versions.tf similarity index 100% rename from deploy/modules/rds-aurora-mysql/versions.tf rename to modules/aws/rds-aurora-mysql/versions.tf diff --git a/deploy/modules/rds-mysql-db/main.tf b/modules/aws/rds-mysql-db/main.tf similarity index 100% rename from deploy/modules/rds-mysql-db/main.tf rename to modules/aws/rds-mysql-db/main.tf diff --git a/deploy/modules/rds-mysql-db/output.tf b/modules/aws/rds-mysql-db/output.tf similarity index 100% rename from deploy/modules/rds-mysql-db/output.tf rename to modules/aws/rds-mysql-db/output.tf diff --git a/deploy/modules/rds-mysql-db/variables.tf b/modules/aws/rds-mysql-db/variables.tf similarity index 100% rename from deploy/modules/rds-mysql-db/variables.tf rename to modules/aws/rds-mysql-db/variables.tf diff --git a/deploy/modules/rds-mysql-db/versions.tf b/modules/aws/rds-mysql-db/versions.tf similarity index 100% rename from deploy/modules/rds-mysql-db/versions.tf rename to modules/aws/rds-mysql-db/versions.tf diff --git a/deploy/modules/sonar-base-instance/main.tf b/modules/aws/sonar-base-instance/main.tf similarity index 100% rename from deploy/modules/sonar-base-instance/main.tf rename to modules/aws/sonar-base-instance/main.tf diff --git a/deploy/modules/sonar-base-instance/outputs.tf b/modules/aws/sonar-base-instance/outputs.tf similarity index 100% rename from deploy/modules/sonar-base-instance/outputs.tf rename to modules/aws/sonar-base-instance/outputs.tf diff --git a/deploy/modules/sonar-base-instance/setup.tpl b/modules/aws/sonar-base-instance/setup.tpl similarity index 100% rename from deploy/modules/sonar-base-instance/setup.tpl rename to modules/aws/sonar-base-instance/setup.tpl diff --git a/deploy/modules/sonar-base-instance/sg.tf b/modules/aws/sonar-base-instance/sg.tf similarity index 100% rename from deploy/modules/sonar-base-instance/sg.tf rename to modules/aws/sonar-base-instance/sg.tf diff --git a/deploy/modules/sonar-base-instance/userdata.tf b/modules/aws/sonar-base-instance/userdata.tf similarity index 100% rename from deploy/modules/sonar-base-instance/userdata.tf rename to modules/aws/sonar-base-instance/userdata.tf diff --git a/deploy/modules/sonar-base-instance/variables.tf b/modules/aws/sonar-base-instance/variables.tf similarity index 100% rename from deploy/modules/sonar-base-instance/variables.tf rename to modules/aws/sonar-base-instance/variables.tf diff --git a/deploy/modules/sonar-base-instance/versions.tf b/modules/aws/sonar-base-instance/versions.tf similarity index 100% rename from deploy/modules/sonar-base-instance/versions.tf rename to modules/aws/sonar-base-instance/versions.tf diff --git a/deploy/modules/statistics/main.tf b/modules/aws/statistics/main.tf similarity index 94% rename from deploy/modules/statistics/main.tf rename to modules/aws/statistics/main.tf index 9ef7dd431..ccaba726a 100644 --- a/deploy/modules/statistics/main.tf +++ b/modules/aws/statistics/main.tf @@ -1,5 +1,5 @@ module "globals" { - source = "../../modules/core/globals" + source = "../../../modules/aws/core/globals" } data "aws_caller_identity" "current" {} diff --git a/deploy/modules/statistics/statistics.tpl b/modules/aws/statistics/statistics.tpl similarity index 100% rename from deploy/modules/statistics/statistics.tpl rename to modules/aws/statistics/statistics.tpl diff --git a/deploy/permissions_samples/CreateNetworkResourcesPermissions.txt b/permissions_samples/CreateNetworkResourcesPermissions.txt similarity index 100% rename from deploy/permissions_samples/CreateNetworkResourcesPermissions.txt rename to permissions_samples/CreateNetworkResourcesPermissions.txt diff --git a/deploy/permissions_samples/GeneralRequiredPermissions.txt b/permissions_samples/GeneralRequiredPermissions.txt similarity index 100% rename from deploy/permissions_samples/GeneralRequiredPermissions.txt rename to permissions_samples/GeneralRequiredPermissions.txt diff --git a/deploy/permissions_samples/OnboardMysqlRdsPermissions.txt b/permissions_samples/OnboardMysqlRdsPermissions.txt similarity index 100% rename from deploy/permissions_samples/OnboardMysqlRdsPermissions.txt rename to permissions_samples/OnboardMysqlRdsPermissions.txt