From e7921e42cb508a1f040fba934d5ee874ab6d4e94 Mon Sep 17 00:00:00 2001 From: guyguyr23 <62642694+guyguyr23@users.noreply.github.com> Date: Mon, 2 Oct 2023 17:21:07 +0300 Subject: [PATCH 1/2] Update test.yml --- .github/workflows/test.yml | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 165a4db6..5d479626 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -20,6 +20,11 @@ jobs: persist-credentials: false fetch-depth: 0 + - name: echo + run: | + echo ${{ github.event.pull_request.head.repo.full_name }} + echo ${{ github.repository }} + - name: Get changed packages id: get-changed-packages run: | @@ -38,6 +43,7 @@ jobs: - name: Checkout uses: actions/checkout@v3 + - name: Check for missing test directories run: | chmod +x tests/compare_directories_test.sh @@ -49,7 +55,7 @@ jobs: echo "$output" exit 1 fi - + - name: Compare variables in test file and in the module run: | if [[ ${{ matrix.package }} != "locals_variables" ]]; then @@ -63,30 +69,34 @@ jobs: exit 1 fi fi - - - name: Configure AWS credentials + + - if: ${{ github.event.pull_request.head.repo.full_name == github.repository }} + name: Configure AWS credentials env: AWS_ACCESS_KEY_ID: ${{ secrets.TESTING_ACCESS_KEY }} AWS_SECRET_ACCESS_KEY: ${{ secrets.TESTING_SECRET_ACCESS_KEY }} run: | echo "AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}" >> $GITHUB_ENV echo "AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}" >> $GITHUB_ENV - - - name: Terraform init + + - if: ${{ github.event.pull_request.head.repo.full_name == github.repository }} + name: Terraform init run: | if [[ ${{ matrix.package }} != "locals_variables" ]];then cd "tests/${{ matrix.package }}" terraform init fi - - - name: Terraform validate + + - if: ${{ github.event.pull_request.head.repo.full_name == github.repository }} + name: Terraform validate run: | if [[ ${{ matrix.package }} != "locals_variables" ]];then cd "tests/${{ matrix.package }}" terraform validate fi - - - name: Terraform plan + + - if: ${{ github.event.pull_request.head.repo.full_name == github.repository }} + name: Terraform plan run: | if [[ ${{ matrix.package }} != "locals_variables" ]];then cd "tests/${{ matrix.package }}" From b90283422411122b02336d753e6933625abd0595 Mon Sep 17 00:00:00 2001 From: guyguyr23 <62642694+guyguyr23@users.noreply.github.com> Date: Mon, 2 Oct 2023 17:21:41 +0300 Subject: [PATCH 2/2] Update main.tf --- modules/s3/main.tf | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/s3/main.tf b/modules/s3/main.tf index f57d3e70..b5b801e6 100644 --- a/modules/s3/main.tf +++ b/modules/s3/main.tf @@ -5,6 +5,8 @@ module "locals" { random_string = random_string.this.result } + + locals { sns_enable = var.integration_type == "s3-sns" || var.integration_type == "cloudtrail-sns" ? true : false }