├── .editorconfig ├── .github ├── release-drafter.yml ├── settings.yml ├── stale.yml └── workflows │ ├── linter.yml │ ├── pr-title.yml │ └── release.draft.yml ├── .gitignore ├── .pre-commit-config.yaml ├── .terraform-docs.yml ├── .tflint.hcl ├── CHANGELOG.md ├── LICENSE ├── Makefile ├── README.md ├── main.tf ├── outputs.tf ├── renovate.json ├── variables.tf └── versions.tf /.editorconfig: -------------------------------------------------------------------------------- 1 | # top-most EditorConfig file 2 | root = true 3 | 4 | [*] 5 | end_of_line = lf 6 | charset = utf-8 7 | indent_style = space 8 | indent_size = 4 9 | insert_final_newline = true 10 | trim_trailing_whitespace = true 11 | 12 | [*.py] 13 | indent_style = space 14 | indent_size = 4 15 | max_line_length = 140 16 | 17 | [*.sh] 18 | indent_style = space 19 | indent_size = 2 20 | 21 | [Makefile] 22 | indent_style = tab 23 | 24 | [*.{tf,tfvars}] 25 | indent_size = 2 26 | indent_style = space 27 | 28 | [*.{yml,yaml}] 29 | indent_style = space 30 | indent_size = 2 31 | 32 | [*.feature] 33 | indent_size = 2 34 | 35 | [*.{json,tpl}] 36 | indent_style = space 37 | indent_size = 2 38 | 39 | [Jenkinsfile] 40 | indent_size = 2 41 | indent_style = space 42 | 43 | [*.{xml,config,props,targets,nuspec,resx,ruleset,vsixmanifest,vsct}] 44 | indent_size = 2 45 | 46 | [{*.scala,*.sbt}] 47 | indent_size = 2 48 | max_line_length = 80 49 | 50 | [{*.hcl,*.conf}] 51 | indent_size = 2 52 | max_line_length = 100 53 | 54 | # JS 55 | [*.js, **/*.js] 56 | indent_size = 4 57 | indent_style = space 58 | 59 | [{package.json}] 60 | indent_size = 2 61 | indent_style = space 62 | -------------------------------------------------------------------------------- /.github/release-drafter.yml: -------------------------------------------------------------------------------- 1 | # Configuration for Release Drafter: https://github.com/toolmantim/release-drafter 2 | _extends: .github 3 | -------------------------------------------------------------------------------- /.github/settings.yml: -------------------------------------------------------------------------------- 1 | # These settings are synced to GitHub by https://probot.github.io/apps/settings/ 2 | _extends: .github 3 | 4 | repository: 5 | # See https://developer.github.com/v3/repos/#edit for all available settings. 6 | name: terraform-helm-release 7 | description: "ℹ️ App release with terraform and helm." 8 | homepage: https://ivankatliarchuk.github.io 9 | topics: ivank, terraform, terraform-module, helm, kubernetes 10 | private: false 11 | has_issues: true 12 | has_projects: false 13 | has_wiki: false 14 | has_downloads: false 15 | has_pages: true 16 | is_template: true 17 | default_branch: master 18 | allow_squash_merge: true 19 | allow_merge_commit: true 20 | allow_rebase_merge: true 21 | delete_branch_on_merge: true 22 | enable_automated_security_fixes: true 23 | enable_vulnerability_alerts: false 24 | 25 | branches: 26 | - name: master 27 | -------------------------------------------------------------------------------- /.github/stale.yml: -------------------------------------------------------------------------------- 1 | # Configuration for https://github.com/probot/stale 2 | _extends: .github 3 | -------------------------------------------------------------------------------- /.github/workflows/linter.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: linter 3 | # This workflow is triggered on pushes to the repository. 4 | on: 5 | push: 6 | pull_request: 7 | branches: 8 | - main 9 | - master 10 | workflow_dispatch: 11 | 12 | jobs: 13 | terraform-validate: 14 | name: code format 15 | runs-on: ubuntu-latest 16 | steps: 17 | - uses: actions/checkout@master 18 | # https://github.com/hashicorp/setup-terraform 19 | - uses: hashicorp/setup-terraform@v3.1.1 20 | 21 | - name: Cache terraform folder 22 | uses: actions/cache@v3 23 | with: 24 | path: ./.terraform 25 | key: terraform 26 | 27 | - name: terraform fmt 28 | run: terraform fmt -check -recursive -diff 29 | continue-on-error: true 30 | 31 | - name: terraform init 32 | run: terraform init 33 | 34 | - name: terraform validate 35 | run: terraform validate 36 | 37 | tflint: 38 | name: "tflint" 39 | runs-on: ubuntu-latest 40 | steps: 41 | - uses: actions/checkout@v3.6.0 42 | - uses: actions/cache@v3 43 | name: Cache tflint plugin dir 44 | with: 45 | path: ~/.tflint.d/plugins 46 | key: ${{ matrix.os }}-tflint-${{ hashFiles('.tflint.hcl') }} 47 | - uses: terraform-linters/setup-tflint@v3.1.1 48 | name: setup tflint 49 | - name: init tflint 50 | run: tflint --init --config .tflint.hcl 51 | - name: run tflint 52 | run: tflint -f compact --config .tflint.hcl 53 | -------------------------------------------------------------------------------- /.github/workflows/pr-title.yml: -------------------------------------------------------------------------------- 1 | name: 'validate-pr-title' 2 | 3 | on: 4 | pull_request_target: 5 | types: 6 | - opened 7 | - edited 8 | - synchronize 9 | 10 | jobs: 11 | main: 12 | name: validate pr title 13 | runs-on: ubuntu-latest 14 | steps: 15 | # Please look up the latest version from 16 | # https://github.com/amannn/action-semantic-pull-request/releases 17 | - uses: amannn/action-semantic-pull-request@v5.5.2 18 | env: 19 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 20 | with: 21 | # Configure which types are allowed. 22 | # Default: https://github.com/commitizen/conventional-commit-types 23 | types: | 24 | fix 25 | feat 26 | docs 27 | ci 28 | chore 29 | # Configure that a scope must always be provided. 30 | requireScope: false 31 | # If `subjectPattern` is configured, you can use this property to override 32 | # the default error message that is shown when the pattern doesn't match. 33 | # The variables `subject` and `title` can be used within the message. 34 | subjectPatternError: | 35 | The subject "{subject}" found in the pull request title "{title}" 36 | didn't match the configured pattern. Please ensure that the subject 37 | starts with an uppercase character. 38 | # For work-in-progress PRs you can typically use draft pull requests 39 | # from Github. However, private repositories on the free plan don't have 40 | # this option and therefore this action allows you to opt-in to using the 41 | # special "[WIP]" prefix to indicate this state. This will avoid the 42 | # validation of the PR title and the pull request checks remain pending. 43 | # Note that a second check will be reported if this is enabled. 44 | wip: true 45 | # When using "Squash and merge" on a PR with only one commit, GitHub 46 | # will suggest using that commit message instead of the PR title for the 47 | # merge commit, and it's easy to commit this by mistake. Enable this option 48 | # to also validate the commit message for one commit PRs. 49 | validateSingleCommit: false 50 | -------------------------------------------------------------------------------- /.github/workflows/release.draft.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: release.draft 3 | 4 | on: 5 | push: 6 | branches: 7 | - master 8 | workflow_dispatch: 9 | inputs: 10 | prerelease: 11 | description: Is this a pre-release 12 | required: true 13 | default: true 14 | type: boolean 15 | publish: 16 | description: Publish release 17 | required: false 18 | default: false 19 | type: boolean 20 | bump: 21 | description: 'Bumping (#major, #minor or #patch)' 22 | required: false 23 | default: patch 24 | type: choice 25 | options: 26 | - 'patch' 27 | - 'minor' 28 | - 'major' 29 | 30 | jobs: 31 | draft-a-release: 32 | runs-on: ubuntu-latest 33 | steps: 34 | 35 | - uses: actions/checkout@v3.6.0 36 | 37 | - name: check next version 38 | uses: anothrNick/github-tag-action@1.69.0 39 | id: tag 40 | env: 41 | DRY_RUN: true 42 | WITH_V: true 43 | DEFAULT_BUMP: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.bump || 'patch' }} 44 | 45 | - name: release-draft 46 | uses: release-drafter/release-drafter@v5.25.0 47 | if: "!contains(github.event.head_commit.message, 'skip')" 48 | id: release 49 | env: 50 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 51 | with: 52 | publish: ${{ github.event.inputs.publish }} 53 | prerelease: ${{ github.event.inputs.prerelease }} 54 | tag: ${{ steps.tag.outputs.new_tag }} 55 | 56 | - name: check-version 57 | run: | 58 | echo "release it: ${{ github.event.inputs.prerelease }}" 59 | echo "out: ${{ steps.release.name }}" 60 | echo "tag: ${{ steps.release.outputs.tag_name }}" 61 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Local .terraform directories 2 | **/.terraform/* 3 | 4 | # .tfstate files 5 | *.tfstate 6 | *.tfstate.* 7 | 8 | # .tfvars files 9 | *.tfvars 10 | -------------------------------------------------------------------------------- /.pre-commit-config.yaml: -------------------------------------------------------------------------------- 1 | repos: 2 | - repo: https://github.com/pre-commit/pre-commit-hooks 3 | rev: v5.0.0 4 | hooks: 5 | - id: check-added-large-files 6 | args: ['--maxkb=500'] 7 | - id: check-executables-have-shebangs 8 | - id: pretty-format-json 9 | args: ['--autofix', '--no-sort-keys', '--indent=2'] 10 | - id: check-byte-order-marker 11 | - id: check-case-conflict 12 | - id: check-executables-have-shebangs 13 | - id: check-merge-conflict 14 | - id: check-symlinks 15 | - id: detect-private-key 16 | - id: check-merge-conflict 17 | - id: detect-aws-credentials 18 | args: ['--allow-missing-credentials'] 19 | - repo: https://github.com/antonbabenko/pre-commit-terraform 20 | rev: v1.99.1 21 | hooks: 22 | - id: terraform_fmt 23 | - id: terraform_docs 24 | - id: terraform_tflint 25 | -------------------------------------------------------------------------------- /.terraform-docs.yml: -------------------------------------------------------------------------------- 1 | sections: 2 | hide: [ 3 | resources, 4 | data-sources, 5 | modules 6 | ] 7 | 8 | settings: 9 | anchor: false 10 | -------------------------------------------------------------------------------- /.tflint.hcl: -------------------------------------------------------------------------------- 1 | config { 2 | module = false 3 | } 4 | 5 | plugin "aws" { 6 | enabled = true 7 | version = "0.28.0" 8 | source = "github.com/terraform-linters/tflint-ruleset-aws" 9 | } 10 | 11 | rule "terraform_comment_syntax" { 12 | enabled = true 13 | } 14 | 15 | rule "terraform_deprecated_index" { 16 | enabled = true 17 | } 18 | 19 | rule "terraform_deprecated_interpolation" { 20 | enabled = true 21 | } 22 | 23 | rule "terraform_documented_outputs" { 24 | enabled = true 25 | } 26 | 27 | rule "terraform_documented_variables" { 28 | enabled = true 29 | } 30 | 31 | rule "terraform_module_pinned_source" { 32 | enabled = true 33 | style = "flexible" 34 | } 35 | 36 | rule "terraform_module_version" { 37 | enabled = true 38 | } 39 | 40 | rule "terraform_naming_convention" { 41 | enabled = true 42 | format = "snake_case" 43 | } 44 | 45 | rule "terraform_standard_module_structure" { 46 | enabled = true 47 | } 48 | 49 | rule "terraform_typed_variables" { 50 | enabled = true 51 | } 52 | 53 | rule "terraform_unused_declarations" { 54 | enabled = true 55 | } 56 | 57 | rule "terraform_unused_required_providers" { 58 | enabled = true 59 | } 60 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | 2 | ## [Unreleased] 3 | 4 | 5 | 6 | 7 | ## [v2.7.0] - 2020-06-07 8 | 9 | - support helm provider version 1.2.2 10 | - funding set. #skip 11 | 12 | 13 | 14 | ## [v2.6.4] - 2020-05-17 15 | 16 | - job not releasing. #fix 17 | 18 | 19 | 20 | ## [v2.6.3] - 2020-05-17 21 | 22 | - optinal set 23 | 24 | 25 | 26 | ## [v2.6.2] - 2020-05-17 27 | 28 | - tflint fix 29 | 30 | 31 | 32 | ## [v2.6.1] - 2020-05-17 33 | 34 | - readme update 35 | 36 | 37 | 38 | ## [v2.6.0] - 2020-05-17 39 | 40 | - remove deprecation warning. app no longer type safe. #minor 41 | 42 | 43 | 44 | ## [v2.5.0] - 2020-03-22 45 | 46 | - version bump 47 | - wrong folder 48 | - merge 2.4 with master. add git flow 49 | - fixed bug with set sensitive 50 | - Update README.md 51 | 52 | 53 | 54 | ## [v2.4.0] - 2019-10-27 55 | 56 | - fixed bug with set sensitive 57 | 58 | 59 | 60 | ## [v2.3.0] - 2019-10-27 61 | 62 | - added set-sensitive docs 63 | 64 | 65 | 66 | ## [v2.2.0] - 2019-10-26 67 | 68 | - updating version 69 | - allow setup for sensitive stuff 70 | - added licence 71 | 72 | 73 | 74 | ## [v2.1.0] - 2019-08-18 75 | 76 | - Create changelog 77 | 78 | 79 | 80 | ## v2.0.0 - 2019-08-18 81 | 82 | - incorrect docs. fixem 83 | - initial setup 84 | - Initial commit 85 | 86 | 87 | [Unreleased]: https://github.com/terraform-module/terraform-helm-release.git/compare/v2.7.0...HEAD 88 | [v2.7.0]: https://github.com/terraform-module/terraform-helm-release.git/compare/v2.6.4...v2.7.0 89 | [v2.6.4]: https://github.com/terraform-module/terraform-helm-release.git/compare/v2.6.3...v2.6.4 90 | [v2.6.3]: https://github.com/terraform-module/terraform-helm-release.git/compare/v2.6.2...v2.6.3 91 | [v2.6.2]: https://github.com/terraform-module/terraform-helm-release.git/compare/v2.6.1...v2.6.2 92 | [v2.6.1]: https://github.com/terraform-module/terraform-helm-release.git/compare/v2.6.0...v2.6.1 93 | [v2.6.0]: https://github.com/terraform-module/terraform-helm-release.git/compare/v2.5.0...v2.6.0 94 | [v2.5.0]: https://github.com/terraform-module/terraform-helm-release.git/compare/v2.4.0...v2.5.0 95 | [v2.4.0]: https://github.com/terraform-module/terraform-helm-release.git/compare/v2.3.0...v2.4.0 96 | [v2.3.0]: https://github.com/terraform-module/terraform-helm-release.git/compare/v2.2.0...v2.3.0 97 | [v2.2.0]: https://github.com/terraform-module/terraform-helm-release.git/compare/v2.1.0...v2.2.0 98 | [v2.1.0]: https://github.com/terraform-module/terraform-helm-release.git/compare/v2.0.0...v2.1.0 99 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 ik-serverless 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | .EXPORT_ALL_VARIABLES: 2 | 3 | .PHONY: pre-commit changelog release 4 | 5 | help: 6 | @grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' 7 | 8 | hooks: ## Commit hooks setup 9 | @pre-commit install 10 | @pre-commit gc 11 | @pre-commit autoupdate 12 | 13 | validate: ## Validate with pre-commit hooks 14 | @pre-commit run --all-files 15 | 16 | changelog: ## Update changelog 17 | git-chglog -o CHANGELOG.md --next-tag `semtag final -s minor -o` 18 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Helm Release Module 2 | 3 | [![](https://img.shields.io/github/license/terraform-module/terraform-helm-release)](https://github.com/terraform-module/terraform-helm-release) 4 | ![](https://img.shields.io/github/v/tag/terraform-module/terraform-helm-release) 5 | [![](https://img.shields.io/github/workflow/status/terraform-module/terraform-helm-release/commit-check/master)](https://github.com/terraform-module/terraform-helm-release/actions?query=is%3Acommit-check) 6 | ![](https://github.com/terraform-module/terraform-helm-release/workflows/commit-check/badge.svg) 7 | ![](https://img.shields.io/issues/github/terraform-module/terraform-helm-release) 8 | ![](https://img.shields.io/github/issues/terraform-module/terraform-helm-release) 9 | ![](https://img.shields.io/github/issues-closed/terraform-module/terraform-helm-release) 10 | [![](https://img.shields.io/github/languages/code-size/terraform-module/terraform-helm-release)](https://github.com/terraform-module/terraform-helm-release) 11 | [![](https://img.shields.io/github/repo-size/terraform-module/terraform-helm-release)](https://github.com/terraform-module/terraform-helm-release) 12 | ![](https://img.shields.io/github/languages/top/terraform-module/terraform-helm-release?color=green&logo=terraform&logoColor=blue) 13 | ![](https://img.shields.io/github/commit-activity/m/terraform-module/terraform-helm-release) 14 | ![](https://img.shields.io/github/contributors/terraform-module/terraform-helm-release) 15 | ![](https://img.shields.io/github/last-commit/terraform-module/terraform-helm-release) 16 | 17 | ## Table Of Contents 18 | 19 | - [Helm Release Module](#helm-release-module) 20 | * [Usage example](#usage-example) 21 | * [Module Variables](#module-variables) 22 | * [Requirements](#requirements) 23 | * [Providers](#providers) 24 | * [Inputs](#inputs) 25 | * [Outputs](#outputs) 26 | * [Commands](#commands) 27 | * [Validate creation of components](#validate-creation-of-components) 28 | + [:memo: Guidelines](#-memo--guidelines) 29 | * [License](#license) 30 | * [How to Contribute](#how-to-contribute) 31 | - [Authors](#authors) 32 | * [Terraform Registry](#terraform-registry) 33 | 34 | Table of contents generated with markdown-toc 35 | 36 | ## Usage example 37 | 38 | Here's the gist of using it via github. 39 | 40 | ```terraform 41 | module jenkins { 42 | source = "terraform-module/release/helm" 43 | version = "2.6.0" 44 | 45 | namespace = "app-namespace" 46 | repository = "https://charts.helm.sh/stable" 47 | 48 | app = { 49 | name = "jenkins" 50 | version = "1.5.0" 51 | chart = "jenkins" 52 | force_update = true 53 | wait = false 54 | recreate_pods = false 55 | deploy = 1 56 | } 57 | values = [templatefile("jenkins.yml", { 58 | region = var.region 59 | storage = "4Gi" 60 | })] 61 | 62 | set = [ 63 | { 64 | name = "labels.kubernetes\\.io/name" 65 | value = "jenkins" 66 | }, 67 | { 68 | name = "service.labels.kubernetes\\.io/name" 69 | value = "jenkins" 70 | }, 71 | ] 72 | 73 | set_sensitive = [ 74 | { 75 | path = "master.adminUser" 76 | value = "jenkins" 77 | }, 78 | ] 79 | } 80 | ``` 81 | 82 | ## Module Variables 83 | 84 | 85 | ## Requirements 86 | 87 | | Name | Version | 88 | |------|---------| 89 | | terraform | >= 0.13 | 90 | | helm | >= 2.0 | 91 | 92 | ## Providers 93 | 94 | | Name | Version | 95 | |------|---------| 96 | | helm | >= 2.0 | 97 | 98 | ## Inputs 99 | 100 | | Name | Description | Type | Default | Required | 101 | |------|-------------|------|---------|:--------:| 102 | | app | an application to deploy | `map(any)` | n/a | yes | 103 | | namespace | namespace where to deploy an application | `string` | n/a | yes | 104 | | repository | Helm repository | `string` | n/a | yes | 105 | | repository\_config | repository configuration | `map(any)` | n/a | yes | 106 | | set | Value block with custom STRING values to be merged with the values yaml. |
list(object({
name = string
value = string
}))
| `null` | no | 107 | | set\_sensitive | Value block with custom sensitive values to be merged with the values yaml that won't be exposed in the plan's diff. |
list(object({
path = string
value = string
}))
| `null` | no | 108 | | values | Extra values | `list(string)` | `[]` | no | 109 | 110 | ## Outputs 111 | 112 | | Name | Description | 113 | |------|-------------| 114 | | deployment | The state of the helm deployment | 115 | 116 | 117 | ## Commands 118 | 119 | 120 | ``` 121 | $ make help 122 | hooks Commit hooks setup 123 | validate Validate with pre-commit hooks 124 | changelog Update changelog 125 | ``` 126 | 127 | 128 | ## Validate creation of components 129 | 130 | ```sh 131 | kubectl get serviceaccount -o yaml 132 | kubectl get clusterrolebinding -o yaml 133 | kubectl get deploy -o yaml 134 | ``` 135 | 136 | ### :memo: Guidelines 137 | 138 | - :memo: Use a succinct title and description. 139 | - :bug: Bugs & feature requests can be be opened 140 | - :signal_strength: Support questions are better asked on [Stack Overflow](https://stackoverflow.com/) 141 | - :blush: Be nice, civil and polite ([as always](http://contributor-covenant.org/version/1/4/)). 142 | 143 | ## License 144 | 145 | Copyright 2019 Ivan Katliarhcuk 146 | 147 | MIT Licensed. See [LICENSE](./LICENSE) for full details. 148 | 149 | ## How to Contribute 150 | 151 | Submit a pull request 152 | 153 | # Authors 154 | 155 | Currently maintained by [Ivan Katliarchuk](https://github.com/ivankatliarchuk) and these [awesome contributors](https://github.com/terraform-module/terraform-module-blueprint/graphs/contributors). 156 | 157 | [![ForTheBadge uses-git](http://ForTheBadge.com/images/badges/uses-git.svg)](https://GitHub.com/) 158 | 159 | ## Terraform Registry 160 | 161 | - [Module](https://registry.terraform.io/modules/terraform-module/release/helm) 162 | -------------------------------------------------------------------------------- /main.tf: -------------------------------------------------------------------------------- 1 | resource "helm_release" "this" { 2 | count = var.app["deploy"] ? 1 : 0 3 | namespace = var.namespace 4 | repository = var.repository 5 | repository_key_file = lookup(var.repository_config, "repository_key_file", null) 6 | repository_cert_file = lookup(var.repository_config, "repository_cert_file", null) 7 | repository_ca_file = lookup(var.repository_config, "repository_ca_file", null) 8 | repository_username = lookup(var.repository_config, "repository_username", null) 9 | repository_password = lookup(var.repository_config, "repository_password", null) 10 | name = var.app["name"] 11 | version = var.app["version"] 12 | chart = var.app["chart"] 13 | force_update = lookup(var.app, "force_update", true) 14 | wait = lookup(var.app, "wait", true) 15 | recreate_pods = lookup(var.app, "recreate_pods", true) 16 | max_history = lookup(var.app, "max_history", 0) 17 | lint = lookup(var.app, "lint", true) 18 | cleanup_on_fail = lookup(var.app, "cleanup_on_fail", false) 19 | create_namespace = lookup(var.app, "create_namespace", false) 20 | disable_webhooks = lookup(var.app, "disable_webhooks", false) 21 | verify = lookup(var.app, "verify", false) 22 | reuse_values = lookup(var.app, "reuse_values", false) 23 | reset_values = lookup(var.app, "reset_values", false) 24 | atomic = lookup(var.app, "atomic", false) 25 | skip_crds = lookup(var.app, "skip_crds", false) 26 | render_subchart_notes = lookup(var.app, "render_subchart_notes", true) 27 | disable_openapi_validation = lookup(var.app, "disable_openapi_validation", false) 28 | wait_for_jobs = lookup(var.app, "wait_for_jobs", false) 29 | dependency_update = lookup(var.app, "dependency_update", false) 30 | replace = lookup(var.app, "replace", false) 31 | timeout = lookup(var.app, "timeout", 300) 32 | values = var.values 33 | 34 | dynamic "set" { 35 | iterator = item 36 | for_each = var.set == null ? [] : var.set 37 | 38 | content { 39 | name = item.value.name 40 | value = item.value.value 41 | } 42 | } 43 | 44 | dynamic "set_sensitive" { 45 | iterator = item 46 | for_each = var.set_sensitive == null ? [] : var.set_sensitive 47 | 48 | content { 49 | name = item.value.path 50 | value = item.value.value 51 | } 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /outputs.tf: -------------------------------------------------------------------------------- 1 | output "deployment" { 2 | value = var.app["deploy"] ? helm_release.this[0].metadata : [] 3 | description = "The state of the helm deployment" 4 | } 5 | -------------------------------------------------------------------------------- /renovate.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://docs.renovatebot.com/renovate-schema.json", 3 | "extends": [ 4 | "local>terraform-module/.github:renovate-config" 5 | ] 6 | } 7 | -------------------------------------------------------------------------------- /variables.tf: -------------------------------------------------------------------------------- 1 | variable "namespace" { 2 | description = "namespace where to deploy an application" 3 | type = string 4 | } 5 | 6 | variable "app" { 7 | description = "an application to deploy" 8 | type = map(any) 9 | } 10 | 11 | variable "repository_config" { 12 | description = "repository configuration" 13 | type = map(any) 14 | default = {} 15 | } 16 | 17 | variable "values" { 18 | description = "Extra values" 19 | type = list(string) 20 | default = [] 21 | } 22 | 23 | variable "set" { 24 | description = "Value block with custom STRING values to be merged with the values yaml." 25 | type = list(object({ 26 | name = string 27 | value = string 28 | })) 29 | default = null 30 | } 31 | 32 | variable "set_sensitive" { 33 | description = "Value block with custom sensitive values to be merged with the values yaml that won't be exposed in the plan's diff." 34 | type = list(object({ 35 | path = string 36 | value = string 37 | })) 38 | default = null 39 | } 40 | 41 | variable "repository" { 42 | description = "Helm repository" 43 | type = string 44 | } 45 | -------------------------------------------------------------------------------- /versions.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_version = ">= 0.13" 3 | 4 | required_providers { 5 | helm = ">= 2.0" 6 | } 7 | } 8 | --------------------------------------------------------------------------------