diff --git a/.github/workflows/terraform-docs.yml b/.github/workflows/terraform-docs.yml new file mode 100644 index 0000000..918d229 --- /dev/null +++ b/.github/workflows/terraform-docs.yml @@ -0,0 +1,24 @@ +# Copyright (c) NetApp, Inc. +# SPDX-License-Identifier: Apache-2.0 + +name: "Documentation: terraform-docs" + +on: + pull_request: + +jobs: + docs: + runs-on: ubuntu-latest + steps: + - name: Checkout pull request + uses: actions/checkout@v3.5.0 + with: + ref: ${{ github.event.pull_request.head.ref }} + + - name: Render documentation and push changes back to branch + uses: terraform-docs/gh-actions@v1.0.0 + with: + config-file: ".terraform-docs.yml" + output-file: "README.md" + output-method: inject + git-push: true diff --git a/.github/workflows/terraform.yml b/.github/workflows/terraform.yml new file mode 100644 index 0000000..f3edb84 --- /dev/null +++ b/.github/workflows/terraform.yml @@ -0,0 +1,41 @@ +# Copyright (c) NetApp, Inc. +# SPDX-License-Identifier: Apache-2.0 + +name: "Code Quality: Terraform" + +on: + pull_request: + push: + branches: + - main + +jobs: + terraform: + name: Terraform + runs-on: ubuntu-latest + + steps: + - name: Checkout pull request + uses: actions/checkout@v3.5.0 + with: + fetch-depth: 1 + ref: ${{ github.event.pull_request.head.ref }} + + - name: Set up Terraform + uses: hashicorp/setup-terraform@v1 + with: + terraform_wrapper: false + terraform_version: 1.6.6 + + - name: Initialize Terraform + run: terraform init + + - name: Format Terraform configuration + run: terraform fmt -diff -check -no-color -recursive + + - name: Validate Terraform configuration + run: terraform validate + + - name: Lint Terraform configuration + run: curl -sSfL https://raw.githubusercontent.com/terraform-linters/tflint/master/install_linux.sh | sh + tflint \ No newline at end of file diff --git a/.gitignore b/.gitignore index 88bbc88..04d9e4d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,2 @@ -terraform_deployment/.terraform -terraform_deployment/.terraform.lock.hcl +terraform_deployment/.terraform* terraform_deployment/terraform.tfstate* diff --git a/.terraform-docs.yml b/.terraform-docs.yml new file mode 100644 index 0000000..2a19a52 --- /dev/null +++ b/.terraform-docs.yml @@ -0,0 +1,88 @@ +# Copyright (c) NetApp, Inc. +# SPDX-License-Identifier: Apache-2.0 + +--- + +# see https://terraform-docs.io/user-guide/configuration/formatter/ +formatter: "markdown table" + +# see https://terraform-docs.io/user-guide/configuration/output/ +output: + file: "README.md" + mode: inject + template: |- + + {{ .Content }} + + +# see https://terraform-docs.io/user-guide/configuration/settings/ +settings: + anchor: false + color: true + default: true + escape: false + indent: 3 + required: true + sensitive: true + type: true + +# see https://terraform-docs.io/user-guide/configuration/sort/ +sort: + enabled: true + by: required + +# see https://terraform-docs.io/user-guide/configuration/sections/ +sections: + show: + - providers + - inputs + - outputs + +content: | + + ## Table of Contents + * [Introduction](#introduction) + * [Prerequisites](#prerequisites) + * [Getting Started](#getting-started) + * [Usage Examples](#usage-examples) + * [Author Information](#author-information) + * [License](#license) + + ## Introduction + + << place your description here >> + + ##Prerequisites + + {{ .Providers}} + + ### Repository Overview + + {{ .Inputs }} + + {{ .Outputs }} + + ## Getting Started + + << place your instructions here >> + + ## Usage Examples + + << place your examples here >> + + ## Author Information + + This repository is maintained by the contributors listed on [GitHub](https://github.com/NetApp/FSxN-Samples/graphs/contributors). + + ## License + + Licensed under the Apache License, Version 2.0 (the "License"). + + You may obtain a copy of the License at [apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0). + + Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an _"AS IS"_ basis, without WARRANTIES or conditions of any kind, either express or implied. + + See the License for the specific language governing permissions and limitations under the License. + +# see https://terraform-docs.io/user-guide/configuration/version/ +version: ">= 0.16.0, < 1.0.0" \ No newline at end of file diff --git a/README.md b/README.md index be7464f..472e08d 100644 --- a/README.md +++ b/README.md @@ -3,3 +3,19 @@ This GitHub repository contains comprehensive code samples and automation script ## Table of Contents * [FSxN deployment using Terraform](/terraform_deployment) + + +## Author Information + +This repository is maintained by the contributors listed on [GitHub](https://github.com/NetApp/FSxN-Samples/graphs/contributors). + +## License + +Licensed under the Apache License, Version 2.0 (the "License"). + +You may obtain a copy of the License at [apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0). + +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an _"AS IS"_ basis, without WARRANTIES or conditions of any kind, either express or implied. + +See the License for the specific language governing permissions and limitations under the License. + diff --git a/terraform_deployment/README.md b/terraform_deployment/README.md index ce64bd4..d968b13 100644 --- a/terraform_deployment/README.md +++ b/terraform_deployment/README.md @@ -7,6 +7,7 @@ Follow the instructions below to use this sample in your own environment. * [Prerequisites](#prerequisites) * [Getting Started](#getting-started) * [Usage Examples](#usage-examples) +* [Author Information](#author-information) * [License](#license) ## Introduction @@ -156,4 +157,16 @@ Run the following command to execute the Terrafom code and apply the changes pro $ terraform apply ``` -## License \ No newline at end of file +## Author Information + +This repository is maintained by the contributors listed on [GitHub](https://github.com/NetApp/FSxN-Samples/graphs/contributors). + +## License + +Licensed under the Apache License, Version 2.0 (the "License"). + +You may obtain a copy of the License at [apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0). + +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an _"AS IS"_ basis, without WARRANTIES or conditions of any kind, either express or implied. + +See the License for the specific language governing permissions and limitations under the License.