From 5fcc923fe914f8b616ece8c09206767ab96016d9 Mon Sep 17 00:00:00 2001 From: Tanish Date: Wed, 11 Sep 2024 23:36:32 +0530 Subject: [PATCH 1/6] fix: updated modules & workflows --- .github/workflows/auto_asignee.yml | 14 ++++ .github/workflows/automerge.yml | 12 +++ .github/workflows/changelog.yml | 2 +- .github/workflows/readme.yml | 59 +++------------ .github/workflows/semantic-releaser.yml | 30 -------- .github/workflows/static-checks.yml | 74 ------------------- .github/workflows/tf-checks.yml | 27 +++++++ .github/workflows/tflint.yml | 11 +++ .github/workflows/tfsec.yml | 2 +- {example => examples}/basic/example.tf | 19 +++-- examples/basic/versions.tf | 12 +++ {example => examples}/queue/example.tf | 19 +++-- examples/queue/versions.tf | 12 +++ {example => examples}/topic/example.tf | 19 +++-- examples/topic/versions.tf | 12 +++ .../topic_with_subscriptions/example.tf | 20 +++-- examples/topic_with_subscriptions/versions.tf | 12 +++ main.tf | 24 +++--- versions.tf | 12 ++- 19 files changed, 199 insertions(+), 193 deletions(-) create mode 100644 .github/workflows/auto_asignee.yml create mode 100644 .github/workflows/automerge.yml delete mode 100644 .github/workflows/semantic-releaser.yml delete mode 100644 .github/workflows/static-checks.yml create mode 100644 .github/workflows/tf-checks.yml create mode 100644 .github/workflows/tflint.yml rename {example => examples}/basic/example.tf (64%) create mode 100644 examples/basic/versions.tf rename {example => examples}/queue/example.tf (70%) create mode 100644 examples/queue/versions.tf rename {example => examples}/topic/example.tf (72%) create mode 100644 examples/topic/versions.tf rename {example => examples}/topic_with_subscriptions/example.tf (71%) create mode 100644 examples/topic_with_subscriptions/versions.tf diff --git a/.github/workflows/auto_asignee.yml b/.github/workflows/auto_asignee.yml new file mode 100644 index 0000000..77d5fdf --- /dev/null +++ b/.github/workflows/auto_asignee.yml @@ -0,0 +1,14 @@ +name: Auto Assign PRs + +on: + pull_request: + types: [opened, reopened] + + workflow_dispatch: +jobs: + assignee: + uses: clouddrove/github-shared-workflows/.github/workflows/auto_assignee.yml@master + secrets: + GITHUB: ${{ secrets.GITHUB }} + with: + assignees: 'clouddrove-ci' \ No newline at end of file diff --git a/.github/workflows/automerge.yml b/.github/workflows/automerge.yml new file mode 100644 index 0000000..47988d0 --- /dev/null +++ b/.github/workflows/automerge.yml @@ -0,0 +1,12 @@ +--- + name: Auto merge + on: + pull_request: + jobs: + auto-merge: + uses: clouddrove/github-shared-workflows/.github/workflows/auto_merge.yml@master + secrets: + GITHUB: ${{ secrets.GITHUB }} + with: + tfcheck: 'basic / Check code format' + ... \ No newline at end of file diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml index 1ee6f78..4b735f5 100644 --- a/.github/workflows/changelog.yml +++ b/.github/workflows/changelog.yml @@ -10,4 +10,4 @@ jobs: uses: clouddrove/github-shared-workflows/.github/workflows/changelog.yml@master secrets: inherit with: - branch: 'master' + branch: 'master' \ No newline at end of file diff --git a/.github/workflows/readme.yml b/.github/workflows/readme.yml index 8b60bee..444164d 100644 --- a/.github/workflows/readme.yml +++ b/.github/workflows/readme.yml @@ -1,54 +1,15 @@ -name: 'Create README.md file' +name: Readme Workflow on: push: branches: - master - + paths-ignore: + - 'README.md' + - 'docs/**' + workflow_dispatch: jobs: - readme-create: - name: 'readme-create' - runs-on: ubuntu-latest - steps: - - name: 'Checkout' - uses: actions/checkout@master - - - name: 'Set up Python 3.7' - uses: actions/setup-python@v2 - with: - python-version: '3.x' - - - name: 'create readme' - uses: 'clouddrove/github-actions@v9.0.2' - with: - actions_subcommand: 'readme' - github_token: '${{ secrets.GITHUB }}' - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - - name: 'pre-commit check errors' - uses: pre-commit/action@v2.0.0 - continue-on-error: true - - - name: 'pre-commit fix erros' - uses: pre-commit/action@v2.0.0 - continue-on-error: true - - - name: 'push readme' - uses: 'clouddrove/github-actions@v9.0.2' - continue-on-error: true - with: - actions_subcommand: 'push' - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: 'Slack Notification' - uses: clouddrove/action-slack@v2 - with: - status: ${{ job.status }} - fields: repo,author - author_name: 'CloudDrove' - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # required - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_TERRAFORM }} # required - if: always() + README: + uses: clouddrove/github-shared-workflows/.github/workflows/readme.yml@master + secrets: + TOKEN : ${{ secrets.GITHUB }} + SLACK_WEBHOOK_TERRAFORM: ${{ secrets.SLACK_WEBHOOK_TERRAFORM }} \ No newline at end of file diff --git a/.github/workflows/semantic-releaser.yml b/.github/workflows/semantic-releaser.yml deleted file mode 100644 index 6e685a0..0000000 --- a/.github/workflows/semantic-releaser.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: Release - -on: - push: - branches: - - main - paths: - - '**.tf' - - '!examples/**.tf' - -jobs: - release: - name: Release - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v2 - with: - fetch-depth: 0 - persist-credentials: false - - - name: Setup Node.js - uses: actions/setup-node@v1 - with: - node-version: 14 - - - name: Release - env: - GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }} - run: npx semantic-release diff --git a/.github/workflows/static-checks.yml b/.github/workflows/static-checks.yml deleted file mode 100644 index 27cbe32..0000000 --- a/.github/workflows/static-checks.yml +++ /dev/null @@ -1,74 +0,0 @@ -name: static-checks - -on: - pull_request: - -jobs: - versionExtract: - name: Get min/max versions - runs-on: ubuntu-latest - - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Terraform min/max versions - id: minMax - uses: clowdhaus/terraform-min-max@main - outputs: - minVersion: ${{ steps.minMax.outputs.minVersion }} - maxVersion: ${{ steps.minMax.outputs.maxVersion }} - - versionEvaluate: - name: Evaluate Terraform versions - runs-on: ubuntu-latest - needs: versionExtract - strategy: - fail-fast: false - matrix: - version: - - ${{ needs.versionExtract.outputs.minVersion }} - - ${{ needs.versionExtract.outputs.maxVersion }} - directory: - - example/ - - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Install Terraform v${{ matrix.version }} - uses: hashicorp/setup-terraform@v1 - with: - terraform_version: ${{ matrix.version }} - - - name: Init & validate v${{ matrix.version }} - run: | - cd ${{ matrix.directory }} - terraform init - terraform validate - - name: tflint - uses: reviewdog/action-tflint@master - with: - tflint_version: v0.29.0 - github_token: ${{ secrets.GITHUB_TOKEN }} - working_directory: ${{ matrix.directory }} - fail_on_error: 'true' - filter_mode: 'nofilter' - flags: '--module' - - format: - name: Check code format - runs-on: ubuntu-latest - needs: versionExtract - - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Install Terraform v${{ needs.versionExtract.outputs.maxVersion }} - uses: hashicorp/setup-terraform@v1 - with: - terraform_version: ${{ needs.versionExtract.outputs.maxVersion }} - - - name: Check Terraform format changes - run: terraform fmt --recursive -check=true diff --git a/.github/workflows/tf-checks.yml b/.github/workflows/tf-checks.yml new file mode 100644 index 0000000..0740553 --- /dev/null +++ b/.github/workflows/tf-checks.yml @@ -0,0 +1,27 @@ +name: tf-checks +on: + push: + branches: [ master ] + pull_request: + workflow_dispatch: +jobs: + basic-example: + uses: clouddrove/github-shared-workflows/.github/workflows/tf-checks.yml@master + with: + working_directory: './examples/basic' + + queue-example: + uses: clouddrove/github-shared-workflows/.github/workflows/tf-checks.yml@master + with: + working_directory: './examples/queue' + + topic-example: + uses: clouddrove/github-shared-workflows/.github/workflows/tf-checks.yml@master + with: + working_directory: './examples/topic' + + topic-with-subscriptions-example: + uses: clouddrove/github-shared-workflows/.github/workflows/tf-checks.yml@master + with: + working_directory: './examples/topic_with_subscriptions' + diff --git a/.github/workflows/tflint.yml b/.github/workflows/tflint.yml new file mode 100644 index 0000000..ee98182 --- /dev/null +++ b/.github/workflows/tflint.yml @@ -0,0 +1,11 @@ +name: tf-lint +on: + push: + branches: [ master ] + pull_request: + workflow_dispatch: +jobs: + tf-lint: + uses: clouddrove/github-shared-workflows/.github/workflows/tf-lint.yml@master + secrets: + GITHUB: ${{ secrets.GITHUB }} \ No newline at end of file diff --git a/.github/workflows/tfsec.yml b/.github/workflows/tfsec.yml index c203751..9aaf588 100644 --- a/.github/workflows/tfsec.yml +++ b/.github/workflows/tfsec.yml @@ -8,4 +8,4 @@ jobs: uses: clouddrove/github-shared-workflows/.github/workflows/tfsec.yml@master secrets: inherit with: - working_directory: '.' + working_directory: '.' \ No newline at end of file diff --git a/example/basic/example.tf b/examples/basic/example.tf similarity index 64% rename from example/basic/example.tf rename to examples/basic/example.tf index 7118e66..0dc138a 100644 --- a/example/basic/example.tf +++ b/examples/basic/example.tf @@ -1,22 +1,29 @@ provider "azurerm" { features {} + subscription_id = "000000-11111-1223-XXX-XXXXXXXXXXXX" +} + +locals { + name = "app" + environment = "test" + label_order = ["name", "environment"] } module "resource_group" { source = "clouddrove/resource-group/azure" version = "1.0.2" - name = "app" - environment = "test" - label_order = ["name", "environment"] + name = local.name + environment = local.environment + label_order = local.label_order location = "Canada Central" } module "service_bus" { - source = "clouddrove/service-bus/azure" + source = "../.." - name = "app" - environment = "test" + name = local.name + environment = local.environment resource_group_name = module.resource_group.resource_group_name location = module.resource_group.resource_group_location diff --git a/examples/basic/versions.tf b/examples/basic/versions.tf new file mode 100644 index 0000000..ceee081 --- /dev/null +++ b/examples/basic/versions.tf @@ -0,0 +1,12 @@ +terraform { + required_version = ">= 1.6.6" +} + +terraform { + required_providers { + azurerm = { + source = "hashicorp/azurerm" + version = ">=3.110.0" + } + } +} \ No newline at end of file diff --git a/example/queue/example.tf b/examples/queue/example.tf similarity index 70% rename from example/queue/example.tf rename to examples/queue/example.tf index 7eb6c35..5215ae1 100644 --- a/example/queue/example.tf +++ b/examples/queue/example.tf @@ -1,22 +1,29 @@ provider "azurerm" { features {} + subscription_id = "000000-11111-1223-XXX-XXXXXXXXXXXX" +} + +locals { + name = "app" + environment = "test" + label_order = ["name", "environment"] } module "resource_group" { source = "clouddrove/resource-group/azure" version = "1.0.2" - name = "app" - environment = "test" - label_order = ["name", "environment"] + name = local.name + environment = local.environment + label_order = local.label_order location = "Canada Central" } module "service_bus" { - source = "clouddrove/service-bus/azure" + source = "../.." - name = "app" - environment = "test" + name = local.name + environment = local.environment resource_group_name = module.resource_group.resource_group_name location = module.resource_group.resource_group_location diff --git a/examples/queue/versions.tf b/examples/queue/versions.tf new file mode 100644 index 0000000..ceee081 --- /dev/null +++ b/examples/queue/versions.tf @@ -0,0 +1,12 @@ +terraform { + required_version = ">= 1.6.6" +} + +terraform { + required_providers { + azurerm = { + source = "hashicorp/azurerm" + version = ">=3.110.0" + } + } +} \ No newline at end of file diff --git a/example/topic/example.tf b/examples/topic/example.tf similarity index 72% rename from example/topic/example.tf rename to examples/topic/example.tf index f69a0cf..aecb274 100644 --- a/example/topic/example.tf +++ b/examples/topic/example.tf @@ -1,22 +1,29 @@ provider "azurerm" { features {} + subscription_id = "000000-11111-1223-XXX-XXXXXXXXXXXX" +} + +locals { + name = "app" + environment = "test" + label_order = ["name", "environment"] } module "resource_group" { source = "clouddrove/resource-group/azure" version = "1.0.2" - name = "app" - environment = "test" - label_order = ["name", "environment"] + name = local.name + environment = local.environment + label_order = local.label_order location = "Canada Central" } module "service_bus" { - source = "clouddrove/service-bus/azure" + source = "../.." - name = "app" - environment = "test" + name = local.name + environment = local.environment resource_group_name = module.resource_group.resource_group_name location = module.resource_group.resource_group_location diff --git a/examples/topic/versions.tf b/examples/topic/versions.tf new file mode 100644 index 0000000..ceee081 --- /dev/null +++ b/examples/topic/versions.tf @@ -0,0 +1,12 @@ +terraform { + required_version = ">= 1.6.6" +} + +terraform { + required_providers { + azurerm = { + source = "hashicorp/azurerm" + version = ">=3.110.0" + } + } +} \ No newline at end of file diff --git a/example/topic_with_subscriptions/example.tf b/examples/topic_with_subscriptions/example.tf similarity index 71% rename from example/topic_with_subscriptions/example.tf rename to examples/topic_with_subscriptions/example.tf index 6a2e202..19c25a0 100644 --- a/example/topic_with_subscriptions/example.tf +++ b/examples/topic_with_subscriptions/example.tf @@ -1,22 +1,30 @@ provider "azurerm" { features {} + # subscription_id = "000000-11111-1223-XXX-XXXXXXXXXXXX" + subscription_id = "068245d4-3c94-42fe-9c4d-9e5e1cabc60c" +} + +locals { + name = "app" + environment = "test" + label_order = ["name", "environment"] } module "resource_group" { source = "clouddrove/resource-group/azure" version = "1.0.2" - name = "app" - environment = "test" - label_order = ["name", "environment"] + name = local.name + environment = local.environment + label_order = local.label_order location = "Canada Central" } module "service_bus" { - source = "clouddrove/service-bus/azure" + source = "../.." - name = "app" - environment = "test" + name = local.name + environment = local.environment resource_group_name = module.resource_group.resource_group_name location = module.resource_group.resource_group_location diff --git a/examples/topic_with_subscriptions/versions.tf b/examples/topic_with_subscriptions/versions.tf new file mode 100644 index 0000000..ceee081 --- /dev/null +++ b/examples/topic_with_subscriptions/versions.tf @@ -0,0 +1,12 @@ +terraform { + required_version = ">= 1.6.6" +} + +terraform { + required_providers { + azurerm = { + source = "hashicorp/azurerm" + version = ">=3.110.0" + } + } +} \ No newline at end of file diff --git a/main.tf b/main.tf index 9a57f49..7ab7ad0 100644 --- a/main.tf +++ b/main.tf @@ -152,9 +152,9 @@ resource "azurerm_servicebus_topic" "main" { status = local.topics[count.index].status auto_delete_on_idle = local.topics[count.index].auto_delete_on_idle default_message_ttl = local.topics[count.index].default_message_ttl - enable_batched_operations = local.topics[count.index].enable_batched_operations - enable_express = local.topics[count.index].enable_express - enable_partitioning = local.topics[count.index].enable_partitioning + batched_operations_enabled = local.topics[count.index].enable_batched_operations + express_enabled = local.topics[count.index].enable_express + partitioning_enabled = local.topics[count.index].enable_partitioning max_size_in_megabytes = local.topics[count.index].max_size requires_duplicate_detection = local.topics[count.index].enable_duplicate_detection support_ordering = local.topics[count.index].enable_ordering @@ -181,13 +181,13 @@ resource "azurerm_servicebus_subscription" "main" { name = local.topic_subscriptions[count.index].name topic_id = azurerm_servicebus_topic.main.*.id[count.index] - max_delivery_count = local.topic_subscriptions[count.index].max_delivery_count - auto_delete_on_idle = local.topic_subscriptions[count.index].auto_delete_on_idle - default_message_ttl = local.topic_subscriptions[count.index].default_message_ttl - lock_duration = local.topic_subscriptions[count.index].lock_duration - enable_batched_operations = local.topic_subscriptions[count.index].enable_batched_operations - requires_session = local.topic_subscriptions[count.index].enable_session - forward_to = local.topic_subscriptions[count.index].forward_to + max_delivery_count = local.topic_subscriptions[count.index].max_delivery_count + auto_delete_on_idle = local.topic_subscriptions[count.index].auto_delete_on_idle + default_message_ttl = local.topic_subscriptions[count.index].default_message_ttl + lock_duration = local.topic_subscriptions[count.index].lock_duration + batched_operations_enabled = local.topic_subscriptions[count.index].enable_batched_operations + requires_session = local.topic_subscriptions[count.index].enable_session + forward_to = local.topic_subscriptions[count.index].forward_to dead_lettering_on_message_expiration = local.topic_subscriptions[count.index].enable_dead_lettering_on_message_expiration @@ -215,8 +215,8 @@ resource "azurerm_servicebus_queue" "main" { auto_delete_on_idle = local.queues[count.index].auto_delete_on_idle default_message_ttl = local.queues[count.index].default_message_ttl - enable_express = local.queues[count.index].enable_express - enable_partitioning = local.queues[count.index].enable_partitioning + express_enabled = local.queues[count.index].enable_express + partitioning_enabled = local.queues[count.index].enable_partitioning lock_duration = local.queues[count.index].lock_duration max_size_in_megabytes = local.queues[count.index].max_size requires_duplicate_detection = local.queues[count.index].enable_duplicate_detection diff --git a/versions.tf b/versions.tf index ac97c6a..ceee081 100644 --- a/versions.tf +++ b/versions.tf @@ -1,4 +1,12 @@ - terraform { - required_version = ">= 0.12" + required_version = ">= 1.6.6" } + +terraform { + required_providers { + azurerm = { + source = "hashicorp/azurerm" + version = ">=3.110.0" + } + } +} \ No newline at end of file From 8fbcb8ed6a7336546737a948b803d0f1fb1d6af1 Mon Sep 17 00:00:00 2001 From: Tanish Date: Thu, 12 Sep 2024 23:13:36 +0530 Subject: [PATCH 2/6] fix: added complete example & fixed workflows --- .github/workflows/automerge.yml | 22 +++---- .github/workflows/tf-checks.yml | 5 ++ examples/complete/example.tf | 65 ++++++++++++++++++++ examples/complete/versions.tf | 12 ++++ examples/topic_with_subscriptions/example.tf | 3 +- 5 files changed, 94 insertions(+), 13 deletions(-) create mode 100644 examples/complete/example.tf create mode 100644 examples/complete/versions.tf diff --git a/.github/workflows/automerge.yml b/.github/workflows/automerge.yml index 47988d0..3baf5e1 100644 --- a/.github/workflows/automerge.yml +++ b/.github/workflows/automerge.yml @@ -1,12 +1,12 @@ --- - name: Auto merge - on: - pull_request: - jobs: - auto-merge: - uses: clouddrove/github-shared-workflows/.github/workflows/auto_merge.yml@master - secrets: - GITHUB: ${{ secrets.GITHUB }} - with: - tfcheck: 'basic / Check code format' - ... \ No newline at end of file +name: Auto merge +on: + pull_request: +jobs: + auto-merge: + uses: clouddrove/github-shared-workflows/.github/workflows/auto_merge.yml@master + secrets: + GITHUB: ${{ secrets.GITHUB }} + with: + tfcheck: 'complete-example / Check code format' +... \ No newline at end of file diff --git a/.github/workflows/tf-checks.yml b/.github/workflows/tf-checks.yml index 0740553..4c71482 100644 --- a/.github/workflows/tf-checks.yml +++ b/.github/workflows/tf-checks.yml @@ -10,6 +10,11 @@ jobs: with: working_directory: './examples/basic' + complete-example: + uses: clouddrove/github-shared-workflows/.github/workflows/tf-checks.yml@master + with: + working_directory: './examples/complete' + queue-example: uses: clouddrove/github-shared-workflows/.github/workflows/tf-checks.yml@master with: diff --git a/examples/complete/example.tf b/examples/complete/example.tf new file mode 100644 index 0000000..980261a --- /dev/null +++ b/examples/complete/example.tf @@ -0,0 +1,65 @@ +provider "azurerm" { + features {} + # subscription_id = "000000-11111-1223-XXX-XXXXXXXXXXXX" + subscription_id = "068245d4-3c94-42fe-9c4d-9e5e1cabc60c" +} + +locals { + name = "app" + environment = "test" + label_order = ["name", "environment"] +} + +module "resource_group" { + source = "clouddrove/resource-group/azure" + version = "1.0.2" + + name = local.name + environment = local.environment + label_order = local.label_order + location = "Canada Central" +} + +module "service_bus" { + source = "../.." + + name = local.name + environment = local.environment + + resource_group_name = module.resource_group.resource_group_name + location = module.resource_group.resource_group_location + sku = "Basic" + + queues = [ + { + name = "example" + authorization_rules = [ + { + name = "example" + rights = ["listen", "send"] + } + ] + } + ] + topics = [ + { + name = "example" + enable_partitioning = true + subscriptions = [ + { + name = "example" + forward_to = "destination" + max_delivery_count = 1 + } + ] + + authorization_rules = [ + { + name = "example" + rights = ["listen", "send"] + } + ] + } + ] + +} diff --git a/examples/complete/versions.tf b/examples/complete/versions.tf new file mode 100644 index 0000000..ceee081 --- /dev/null +++ b/examples/complete/versions.tf @@ -0,0 +1,12 @@ +terraform { + required_version = ">= 1.6.6" +} + +terraform { + required_providers { + azurerm = { + source = "hashicorp/azurerm" + version = ">=3.110.0" + } + } +} \ No newline at end of file diff --git a/examples/topic_with_subscriptions/example.tf b/examples/topic_with_subscriptions/example.tf index 19c25a0..ba474e0 100644 --- a/examples/topic_with_subscriptions/example.tf +++ b/examples/topic_with_subscriptions/example.tf @@ -1,7 +1,6 @@ provider "azurerm" { features {} - # subscription_id = "000000-11111-1223-XXX-XXXXXXXXXXXX" - subscription_id = "068245d4-3c94-42fe-9c4d-9e5e1cabc60c" + subscription_id = "000000-11111-1223-XXX-XXXXXXXXXXXX" } locals { From 78b178ff38964499dc86e5686ef6b0189b51e95a Mon Sep 17 00:00:00 2001 From: Tanish Date: Fri, 13 Sep 2024 00:00:42 +0530 Subject: [PATCH 3/6] fix: fixed terraform_deprecated_index error for parent module --- .github/dependabot.yml | 4 ++++ examples/complete/example.tf | 3 +-- main.tf | 8 ++++---- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index a2357fd..87c99dd 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -13,6 +13,10 @@ updates: directory: "example/basic" # Location of package manifests schedule: interval: "weekly" + - package-ecosystem: "terraform" # See documentation for possible values + directory: "example/complete" # Location of package manifests + schedule: + interval: "weekly" - package-ecosystem: "terraform" # See documentation for possible values directory: "example/queue" # Location of package manifests schedule: diff --git a/examples/complete/example.tf b/examples/complete/example.tf index 980261a..be49752 100644 --- a/examples/complete/example.tf +++ b/examples/complete/example.tf @@ -1,7 +1,6 @@ provider "azurerm" { features {} - # subscription_id = "000000-11111-1223-XXX-XXXXXXXXXXXX" - subscription_id = "068245d4-3c94-42fe-9c4d-9e5e1cabc60c" + subscription_id = "000000-11111-1223-XXX-XXXXXXXXXXXX" } locals { diff --git a/main.tf b/main.tf index 7ab7ad0..bc5a419 100644 --- a/main.tf +++ b/main.tf @@ -166,7 +166,7 @@ resource "azurerm_servicebus_topic_authorization_rule" "main" { count = length(local.topic_authorization_rules) name = local.topic_authorization_rules[count.index].name - topic_id = azurerm_servicebus_topic.main.*.id[count.index] + topic_id = azurerm_servicebus_topic.main[count.index].id listen = contains(local.topic_authorization_rules[count.index].rights, "listen") ? true : false send = contains(local.topic_authorization_rules[count.index].rights, "send") ? true : false @@ -179,7 +179,7 @@ resource "azurerm_servicebus_subscription" "main" { count = length(local.topic_subscriptions) name = local.topic_subscriptions[count.index].name - topic_id = azurerm_servicebus_topic.main.*.id[count.index] + topic_id = azurerm_servicebus_topic.main[count.index].id max_delivery_count = local.topic_subscriptions[count.index].max_delivery_count auto_delete_on_idle = local.topic_subscriptions[count.index].auto_delete_on_idle @@ -199,7 +199,7 @@ resource "azurerm_servicebus_subscription_rule" "main" { name = local.topic_subscription_rules[count.index].name - subscription_id = azurerm_servicebus_subscription.main.*.id[count.index] + subscription_id = azurerm_servicebus_subscription.main[count.index].id filter_type = local.topic_subscription_rules[count.index].sql_filter != "" ? "SqlFilter" : null sql_filter = local.topic_subscription_rules[count.index].sql_filter action = local.topic_subscription_rules[count.index].action @@ -231,7 +231,7 @@ resource "azurerm_servicebus_queue_authorization_rule" "main" { count = length(local.queue_authorization_rules) name = local.queue_authorization_rules[count.index].name - queue_id = azurerm_servicebus_queue.main.*.id[count.index] + queue_id = azurerm_servicebus_queue.main[count.index].id listen = contains(local.queue_authorization_rules[count.index].rights, "listen") ? true : false send = contains(local.queue_authorization_rules[count.index].rights, "send") ? true : false From dd2f8f5eaf233e565ed4a2f9604d3b54ddb738c7 Mon Sep 17 00:00:00 2001 From: Tanish Date: Fri, 13 Sep 2024 00:10:13 +0530 Subject: [PATCH 4/6] fix: removed unused local --- main.tf | 8 -------- 1 file changed, 8 deletions(-) diff --git a/main.tf b/main.tf index bc5a419..e20fe0a 100644 --- a/main.tf +++ b/main.tf @@ -10,14 +10,6 @@ locals { }, rule) ] - default_authorization_rule = { - name = "RootManageSharedAccessKey" - primary_connection_string = azurerm_servicebus_namespace.main.default_primary_connection_string - secondary_connection_string = azurerm_servicebus_namespace.main.default_secondary_connection_string - primary_key = azurerm_servicebus_namespace.main.default_primary_key - secondary_key = azurerm_servicebus_namespace.main.default_secondary_key - } - topics = [ for topic in var.topics : merge({ name = "" From 62d049568e111284ec8d49bafe7e6e59caa4f22d Mon Sep 17 00:00:00 2001 From: Tanish Date: Mon, 23 Sep 2024 21:36:23 +0530 Subject: [PATCH 5/6] fix: fixed readme.yaml --- README.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.yaml b/README.yaml index 3c297a3..26edd05 100644 --- a/README.yaml +++ b/README.yaml @@ -5,13 +5,13 @@ # # Name of this project -name : Terraform AZURE BUS SERVICE +name : Terraform AZURE SERVICE BUS # License of this project license: "APACHE" # Canonical GitHub repo -github_repo: clouddrove/terraform-azure-bus-service +github_repo: clouddrove/terraform-azure-service-bus # Badges to display badges: @@ -37,7 +37,7 @@ usage: |- ```hcl # Basic module "service_bus" { - source = "clouddrove/service-bus/azure" + source = "../.." version = "1.0.0" name = "app" resource_group_name = module.resource_group.resource_group_name @@ -48,7 +48,7 @@ usage: |- ```hcl # topic module "service_bus" { - source = "clouddrove/service-bus/azure" + source = "../.." version = "1.0.0" name = "app" resource_group_name = module.resource_group.resource_group_name @@ -68,7 +68,7 @@ usage: |- ```hcl # queue module "service_bus" { - source = "clouddrove/service-bus/azure" + source = "../.." version = "1.0.0" name = "app" resource_group_name = module.resource_group.resource_group_name @@ -87,7 +87,7 @@ usage: |- ```hcl # topic_with_subscriptions module "service_bus" { - source = "clouddrove/service-bus/azure" + source = "../.." version = "1.0.0" name = "app" resource_group_name = module.resource_group.resource_group_name From d06481aea31295ec3baa69d5e31cad0194addb44 Mon Sep 17 00:00:00 2001 From: Deepak verma <89906661+d4kverma@users.noreply.github.com> Date: Mon, 7 Oct 2024 19:19:49 +0530 Subject: [PATCH 6/6] updated automerge for syntax error --- .github/workflows/automerge.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/automerge.yml b/.github/workflows/automerge.yml index 3baf5e1..e7d6d51 100644 --- a/.github/workflows/automerge.yml +++ b/.github/workflows/automerge.yml @@ -9,4 +9,3 @@ jobs: GITHUB: ${{ secrets.GITHUB }} with: tfcheck: 'complete-example / Check code format' -... \ No newline at end of file