diff --git a/sqs/.github/CODEOWNERS b/sqs/.github/CODEOWNERS deleted file mode 100644 index 8ff0a1e..0000000 --- a/sqs/.github/CODEOWNERS +++ /dev/null @@ -1,5 +0,0 @@ -# This is a comment. -# Each line is a file pattern followed by one or more owners. - -# All files should be reviewed by SRE Team. -* @omaze/sre diff --git a/sqs/.github/semantic.yml b/sqs/.github/semantic.yml deleted file mode 100644 index 7c2acb8..0000000 --- a/sqs/.github/semantic.yml +++ /dev/null @@ -1,38 +0,0 @@ -# Always validate the PR title, and ignore the commits -titleOnly: false - -# Always validate all commits, and ignore the PR title -commitsOnly: false - -# Always validate the PR title AND all the commits -titleAndCommits: true - -# Require at least one commit to be valid -# this is only relevant when using commitsOnly: true or titleAndCommits: true, -# which validate all commits by default -anyCommit: false - -# By default types specified in commitizen/conventional-commit-types is used. -# See: https://github.com/commitizen/conventional-commit-types/blob/v2.3.0/index.json -# You can override the valid types -types: - - build - - feat - - fix - - improvement - - docs - - refactor - - test - - ci - - chore - - style - - perf - - revert - -# Allow use of Merge commits (eg on github: "Merge branch 'master' into feature/ride-unicorns") -# this is only relevant when using commitsOnly: true (or titleAndCommits: true) -allowMergeCommits: true - -# Allow use of Revert commits (eg on github: "Revert "feat: ride unicorns"") -# this is only relevant when using commitsOnly: true (or titleAndCommits: true) -allowRevertCommits: true diff --git a/sqs/.github/workflows/00_testPullRequests.yaml b/sqs/.github/workflows/00_testPullRequests.yaml deleted file mode 100644 index 9e309f2..0000000 --- a/sqs/.github/workflows/00_testPullRequests.yaml +++ /dev/null @@ -1,104 +0,0 @@ -name: Validate Module - -on: - pull_request: - branches: - - integration - types: - - opened - - reopened - - synchronize - - unlocked - paths-ignore: - - ".github/**" - - ".githooks/**" - - "**.md" - -jobs: - validation: - name: Terraform Validation - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@v2 - with: - token: ${{ secrets.RELEASE_WORKFLOW_TOKEN }} - - - name: Setup Terraform - uses: hashicorp/setup-terraform@v1 - with: - terraform_wrapper: false - terraform_version: 1.0.0 - - - name: Setup SSH Keys and known_hosts - # Copied from https://github.com/maddox/actions/blob/master/ssh/entrypoint.sh - run: | - SSH_PATH="$HOME/.ssh" - mkdir -p "$SSH_PATH" - touch "$SSH_PATH/known_hosts" - echo "${{secrets.ID_RSA}}" > "$SSH_PATH/id_rsa" - chmod 700 "$SSH_PATH" - ssh-keyscan github.com >> "$SSH_PATH/known_hosts" - chmod 600 "$SSH_PATH/known_hosts" - chmod 600 "$SSH_PATH/id_rsa" - eval $(ssh-agent) - ssh-add "$SSH_PATH/id_rsa" - - - name: Terraform Format - id: fmt - run: terraform fmt -check - continue-on-error: true - - - name: Terraform Init - id: init - run: | - terraform init \ - -backend-config "key=PR-${{ github.event.pull_request.number }}" - - - name: Terraform Validate - id: validate - run: | - unset t_std t_err - - eval "$( terraform validate -no-color \ - 2> >(t_err=$(cat); typeset -p t_err) \ - > >(t_std=$(cat); typeset -p t_std) )" - - t_err="${t_err//'%'/'%25'}" - t_err="${t_err//$'\n'/'%0A'}" - t_err="${t_err//$'\r'/'%0D'}" - - echo "::set-output name=stderr::$t_err" - - t_std="${t_std//'%'/'%25'}" - t_std="${t_std//$'\n'/'%0A'}" - t_std="${t_std//$'\r'/'%0D'}" - - echo "::set-output name=stdout::$t_std" - - - name: Comment PR with Terraform status - uses: actions/github-script@0.9.0 - with: - github-token: ${{ secrets.RELEASE_WORKFLOW_TOKEN }} - script: | - const output = `#### Terraform Format and Style 🖌\`${{ steps.fmt.outcome }}\` - #### Terraform Initialization ⚙️\`${{ steps.init.outcome }}\` - #### Terraform Validation 🤖 \`${{ steps.validate.outcome }}\` - -
Show Validation - - \`\`\`${{ steps.validate.outputs.stderr }}${{ steps.validate.outputs.stdout }} - \`\`\` - -
- - *Pusher: @${{ github.actor }}, Action: \`${{ github.event_name }}\`, Workflow: \`${{ github.workflow }}\`*`; - - github.issues.createComment({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - body: output - }) - diff --git a/sqs/.github/workflows/01_triggerReleaseWorkflow.yml b/sqs/.github/workflows/01_triggerReleaseWorkflow.yml deleted file mode 100644 index d8a2dbb..0000000 --- a/sqs/.github/workflows/01_triggerReleaseWorkflow.yml +++ /dev/null @@ -1,41 +0,0 @@ -name: 01 (Auto) Release Creation - -on: - push: - branches: - - integration - tags-ignore: - - "*" - paths-ignore: - - ".github/**" - - ".githooks/**" - - "**.md" - -jobs: - release: - name: "Release to GitHub" - runs-on: ubuntu-latest - steps: - - name: Checkout repo - uses: actions/checkout@v2 - with: - fetch-depth: 0 - token: ${{ secrets.RELEASE_WORKFLOW_TOKEN }} - - - name: Setup Node.js - uses: actions/setup-node@v1 - with: - node-version: 16 - - - name: Release to GitHub - env: - GITHUB_TOKEN: ${{ secrets.RELEASE_WORKFLOW_TOKEN }} - GIT_AUTHOR_NAME: omaze-cicd - GIT_AUTHOR_EMAIL: info@omaze.com - GIT_COMMITTER_NAME: omaze-cicd - GIT_COMMITTER_EMAIL: info@omaze.com - run: | - npm install --no-save \ - conventional-changelog-conventionalcommits \ - @semantic-release/git - npx semantic-release diff --git a/sqs/.releaserc b/sqs/.releaserc deleted file mode 100644 index 72d3a52..0000000 --- a/sqs/.releaserc +++ /dev/null @@ -1,18 +0,0 @@ -{ - "branches": [ - { - "name": "integration" - } - ], - "plugins": [ - ["@semantic-release/commit-analyzer", - {"preset": "conventionalcommits"} - ], - ["@semantic-release/release-notes-generator", - {"preset": "conventionalcommits"} - ], - "@semantic-release/github", - "@semantic-release/git" - ], - "preset": "conventionalcommits" -} \ No newline at end of file diff --git a/sqs/main.tf b/sqs/main.tf index 30ee2c7..f5545a2 100644 --- a/sqs/main.tf +++ b/sqs/main.tf @@ -1,24 +1,24 @@ data "aws_sns_topic" "sns_topic_to_access" { - count = var.sqs_queue_to_create["sns_subscription"] != null ? length(var.sqs_queue_to_create["sns_subscription"]) : 0 - name = var.sqs_queue_to_create["sns_subscription"][count.index]["topic_name"] + count = var.sqs_queue_to_create["sns_subscription"] != null ? length(var.sqs_queue_to_create["sns_subscription"]) : 0 + name = var.sqs_queue_to_create["sns_subscription"][count.index]["topic_name"] } module "sqs-dead-letter" { count = var.sqs_queue_to_create != null ? 1 : 0 source = "terraform-aws-modules/sqs/aws" - version = "3.2.1" + version = "4.1.0" - name = "${var.sqs_queue_to_create["name"]}-dead-letter" + name = "${var.sqs_queue_to_create["name"]}-dead-letter" message_retention_seconds = 1209600 #14 days } module "sqs" { count = var.sqs_queue_to_create != null ? 1 : 0 source = "terraform-aws-modules/sqs/aws" - version = "3.2.1" + version = "4.1.0" - name = var.sqs_queue_to_create["name"] + name = var.sqs_queue_to_create["name"] message_retention_seconds = 1209600 #14 days - redrive_policy = <