diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index b30a2d4..a538416 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,6 +1,2 @@ -.github/* @clouddrove/approvers - -* @clouddrove/clouddrovians @clouddrove/approvers - -.github/mergify.yml @clouddrove/admins -.github/CODEOWNERS @clouddrove/admins +# These owners will be the default owners for everything in the repo. +* @anmolnagpal @clouddrove-ci @clouddrove/terraform-azure-admins \ No newline at end of file diff --git a/.github/dependabot.yml b/.github/dependabot.yml index c2b0594..580e4b6 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -10,6 +10,6 @@ updates: schedule: interval: "weekly" - package-ecosystem: "terraform" # See documentation for possible values - directory: "_example/complete" # Location of package manifests + directory: "examples/complete" # Location of package manifests schedule: interval: "weekly" 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..4f0fd3d --- /dev/null +++ b/.github/workflows/automerge.yml @@ -0,0 +1,11 @@ +--- + 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/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 d3cbfb6..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() \ No newline at end of file + 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 95bd395..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/complete - - 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..f235f18 --- /dev/null +++ b/.github/workflows/tf-checks.yml @@ -0,0 +1,11 @@ +name: tf-checks +on: + push: + branches: [ master ] + pull_request: + workflow_dispatch: +jobs: + complete-example: + uses: clouddrove/github-shared-workflows/.github/workflows/tf-checks.yml@master + with: + working_directory: './examples/complete' \ No newline at end of file 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/complete/README.md b/_example/complete/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/_example/complete/outputs.tf b/_example/complete/outputs.tf deleted file mode 100644 index e69de29..0000000 diff --git a/_example/complete/variables.auto.tfvars b/_example/complete/variables.auto.tfvars deleted file mode 100644 index e69de29..0000000 diff --git a/_example/complete/variables.tf b/_example/complete/variables.tf deleted file mode 100644 index e69de29..0000000 diff --git a/_example/README.md b/examples/README.md similarity index 100% rename from _example/README.md rename to examples/README.md diff --git a/_example/complete/main.tf b/examples/complete/main.tf similarity index 91% rename from _example/complete/main.tf rename to examples/complete/main.tf index 6a96cc8..e447dde 100644 --- a/_example/complete/main.tf +++ b/examples/complete/main.tf @@ -1,5 +1,6 @@ provider "azurerm" { features {} + subscription_id = "000001-11111-1223-XXX-XXXXXXXXXXXX" } module "resource_group" { diff --git a/_example/complete/versions.tf b/examples/complete/versions.tf similarity index 100% rename from _example/complete/versions.tf rename to examples/complete/versions.tf diff --git a/variables.tf b/variables.tf index 28dc299..7c710af 100644 --- a/variables.tf +++ b/variables.tf @@ -6,12 +6,6 @@ variable "name" { description = "Name (e.g. `app` or `cluster`)." } -variable "application" { - type = string - default = "" - description = "Application (e.g. `cd` or `clouddrove`)." -} - variable "environment" { type = string default = "" @@ -49,12 +43,6 @@ variable "enabled" { description = "Flag to control the module creation." } -variable "machine_count" { - type = number - default = 0 - description = "Number of Virtual Machines to create." -} - variable "resource_group_name" { type = string default = "" @@ -67,49 +55,7 @@ variable "location" { description = "Location where resource should be created." } -variable "create" { - type = string - default = "60m" - description = "Used when creating the Resource Group." -} - -variable "update" { - type = string - default = "60m" - description = "Used when updating the Resource Group." -} - -variable "read" { - type = string - default = "5m" - description = "Used when retrieving the Resource Group." -} - -variable "delete" { - type = string - default = "60m" - description = "Used when deleting the Resource Group." -} - ## Logic App - -variable "parameters" { - description = "The parameters passed to the workflow" - default = {} -} - -variable "source_arm_resource_id" { - type = string - default = "" - description = "The ID of the Event Grid System Topic ARM Source. Changing this forces a new Event Grid System Topic to be created. e.g. Storage account id or Resource group id or any serivec id." -} - -variable "storage_account_id" { - type = string - default = "" - description = "Storage account id." -} - variable "workflow_schema" { type = string default = null @@ -117,12 +63,7 @@ variable "workflow_schema" { } variable "workflow_parameters" { + type = any default = null description = "Specifies a map of Key-Value pairs of the Parameter Definitions to use for this Logic App Workflow. The key is the parameter name, and the value is a JSON encoded string of the parameter definition (see: https://docs.microsoft.com/azure/logic-apps/logic-apps-workflow-definition-language#parameters)." } - -variable "parameter" { - type = map(any) - default = null - description = "A map of Key-Value pairs." -} \ No newline at end of file