diff --git a/.github/workflows/terraform_apply.yml b/.github/workflows/terraform_apply.yml index 7dc8583db..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 0a65bec58..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_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() }} diff --git a/.github/workflows/terraform_apply_simple_cli.yml b/.github/workflows/terraform_apply_simple_cli.yml index 0c2844255..886f3146c 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: {} @@ -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: ./examples/poc/basic_deployment TF_WORKSPACE: simple_cli AWS_REGION: eu-west-2 AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} @@ -30,8 +30,24 @@ permissions: jobs: terraform: - name: 'Terraform' + + strategy: + matrix: + workspace: [simple_cli] + include: + - workspace: simple_cli + example_dir: ./examples/poc/basic_deployment + aws_region: eu-west-2 + - workspace: hadr_cli + example_dir: ./examples/poc/hadr_deployment + 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 @@ -45,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: | @@ -107,7 +123,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_plan.yml b/.github/workflows/terraform_plan.yml index 9583a31b3..0ebbf6429 100644 --- a/.github/workflows/terraform_plan.yml +++ b/.github/workflows/terraform_plan.yml @@ -10,9 +10,11 @@ on: env: TF_WARN_OUTPUT_ERRORS: 1 - TF_WORKSPACE: dsfkit-ci-cd TF_CLI_ARGS: "-no-color" TF_INPUT: 0 + 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 @@ -28,37 +30,39 @@ jobs: run: shell: bash + strategy: + matrix: + example: ['./examples/poc/basic_deployment', './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 -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 - 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 - run: terraform 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=${{ matrix.example }} init - - name: Terraform Validate - run: terraform validate + - name: Terraform Validate + run: terraform -chdir=${{ matrix.example }} validate - # Checks that all Terraform configuration files adhere to a canonical format - - name: Terraform Format - run: terraform fmt -check - continue-on-error: true + # 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 plan + # Generates an execution plan for Terraform + - name: Terraform Plan (simple) + run: terraform -chdir=${{ matrix.example }} plan - - name: Terraform Plan (hadr) - run: TF_WORKSPACE=dsfkit-ci-cd-hadr terraform plan diff --git a/.github/workflows/terraform_run_test.yml b/.github/workflows/terraform_run_test.yml index 185ec9674..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/se_demo + EXAMPLE_DIR: ./examples/poc/basic_deployment TF_WORKSPACE: run_test AWS_REGION: ap-southeast-2 AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} @@ -22,8 +22,24 @@ permissions: jobs: terraform: - name: 'Terraform' + + strategy: + matrix: + workspace: [simple_cli] + include: + - workspace: simple_cli + example_dir: ./examples/poc/basic_deployment + aws_region: eu-west-2 + - workspace: hadr_cli + example_dir: ./examples/poc/hadr_deployment + 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 @@ -37,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() @@ -51,33 +67,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 +115,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/.github/workflows/terraform_simple_cli_dev_nightly.yml b/.github/workflows/terraform_simple_cli_dev_nightly.yml index 54a24b46a..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/se_demo + 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 b6178e5f5..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/se_demo/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/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 “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 “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/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,10 +374,10 @@ 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 (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/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 @@ -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: @@ -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/se_demo + 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/multi_account/main.tf b/examples/installation/multi_account_deployment/main.tf similarity index 96% rename from deploy/examples/multi_account/main.tf rename to examples/installation/multi_account_deployment/main.tf index 2e98d49d0..918b3616d 100644 --- a/deploy/examples/multi_account/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/multi_account/outputs.tf b/examples/installation/multi_account_deployment/outputs.tf similarity index 100% rename from deploy/examples/multi_account/outputs.tf rename to examples/installation/multi_account_deployment/outputs.tf diff --git a/deploy/examples/multi_account/variables.tf b/examples/installation/multi_account_deployment/variables.tf similarity index 100% rename from deploy/examples/multi_account/variables.tf rename to examples/installation/multi_account_deployment/variables.tf diff --git a/deploy/examples/multi_account/versions.tf b/examples/installation/multi_account_deployment/versions.tf similarity index 100% rename from deploy/examples/multi_account/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/se_demo/main.tf b/examples/poc/basic_deployment/main.tf similarity index 96% rename from deploy/examples/se_demo/main.tf rename to examples/poc/basic_deployment/main.tf index 9fe6073a5..bf683dc0b 100644 --- a/deploy/examples/se_demo/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/se_demo/outputs.tf b/examples/poc/basic_deployment/outputs.tf similarity index 98% rename from deploy/examples/se_demo/outputs.tf rename to examples/poc/basic_deployment/outputs.tf index bcc978325..3d9b512b4 100644 --- a/deploy/examples/se_demo/outputs.tf +++ b/examples/poc/basic_deployment/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) diff --git a/deploy/examples/se_demo/variables.tf b/examples/poc/basic_deployment/variables.tf similarity index 100% rename from deploy/examples/se_demo/variables.tf rename to examples/poc/basic_deployment/variables.tf diff --git a/deploy/examples/se_demo/versions.tf b/examples/poc/basic_deployment/versions.tf similarity index 100% rename from deploy/examples/se_demo/versions.tf rename to examples/poc/basic_deployment/versions.tf diff --git a/deploy/examples/se_demo_hadr/main.tf b/examples/poc/hadr_deployment/main.tf similarity index 96% rename from deploy/examples/se_demo_hadr/main.tf rename to examples/poc/hadr_deployment/main.tf index a56fcb088..cd35da967 100644 --- a/deploy/examples/se_demo_hadr/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/se_demo_hadr/outputs.tf b/examples/poc/hadr_deployment/outputs.tf similarity index 100% rename from deploy/examples/se_demo_hadr/outputs.tf rename to examples/poc/hadr_deployment/outputs.tf diff --git a/deploy/examples/se_demo_hadr/variables.tf b/examples/poc/hadr_deployment/variables.tf similarity index 100% rename from deploy/examples/se_demo_hadr/variables.tf rename to examples/poc/hadr_deployment/variables.tf diff --git a/deploy/examples/se_demo_hadr/versions.tf b/examples/poc/hadr_deployment/versions.tf similarity index 100% rename from deploy/examples/se_demo_hadr/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 93% rename from deploy/installer_machine/variables.tf rename to installer_machine/variables.tf index 08204a6fd..75ba23c57 100644 --- a/deploy/installer_machine/variables.tf +++ b/installer_machine/variables.tf @@ -19,7 +19,7 @@ variable "_3_aws_region" { variable "example_name" { type = string - default = "se_demo" + default = "poc/basic_deployment" } variable "web_console_cidr" { 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