From 69b14aa90c5b8e87e91d276e67b6726eda5d0bd1 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 31 Jan 2024 05:52:10 +0000 Subject: [PATCH] fix: grept apply --- .github/CODEOWNERS | 1 - .github/policies/avmrequiredfiles.yml | 1 + .github/workflows/linting.yml | 82 ++++++++++++++++----------- .github/workflows/version-check.yml | 45 +++++++-------- .gitignore | 5 ++ .terraform-docs.yml | 5 +- SUPPORT.md | 26 +++------ _footer.md | 23 +------- avm | 21 +++++++ avm.bat | 23 ++++++++ examples/.terraform-docs.yml | 3 +- examples/default/.gitkeep | 0 tests/.gitkeep | 0 13 files changed, 138 insertions(+), 97 deletions(-) create mode 100755 avm create mode 100644 avm.bat create mode 100644 examples/default/.gitkeep create mode 100644 tests/.gitkeep diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 205f092..72c8f8e 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,4 +1,3 @@ # AVM core team owns key files .github/policies/ @Azure/avm-core-team-technical .github/CODEOWNERS @Azure/avm-core-team-technical -* @Azure/avm-ptn-alz-module-owners-tf \ No newline at end of file diff --git a/.github/policies/avmrequiredfiles.yml b/.github/policies/avmrequiredfiles.yml index 062f90b..975917b 100644 --- a/.github/policies/avmrequiredfiles.yml +++ b/.github/policies/avmrequiredfiles.yml @@ -16,3 +16,4 @@ configuration: prBody: | This repository needs the standard workflow and policy files to ensure compliance. file: + diff --git a/.github/workflows/linting.yml b/.github/workflows/linting.yml index 488b1df..8e160dd 100644 --- a/.github/workflows/linting.yml +++ b/.github/workflows/linting.yml @@ -1,33 +1,51 @@ --- - name: linting - - on: - pull_request: - types: ['opened', 'reopened', 'synchronize'] - merge_group: - workflow_dispatch: - - permissions: - contents: read - - concurrency: - group: linting-${{ github.event.pull_request.head.repo.full_name }}/${{ github.head_ref || github.run_id }} - cancel-in-progress: true - - jobs: - linting: - if: github.event.repository.name != 'terraform-azurerm-avm-template' - name: linting - runs-on: ubuntu-latest - steps: - - name: checkout repository - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1 - - - name: check docs - uses: Azure/terraform-azurerm-avm-template/.github/actions/docs-check@main - - - name: lint terraform - uses: Azure/terraform-azurerm-avm-template/.github/actions/linting@main - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - \ No newline at end of file +name: linting + +on: + pull_request: + types: ['opened', 'reopened', 'synchronize'] + merge_group: + workflow_dispatch: + +permissions: + contents: read + +concurrency: + group: linting-${{ github.event.pull_request.head.repo.full_name }}/${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + docs: + if: github.event.repository.name != 'terraform-azurerm-avm-template' + name: docs + runs-on: ubuntu-latest + steps: + - name: checkout repository + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1 + + - name: check docs + uses: Azure/terraform-azurerm-avm-template/.github/actions/docs-check@main + + terraform: + if: github.event.repository.name != 'terraform-azurerm-avm-template' + name: terraform + runs-on: ubuntu-latest + steps: + - name: checkout repository + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1 + + - name: lint terraform + uses: Azure/terraform-azurerm-avm-template/.github/actions/linting@main + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + + avmfix: + if: github.event.repository.name != 'terraform-azurerm-avm-template' && false + name: avmfix + runs-on: ubuntu-latest + steps: + - name: checkout repository + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1 + + - name: avmfix + uses: Azure/terraform-azurerm-avm-template/.github/actions/avmfix@main diff --git a/.github/workflows/version-check.yml b/.github/workflows/version-check.yml index 1b21627..d4097ff 100644 --- a/.github/workflows/version-check.yml +++ b/.github/workflows/version-check.yml @@ -1,24 +1,23 @@ --- - name: version-check - - on: - workflow_dispatch: - merge_group: - pull_request: - branches: - - main - - permissions: - contents: read - - jobs: - version-check: - if: github.event.repository.name != 'terraform-azurerm-avm-template' - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1 - - name: Check version - uses: Azure/terraform-azurerm-avm-template/.github/actions/version-check@main - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - \ No newline at end of file +name: version-check + +on: + workflow_dispatch: + merge_group: + pull_request: + branches: + - main + +permissions: + contents: read + +jobs: + version-check: + if: github.event.repository.name != 'terraform-azurerm-avm-template' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1 + - name: Check version + uses: Azure/terraform-azurerm-avm-template/.github/actions/version-check@main + with: + github_token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.gitignore b/.gitignore index 49523c0..470f60f 100644 --- a/.gitignore +++ b/.gitignore @@ -39,3 +39,8 @@ README-generated.md avm.tflint.hcl avm.tflint_example.hcl avmmakefile +*.md.tmp +*tfplan* +.DS_Store +avm.tflint.merged.hcl +avm.tflint_example.merged.hcl diff --git a/.terraform-docs.yml b/.terraform-docs.yml index 3dd5d43..dd5d16b 100644 --- a/.terraform-docs.yml +++ b/.terraform-docs.yml @@ -4,7 +4,7 @@ formatter: "markdown document" # this is required -version: "0.16.0" +version: "~> 0.17.0" header-from: "_header.md" footer-from: "_footer.md" @@ -35,6 +35,7 @@ content: |- {{ .Modules }} {{ .Footer }} + output: file: README.md mode: replace @@ -59,7 +60,7 @@ settings: hide-empty: false html: true indent: 2 - lockfile: true + lockfile: false read-comments: true required: true sensitive: true diff --git a/SUPPORT.md b/SUPPORT.md index eaf439a..ed06ba6 100644 --- a/SUPPORT.md +++ b/SUPPORT.md @@ -1,25 +1,15 @@ -# TODO: The maintainer of this repo has not yet edited this file - -**REPO OWNER**: Do you want Customer Service & Support (CSS) support for this product/project? - -- **No CSS support:** Fill out this template with information about how to file issues and get help. -- **Yes CSS support:** Fill out an intake form at [aka.ms/onboardsupport](https://aka.ms/onboardsupport). CSS will work with/help you to determine next steps. -- **Not sure?** Fill out an intake as though the answer were "Yes". CSS will help you decide. +# Support -*Then remove this first heading from this SUPPORT.MD file before publishing your repo.* +> ⚠️**Note:** For the full details on the support statements, SLAs, and more for the Azure Verified Modules (AVM) initiative please visit [aka.ms/AVM/Support](https://aka.ms/avm/support) ⚠️ -# Support +## How to file issues and get help -## How to file issues and get help +This project uses GitHub Issues to track bugs and feature requests. Please search the existing issues before filing new issues to avoid duplicates. For new issues, file your bug or feature request as a new issue. -This project uses GitHub Issues to track bugs and feature requests. Please search the existing -issues before filing new issues to avoid duplicates. For new issues, file your bug or -feature request as a new Issue. +Issues can be created and searched through for existing [issues here](https://github.com/Azure/terraform-azurerm-avm-ptn-alz/issues). -For help and questions about using this project, please **REPO MAINTAINER: INSERT INSTRUCTIONS HERE -FOR HOW TO ENGAGE REPO OWNERS OR COMMUNITY FOR HELP. COULD BE A STACK OVERFLOW TAG OR OTHER -CHANNEL. WHERE WILL YOU HELP PEOPLE?**. +Please provide as much information as possible when filing an issue. Include screenshots or correlation IDs if possible (please redact any sensitive information). -## Microsoft Support Policy +For instructions on how to get deployments and correlation ID, please follow this link [here](https://learn.microsoft.com/azure/azure-resource-manager/templates/deployment-history?tabs=azure-portal#get-deployments-and-correlation-id). -Support for this **PROJECT or PRODUCT** is limited to the resources listed above. +We may ask you to create an Azure support request once we have triaged the issue following the process documented [here](https://learn.microsoft.com/azure/azure-portal/supportability/how-to-create-azure-support-request). diff --git a/_footer.md b/_footer.md index 21e4198..bc56bcb 100644 --- a/_footer.md +++ b/_footer.md @@ -1,21 +1,4 @@ -## Contributing + +## Data Collection -This project welcomes contributions and suggestions. Most contributions require you to agree to a -Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us -the rights to use your contribution. For details, visit . - -When you submit a pull request, a CLA bot will automatically determine whether you need to provide -a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions -provided by the bot. You will only need to do this once across all repos using our CLA. - -This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). -For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or -contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. - -## Trademarks - -This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft -trademarks or logos is subject to and must follow -[Microsoft's Trademark & Brand Guidelines](https://www.microsoft.com/en-us/legal/intellectualproperty/trademarks/usage/general). -Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. -Any use of third-party trademarks or logos are subject to those third-party's policies. +The software may collect information about you and your use of the software and send it to Microsoft. Microsoft may use this information to provide services and improve our products and services. You may turn off the telemetry as described in the repository. There are also some features in the software that may enable you and Microsoft to collect data from users of your applications. If you use these features, you must comply with applicable law, including providing appropriate notices to users of your applications together with a copy of Microsoft’s privacy statement. Our privacy statement is located at . You can learn more about data collection and use in the help documentation and our privacy statement. Your use of the software operates as your consent to these practices. diff --git a/avm b/avm new file mode 100755 index 0000000..69f9ce0 --- /dev/null +++ b/avm @@ -0,0 +1,21 @@ +#!/usr/bin/env sh + +usage () { + echo "Usage: avm " +} + +CONTAINER_RUNTIME=${CONTAINER_RUNTIME:-docker} + +if [ ! "$(command -v "$CONTAINER_RUNTIME")" ]; then + echo "Error: $CONTAINER_RUNTIME is not installed. Please install $CONTAINER_RUNTIME first." + exit 1 +fi + +if [ -z "$1" ]; then + echo "Error: Please provide a make target. See https://github.com/Azure/tfmod-scaffold/blob/main/avmmakefile for available targets." + echo + usage + exit 1 +fi + +$CONTAINER_RUNTIME run --pull always --rm -v "$(pwd)":/src -w /src -e GITHUB_REPOSITORY -e GITHUB_REPOSITORY_OWNER mcr.microsoft.com/azterraform make "$1" diff --git a/avm.bat b/avm.bat new file mode 100644 index 0000000..cdfa812 --- /dev/null +++ b/avm.bat @@ -0,0 +1,23 @@ +@echo off +SETLOCAL + +REM Set CONTAINER_RUNTIME to its current value if it's already set, or docker if it's not +IF DEFINED CONTAINER_RUNTIME (SET "CONTAINER_RUNTIME=%CONTAINER_RUNTIME%") ELSE (SET "CONTAINER_RUNTIME=docker") + +REM Check if CONTAINER_RUNTIME is installed +WHERE /Q %CONTAINER_RUNTIME% +IF ERRORLEVEL 1 ( + echo Error: %CONTAINER_RUNTIME% is not installed. Please install %CONTAINER_RUNTIME% first. + exit /b +) + +REM Check if a make target is provided +IF "%~1"=="" ( + echo Error: Please provide a make target. See https://github.com/Azure/tfmod-scaffold/blob/main/avmmakefile for available targets. + exit /b +) + +REM Run the make target with CONTAINER_RUNTIME +%CONTAINER_RUNTIME% run --pull always --rm -v "%cd%":/src -w /src -e GITHUB_REPOSITORY -e GITHUB_REPOSITORY_OWNER mcr.microsoft.com/azterraform make %1 + +ENDLOCAL diff --git a/examples/.terraform-docs.yml b/examples/.terraform-docs.yml index 044d992..f97f3a3 100644 --- a/examples/.terraform-docs.yml +++ b/examples/.terraform-docs.yml @@ -4,9 +4,10 @@ formatter: "markdown document" # this is required -version: "0.16.0" +version: "~> 0.17.0" header-from: "_header.md" +footer-from: "_footer.md" recursive: enabled: false diff --git a/examples/default/.gitkeep b/examples/default/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/tests/.gitkeep b/tests/.gitkeep new file mode 100644 index 0000000..e69de29