shuttles #2

Open
thomas wants to merge 27 commits from shuttles into main
236 changed files with 17098 additions and 0 deletions
Showing only changes of commit b9acac33e2 - Show all commits

View File

@ -0,0 +1,7 @@
```release-note:feature
`provider`: Add a new attribute `burst_limit` for client-side throttling limit configuration.
```
```release-note:doc
`provider`: Add a new attribute `burst_limit`.
```

View File

@ -0,0 +1,3 @@
```release-note:doc
`resource/helm_release`: Add usage examples for `GCS` and `S3` plugins.
```

View File

@ -0,0 +1,3 @@
```release-note:doc
`data_source/helm_template`: Correct some errors in examples.
```

View File

@ -0,0 +1,3 @@
```release-note:dependency
Bump `github.com/containerd/containerd` from `1.6.6` to `1.6.12`
```

View File

@ -0,0 +1,3 @@
```release-note:doc
`resource/helm_release`: Add usage example for `OCI` repositories.
```

View File

@ -0,0 +1,3 @@
```release-note:dependency
Bump `helm.sh/helm/v3` from `3.9.4` to `3.11.0`
```

View File

@ -0,0 +1,7 @@
```release-note:dependency
Bump `k8s.io/client-go` from `0.24.2` to `0.26.1`
```
```release-note:note
`provider`: `kubernetes.exec.api_version` no longer supports `client.authentication.k8s.io/v1alpha1`. Please, switch to `client.authentication.k8s.io/v1beta1` or `client.authentication.k8s.io/v1`.
```

View File

@ -0,0 +1,7 @@
```release-note:enhancement
`data_source/helm_template`: Add a new attribute `crds` which when `include_crds` is set to `true` will be populated with a list of the manifests from the `crds/` folder of the chart.
```
```release-note:doc
`data_source/helm_template`: Add a new attribute `crds`
```

View File

@ -0,0 +1,3 @@
```release-note:doc
`provider`: Add a note regarding the `KUBECONFIG` environment variable.
```

View File

@ -0,0 +1,3 @@
```release-note:dependency
Bump `helm.sh/helm/v3` from `3.11.0` to `3.11.1`
```

View File

@ -0,0 +1,3 @@
```release-note:dependency
Bump `golang.org/x/crypto` from `0.5.0` to `0.6.0`
```

View File

@ -0,0 +1,3 @@
```release-note:feature
`helm/resource_release.go`: Add `set_list` attribute
```

View File

@ -0,0 +1,3 @@
```release-note:bug
`helm/resource_release.go`: Always recompute metadata when a release is updated
```

View File

@ -0,0 +1,3 @@
```release-note:dependency
Bump `helm.sh/helm/v3` from `3.11.2` to `3.12.0`
```

View File

@ -0,0 +1,3 @@
```release-note:bug
`helm/resource_release.go`: Fix: only recompute metadata if version actually changes
```

View File

@ -0,0 +1,3 @@
```release-note:bug
`helm/resource_release.go`: Fix: version conflicts when using local chart
```

View File

@ -0,0 +1,3 @@
```release-note:enhancement
`resource/helm_release`: add `name` field validation to be limited to 53 characters.
```

View File

@ -0,0 +1,3 @@
```release-note:bug
`resource/helm_release`: Add nil check for `set_list.value` to prevent provider ChartPathOptions
```

View File

@ -0,0 +1,4 @@
```release-note:bug
`helm_release`: Fix perpetual diff when version attribute is an empty string
```

View File

@ -0,0 +1,3 @@
```release-note:enhancement
resource/helm_release: add `upgrade_install` boolean attribute to enable idempotent release installation, addressing components of [GH-425](https://github.com/hashicorp/terraform-provider-helm/issues/425)
```

View File

@ -0,0 +1,39 @@
```release-note:dependency
Bump Golang from `1.20` to `1.21`.
```
```release-note:dependency
Bump helm.sh/helm/v3 from `v3.13.1` to `v3.13.2`.
```
```release-note:dependency
Bump github.com/hashicorp/go-cty from `v1.4.1-0.20200414143053-d3edf31b6320` to `v1.4.1-0.20200723130312-85980079f637`.
```
```release-note:dependency
Bump github.com/hashicorp/terraform-plugin-docs from `v0.14.1` to `v0.16.0`.
```
```release-note:dependency
Bump github.com/hashicorp/terraform-plugin-sdk/v2 from `v2.26.1` to `v2.30.0`.
```
```release-note:dependency
Bump golang.org/x/crypto from `v0.14.0` to `v0.16.0`.
```
```release-note:dependency
Bump k8s.io/api from `v0.28.3` to `v0.28.4`.
```
```release-note:dependency
Bump k8s.io/apimachinery from `v0.28.3` to `v0.28.4`.
```
```release-note:dependency
Bump k8s.io/client-go from `v0.28.3` to `v0.28.4`.
```
```release-note:dependency
Bump sigs.k8s.io/yaml from `v1.3.0` to `v1.4.0`.
```

View File

@ -0,0 +1,3 @@
```release-note:bug
`provider`: Fix manifest diff rendering for OCI charts.
```

View File

@ -0,0 +1,3 @@
```release-note:doc
`docs`: Use templatefile() instead of "template_file" provider in GKE example.
```

View File

@ -0,0 +1,3 @@
```release-note: enhancement
`resource/helm_release`: enable helm lockup function.
```

View File

@ -0,0 +1,3 @@
```release-note:enhancement
Add support for Terraform's experimental deferred actions
```

View File

@ -0,0 +1,3 @@
```release-note:dependency
Provider project ported from `terraform-plugin-sdk/v2` to `terraform-plugin-framework`
```

View File

@ -0,0 +1,3 @@
```release-note:enhancement
`helm_release`: add new attributes metadata.last_deployed, metadata.first_deployed, metadata.notes
```

View File

@ -0,0 +1,3 @@
```release-note:bug
`resource/helm_release`: Fix: only recompute metadata when the version in the metadata changes
```

View File

@ -0,0 +1,3 @@
```release-note:bug
`helm_release`: On destroy, do not error when release is not found
```

View File

@ -0,0 +1,3 @@
```release-note:bug
`helm_release`: Fix nil pointer deref panic on destroy when helm release is not found
```

View File

@ -0,0 +1,3 @@
```release-note:bug
`resoure/helm_release`: fix an issue where `postrender.args` is not parsed correctly.
```

View File

@ -0,0 +1,3 @@
```release-note:bug
change `set.value` && `set_list.value` to optional instead of required
```

View File

@ -0,0 +1,4 @@
```release-note:bug
`helm_release`: Fix namespace behaviour for dependency charts in non-default namespaces
```

View File

@ -0,0 +1,3 @@
```release-note:feature
`helm_release`: Add `set_wo` write-only attribute
```

View File

@ -0,0 +1,3 @@
```release-note:enhancement
update helm dependency to v3.17.2
```

View File

@ -0,0 +1,3 @@
```release-note:feature
Add `"literal"` as a supported `type` for the `set` block
```

View File

@ -0,0 +1,3 @@
```release-note:feature
`helm_release`: Add support for ResourceIdentity.
```

View File

@ -0,0 +1,3 @@
```release-note:enhancement
`helm_release`: Add `UpgradeState` logic to support migration from SDKv2 to Plugin Framework
```

View File

@ -0,0 +1,3 @@
```release-note:bug
`helm_release`: Fix wrong type for "values" field in v3 state upgrader
```

View File

@ -0,0 +1,3 @@
```release-note:bug
`helm_release`: Fix shallow clone bug causing nested sensitive values to be redacted in the k8s API
```

View File

@ -0,0 +1,3 @@
```release-note:enhancement
`kubernetes/provider.go`: Add `tls_server_name` kubernetes provider options.
```

View File

@ -0,0 +1,3 @@
```release-note:feature
Add support for configuring OCI registries inside provider block
```

View File

@ -0,0 +1,3 @@
```release-note:feature
Show Manifest when creating release
```

View File

@ -0,0 +1,3 @@
```release-note:note
Upgrade Helm to v3.9.4
```

View File

@ -0,0 +1,3 @@
```release-note:bug
Crash: Fix `show_only` crash when string is empty
```

View File

@ -0,0 +1,3 @@
```release-note:bug
Crash Fix: Fix Unknown Value in Manifest Diff
```

View File

@ -0,0 +1,3 @@
```release-note:bug
`resource/helm_release`: Fix an issue when the provider crashes with the error message `Provider produced inconsistent final plan` after upgrading from `v2.5.1` to `v2.6.0` and higher. That happened due to changes in the provider schema and the introduction of a new attribute `pass_credentials` that was not properly handled.
```

View File

@ -0,0 +1,71 @@
{{- if index .NotesByType "breaking-change" -}}
BREAKING CHANGES:
{{range index .NotesByType "breaking-change" -}}
* {{ template "note" . }}
{{ end -}}
{{- end -}}
{{- if .NotesByType.security }}
SECURITY:
{{range .NotesByType.security -}}
* {{ template "note" . }}
{{ end -}}
{{- end -}}
{{- if .NotesByType.feature }}
FEATURES:
{{range .NotesByType.feature -}}
* {{ template "note" . }}
{{ end -}}
{{- end -}}
{{- if .NotesByType.enhancement }}
ENHANCEMENT:
{{range .NotesByType.enhancement -}}
* {{ template "note" . }}
{{ end -}}
{{- end -}}
{{- if .NotesByType.deprecation }}
DEPRECATIONS:
{{range .NotesByType.deprecation -}}
* {{ template "note" . }}
{{ end -}}
{{- end -}}
{{- if .NotesByType.bug }}
BUG FIXES:
{{range .NotesByType.bug -}}
* {{ template "note" . }}
{{ end -}}
{{- end -}}
{{- if .NotesByType.doc }}
DOCS:
{{range .NotesByType.doc -}}
* {{ template "note" . }}
{{ end -}}
{{- end -}}
{{- if .NotesByType.dependency }}
DEPENDENCIES:
{{range .NotesByType.dependency -}}
* {{ template "note" . }}
{{ end -}}
{{- end -}}
{{- if .NotesByType.note }}
NOTES:
{{range .NotesByType.note -}}
* {{ template "note" . }}
{{ end -}}
{{- end -}}

View File

@ -0,0 +1,3 @@
{{- define "note" -}}
{{.Body}}{{if not (stringHasPrefix .Issue "_")}} [[GH-{{- .Issue -}}](https://github.com/hashicorp/terraform-provider-helm/issues/{{- .Issue -}})]{{end}}
{{- end -}}

View File

@ -0,0 +1,16 @@
schema_version = 1
project {
license = "MPL-2.0"
copyright_year = 2017
header_ignore = [
".changelog/**",
".github/**",
".goreleaser.yml",
".markdownlint.yml",
".release/**",
"helm/testdata/**",
"vendor/**",
"examples/**"
]
}

View File

@ -0,0 +1 @@
* @hashicorp/tf-eco-hybrid-cloud

View File

@ -0,0 +1,61 @@
---
name: "\U0001F41B Bug Report"
about: "If something isn't working as expected \U0001F914."
title: ''
labels: bug
---
### Terraform, Provider, Kubernetes and Helm Versions
<!--Run `terraform -v` to show the version. If you are not running the latest version of Terraform, please upgrade because your issue may have already been fixed.
Please note that this provider only supports Helm 3.-->
```
Terraform version:
Provider version:
Kubernetes version:
```
### Affected Resource(s)
<!--Please list the resources as a list, for example:-->
- helm_release
- helm_repository
<!--If this issue appears to affect multiple resources, it may be an issue with Terraform's core, so please mention this.-->
### Terraform Configuration Files
```hcl
# Copy-paste your Terraform configurations here - for large Terraform configs,
# please use a service like Dropbox and share a link to the ZIP file. For
# security, you can also encrypt the files using our GPG public key.
```
### Debug Output
<!--Please provider a link to a GitHub Gist containing the complete debug output: https://www.terraform.io/docs/internals/debugging.html. Please do NOT paste the debug output in the issue; just paste a link to the Gist. -->
NOTE: In addition to Terraform debugging, please set HELM_DEBUG=1 to enable debugging info from helm.
### Panic Output
<!--If Terraform produced a panic, please provide a link to a GitHub Gist containing the output of the `crash.log`.-->
### Steps to Reproduce
<!--Please list the steps required to reproduce the issue, for example:-->
1. `terraform apply`
### Expected Behavior
<!--What should have happened?-->
### Actual Behavior
<!--What actually happened?-->
### Important Factoids
<!--Are there anything atypical about your accounts that we should know? For example: Running in EC2 Classic? Custom version of OpenStack? Tight ACLs?-->
### References
<!--Are there any other GitHub issues (open or closed) or Pull Requests that should be linked here? For example:-->
- GH-1234
### Community Note
<!--- Please keep this note for the community --->
* Please vote on this issue by adding a 👍 [reaction](https://blog.github.com/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/) to the original issue to help the community and maintainers prioritize this request
* If you are interested in working on this issue or have submitted a pull request, please leave a comment

View File

@ -0,0 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: Helm Provider for Terraform Roadmap
url: https://github.com/terraform-providers/terraform-provider-helm/blob/master/_about/ROADMAP.md
about: Each quarter the team highlights our areas of focus for our work and upcoming research.

View File

@ -0,0 +1,39 @@
---
name: "\U0001F680 Feature Request"
about: "I have a suggestion (and might want to implement myself \U0001F642)!"
title: ''
labels: enhancement
---
### Description
<!--- Please leave a helpful description of the feature request here. --->
### Potential Terraform Configuration
<!--- Information about code formatting: https://help.github.com/articles/basic-writing-and-formatting-syntax/#quoting-code --->
```hcl
# Copy-paste your Terraform configurations here - for large Terraform configs,
# please use a service like Dropbox and share a link to the ZIP file. For
# security, you can also encrypt the files using our GPG public key.
```
### References
<!---
Information about referencing Github Issues: https://help.github.com/articles/basic-writing-and-formatting-syntax/#referencing-issues-and-pull-requests
Are there any other GitHub issues (open or closed) or pull requests that should be linked here? Vendor blog posts or documentation?
--->
<!--- Please keep this note for the community --->
### Community Note
* Please vote on this issue by adding a 👍 [reaction](https://blog.github.com/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/) to the original issue to help the community and maintainers prioritize this request
* If you are interested in working on this issue or have submitted a pull request, please leave a comment
<!--- Thank you for keeping this note for the community --->

View File

@ -0,0 +1,34 @@
---
name: "\U0001F914 Question"
about: "If you need help figuring something out"
title: ''
labels: question
---
<!---
Hi, please provide as much information as possible when asking your question.
Please understand that we make a best effort attempt to address questions, but our focus is on provider development. It's still valuable to ask your question because you may receive help from the community, and help us understand common asks.
-->
If you prefer, you can also ask your question in the Kubernetes community Slack channel [#terraform-providers](https://kubernetes.slack.com/messages/CJY6ATQH4). ([Sign up here](http://slack.k8s.io/))
## Terraform version, Kubernetes provider version and Kubernetes version
```
Terraform version:
Helm Provider version:
Kubernetes version:
```
## Terraform configuration
```hcl
Enter your configuration here.
```
## Question
<!---
Enter your question here.
--->

View File

@ -0,0 +1,18 @@
version: 2
updates:
- package-ecosystem: "gomod"
directory: "/"
schedule:
interval: "weekly"
day: "sunday"
commit-message:
prefix: "🌱"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
# DependaBot does not open a pull request to update the version of GH actions, only security updates.
# TSCCR is responsible for opening a pull request to update the version of GH actions.
open-pull-requests-limit: 0
commit-message:
prefix: "🤖"

View File

@ -0,0 +1,4 @@
bug:
- 'panic:'
crash:
- 'panic:'

View File

@ -0,0 +1,4 @@
dependencies:
- vendor/**/*
documentation:
- website/**/*

View File

@ -0,0 +1,41 @@
<!-- heimdall_github_prtemplate:grc-pci_dss-2024-01-05 -->
## Rollback Plan
If a change needs to be reverted, we will publish an updated version of the library.
## Changes to Security Controls
Are there any changes to security controls (access controls, encryption, logging) in this pull request? If so, explain.
### Description
<!--- Please leave a helpful description of the pull request here. --->
### Acceptance tests
- [ ] Have you added an acceptance test for the functionality being added?
### Release Note
Release note for [CHANGELOG](https://github.com/hashicorp/terraform-provider-helm/blob/main/CHANGELOG.md):
<!--
If change is not user facing, just write "NONE" in the release-note block below.
-->
```release-note
...
```
### References
<!---
Are there any other GitHub issues (open or closed) or pull requests that should be linked here? Vendor blog posts or documentation?
--->
<!--- Please keep this note for the community --->
### Community Note
* Please vote on this issue by adding a 👍 [reaction](https://blog.github.com/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/) to the original issue to help the community and maintainers prioritize this request
* If you are interested in working on this issue or have submitted a pull request, please leave a comment
<!--- Thank you for keeping this note for the community --->

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

View File

@ -0,0 +1,31 @@
name: Deferred Actions
on:
pull_request:
branches:
- main
paths:
- "helm/**/*.go"
- "go.mod"
workflow_dispatch:
inputs:
terraformVersion:
description: Terraform version
default: 1.9.0-alpha20240516
jobs:
acceptance_tests:
runs-on: custom-linux-medium
steps:
- name: Checkout repository
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
- name: Set up Go
uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1
with:
go-version-file: 'go.mod'
- name: Run Tests
env:
TF_ACC: 1
TF_ACC_TERRAFORM_VERSION: ${{ github.event.inputs.terraformVersion || '1.9.0-alpha20240516' }}
run: |
go test -v -run '^TestAccDeferredActions_basic' ./helm/testing

View File

@ -0,0 +1,153 @@
name: build
on:
push:
branches:
- main
- release/**
workflow_dispatch:
env:
PKG_NAME: "terraform-provider-helm"
jobs:
get-go-version:
name: "Detect Go toolchain version"
runs-on: ubuntu-latest
outputs:
go-version: ${{ steps.get-go-version.outputs.go-version }}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
with:
go-version-file: 'go.mod'
- name: Detect Go version
id: get-go-version
run: |
version="$(go list -f {{.GoVersion}} -m)"
echo "go-version=$version" >> "$GITHUB_OUTPUT"
set-product-version:
name: "Parse version file"
runs-on: ubuntu-latest
outputs:
product-version: ${{ steps.set-product-version.outputs.product-version }}
product-base-version: ${{ steps.set-product-version.outputs.base-product-version }}
product-prerelease-version: ${{ steps.set-product-version.outputs.prerelease-product-version }}
product-minor-version: ${{ steps.set-product-version.outputs.minor-product-version }}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Set variables
id: set-product-version
uses: hashicorp/actions-set-product-version@v2
generate-metadata-file:
needs: set-product-version
runs-on: ubuntu-latest
outputs:
filepath: ${{ steps.generate-metadata-file.outputs.filepath }}
steps:
- name: "Checkout directory"
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Generate metadata file
id: generate-metadata-file
uses: hashicorp/actions-generate-metadata@v1
with:
version: ${{ needs.set-product-version.outputs.product-version }}
product: ${{ env.PKG_NAME }}
repositoryOwner: "hashicorp"
- uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
with:
name: metadata.json
path: ${{ steps.generate-metadata-file.outputs.filepath }}
upload-terraform-registry-manifest-artifact:
needs: set-product-version
runs-on: ubuntu-latest
steps:
- name: "Checkout directory"
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
path: ${{ env.PKG_NAME }}
- name: "Copy manifest from checkout directory to a file with the desired name"
id: terraform-registry-manifest
run: |
name="${{ env.PKG_NAME }}"
version="${{ needs.set-product-version.outputs.product-version }}"
source="${name}/terraform-registry-manifest.json"
destination="${name}_${version}_manifest.json"
cp "$source" "$destination"
echo "filename=$destination" >> "$GITHUB_OUTPUT"
- uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
with:
name: terraform-registry-manifest.json
path: ${{ steps.terraform-registry-manifest.outputs.filename }}
if-no-files-found: error
build:
needs:
- get-go-version
- set-product-version
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
goos: [freebsd, windows, linux, darwin]
goarch: ["386", "amd64", "arm", "arm64"]
exclude:
- goos: freebsd
goarch: arm64
- goos: windows
goarch: arm64
- goos: windows
goarch: arm
- goos: darwin
goarch: 386
- goos: darwin
goarch: arm
name: Go ${{ needs.get-go-version.outputs.go-version }} ${{ matrix.goos }} ${{ matrix.goarch }} build
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: hashicorp/actions-go-build@v1
env:
CGO_ENABLED: 0
BASE_VERSION: ${{ needs.set-product-version.outputs.product-base-version }}
PRERELEASE_VERSION: ${{ needs.set-product-version.outputs.product-prerelease-version}}
METADATA_VERSION: ${{ env.METADATA }}
with:
bin_name: "${{ env.PKG_NAME }}_v${{ needs.set-product-version.outputs.product-version }}_x5"
product_name: ${{ env.PKG_NAME }}
product_version: ${{ needs.set-product-version.outputs.product-version }}
go_version: ${{ needs.get-go-version.outputs.go-version }}
os: ${{ matrix.goos }}
arch: ${{ matrix.goarch }}
reproducible: report
instructions: |
go build \
-o "$BIN_PATH" \
-trimpath \
-buildvcs=false \
-ldflags "-s -w -X 'main.Version=${{ needs.set-product-version.outputs.product-version }}'"
cp LICENSE "$TARGET_DIR/LICENSE.txt"
whats-next:
needs:
- build
- generate-metadata-file
- upload-terraform-registry-manifest-artifact
runs-on: ubuntu-latest
name: "What's next?"
steps:
- name: "Write a helpful summary"
run: |
github_dot_com="${{ github.server_url }}"
owner_with_name="${{ github.repository }}"
ref="${{ github.ref }}"
echo "### What's next?" >> "$GITHUB_STEP_SUMMARY"
echo "#### For a release branch (see \`.release/ci.hcl\`)" >> $GITHUB_STEP_SUMMARY
echo "After this \`build\` workflow run completes succesfully, you can expect the CRT \`prepare\` workflow to begin momentarily." >> "$GITHUB_STEP_SUMMARY"
echo "To find the \`prepare\` workflow run, [view the checks for this commit]($github_dot_com/$owner_with_name/commits/$ref)" >> "$GITHUB_STEP_SUMMARY"

View File

@ -0,0 +1,36 @@
# This workflow checks that there is either a 'pr/no-changelog' label applied to a PR
# or there is a .changelog/<pr number>.txt file associated with a PR for a changelog entry
name: Changelog Entry
on:
pull_request:
types: [opened, synchronize, labeled]
# Runs on PRs to main and all release branches
branches:
- main
jobs:
# checks that a .changelog entry is present for a PR
changelog-check:
# If there a `pr/no-changelog` label we ignore this check
if: "!contains(github.event.pull_request.labels.*.name, 'pr/no-changelog') || github.event.pull_request.user.login == 'dependabot'"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0 # by default the checkout action doesn't checkout all branches
- name: Check for changelog entry in diff
run: |
# check if there is a diff in the .changelog directory
changelog_files=$(git --no-pager diff --name-only HEAD "$(git merge-base HEAD "origin/${{ github.event.pull_request.base.ref }}")" -- .changelog/${{ github.event.pull_request.number }}.txt)
# If we do not find a file in .changelog/, we fail the check
if [ -z "$changelog_files" ]; then
# Fail status check when no .changelog entry was found on the PR
echo "Did not find a .changelog entry and the 'pr/no-changelog' label was not applied. Reference - https://github.com/hashicorp/terraform-provider-helm/tree/main/.github/workflows/CHANGELOG_GUIDE.md"
exit 1
else
echo "Found .changelog entry in PR!"
fi

View File

@ -0,0 +1,68 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
name: "CodeQL"
on:
push:
branches: [main]
pull_request:
# The branches below must be a subset of the branches above
branches: [main]
schedule:
- cron: '0 13 * * 0'
jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
# Override automatic language detection by changing the below list
# Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python']
language: ['go']
# Learn more...
# https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection
steps:
- name: Checkout repository
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
fetch-depth: 2
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@c4fb451437765abf5018c6fbf22cce1a7da1e5cc # codeql-bundle-v2.17.1
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@c4fb451437765abf5018c6fbf22cce1a7da1e5cc # codeql-bundle-v2.17.1
# Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language
#- run: |
# make bootstrap
# make release
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@c4fb451437765abf5018c6fbf22cce1a7da1e5cc # codeql-bundle-v2.17.1

View File

@ -0,0 +1,25 @@
name: HashiCorp Copywrite
on:
schedule:
- cron: '30 2 * * *'
pull_request:
branches:
- main
push:
branches:
- main
workflow_dispatch:
jobs:
copywrite:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
- name: Install copywrite
uses: hashicorp/setup-copywrite@32638da2d4e81d56a0764aa1547882fc4d209636 # v1.1.3
- name: Validate Header Compliance
run: copywrite headers --plan

View File

@ -0,0 +1,15 @@
name: Issue Comment Created Triage
on:
issue_comment:
types: [created]
jobs:
issue_comment_triage:
runs-on: ubuntu-latest
steps:
- uses: actions-ecosystem/action-remove-labels@2ce5d41b4b6aa8503e285553f75ed56e0a40bae0 # v1.3.0
with:
labels: |
stale
waiting-response

View File

@ -0,0 +1,56 @@
name: Issue Opened Triage
on:
issues:
types: [opened]
jobs:
issue_triage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
- uses: github/issue-labeler@c1b0f9f52a63158c4adc09425e858e87b32e9685 # v3.4
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
configuration-path: .github/labeler-issue-triage.yml
enable-versioned-regex: 0
oncall_review_assigner:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-node@v4
- run: npm install @pagerduty/pdjs
- uses: actions/github-script@e69ef5462fd455e02edcaf4dd7708eda96b9eda0 # v7.0.0
env:
PAGERDUTY_TOKEN: ${{ secrets.PAGERDUTY_TOKEN }}
with:
script: |
const { PAGERDUTY_TOKEN } = process.env
const { api } = require('@pagerduty/pdjs');
const pd = api({token: PAGERDUTY_TOKEN});
const reviewerList = new Map([
["Sheneska Williams", "sheneska"],
["Mauricio Alvarez Leon", "BBBmau"],
["Alex Somesan", "alexsomesan"],
["Alex Pilon", "appilon"],
["John Houston", "jrhouston"],
["Sacha Rybolovlev", "arybolovlev"],
]);
let resp = await pd.get('oncalls?escalation_policy_ids%5B%5D=PH8IF3M')
if (resp.status != 200){
core.setFailed("PagerDuty Error: " + resp.statusText)
}
const reviewer = resp.data.oncalls[0].user.summary
const reviewerGH = reviewerList.get(reviewer)
console.log("Assigning issue to " + reviewerGH);
resp = await github.rest.issues.addAssignees({
owner: context.repo.owner,
repo: context.repo.repo,
assignees: reviewerGH,
issue_number: context.issue.number,
})
if (resp.status != 201){
core.setFailed("error assigning reviewer: user doesn't have the appropriate permissions to be assigned an issue.")
}

View File

@ -0,0 +1,104 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0
on:
issues:
types: [opened, closed, deleted, reopened, edited]
issue_comment:
types: [created]
workflow_dispatch:
name: Jira Community Issue Sync
jobs:
sync:
runs-on: ubuntu-latest
name: Jira Community Issue sync
steps:
- name: Login
uses: atlassian/gajira-login@ca13f8850ea309cf44a6e4e0c49d9aa48ac3ca4c # v3
env:
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }}
JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}
- name: Set ticket type
id: set-ticket-type
run: |
echo "TYPE=GH Issue" >> $GITHUB_OUTPUT
- name: Set ticket labels
if: github.event.action == 'opened'
id: set-ticket-labels
run: |
LABELS="[\"${{github.event.repository.name}}\", "
if [[ "${{ contains(github.event.issue.labels.*.name, 'bug') }}" == "true" ]]; then LABELS+="\"bug\", "; fi
if [[ "${{ contains(github.event.issue.labels.*.name, 'enhancement') }}" == "true" ]]; then LABELS+="\"enhancement\", "; fi
if [[ "${{ contains(github.event.issue.labels.*.name, 'documentation') }}" == "true" ]]; then LABELS+="\"documentation\", "; fi
if [[ "${{ contains(github.event.issue.labels.*.name, 'needs-investigation') }}" == "true" ]]; then LABELS+="\"needs-investigation\", "; fi
if [[ "${{ contains(github.event.issue.labels.*.name, 'question') }}" == "true" ]]; then LABELS+="\"question\", "; fi
if [[ "${{ contains(github.event.issue.labels.*.name, 'size/XS') }}" == "true" ]]; then LABELS+="\"size/XS\", "; fi
if [[ "${{ contains(github.event.issue.labels.*.name, 'size/S') }}" == "true" ]]; then LABELS+="\"size/S\", "; fi
if [[ "${{ contains(github.event.issue.labels.*.name, 'size/M') }}" == "true" ]]; then LABELS+="\"size/M\", "; fi
if [[ "${{ contains(github.event.issue.labels.*.name, 'size/L') }}" == "true" ]]; then LABELS+="\"size/L\", "; fi
if [[ "${{ contains(github.event.issue.labels.*.name, 'size/XL') }}" == "true" ]]; then LABELS+="\"size/XL\", "; fi
if [[ "${{ contains(github.event.issue.labels.*.name, 'size/XXL') }}" == "true" ]]; then LABELS+="\"size/XXL\", "; fi
if [[ "${{ contains(github.event.issue.labels.*.name, 'acknowledged') }}" == "true" ]]; then LABELS+="\"acknowledged\", "; fi
if [[ "${{ contains(github.event.issue.labels.*.name, 'help wanted') }}" == "true" ]]; then LABELS+="\"help wanted\", "; fi
if [[ "${{ contains(github.event.issue.labels.*.name, 'upstream-helm') }}" == "true" ]]; then LABELS+="\"upstream-helm\", "; fi
if [[ "${{ contains(github.event.issue.labels.*.name, 'upstream-terraform') }}" == "true" ]]; then LABELS+="\"upstream-terraform\", "; fi
if [[ "${{ contains(github.event.issue.labels.*.name, 'progressive apply') }}" == "true" ]]; then LABELS+="\"progressive apply\", "; fi
if [[ "${{ contains(github.event.issue.labels.*.name, 'pr/changelog') }}" == "true" ]]; then LABELS+="\"pr/changelog\", "; fi
if [[ "${{ contains(github.event.issue.labels.*.name, 'crash') }}" == "true" ]]; then LABELS+="\"crash\", "; fi
if [[ "${{ contains(github.event.issue.labels.*.name, 'breaking-change') }}" == "true" ]]; then LABELS+="\"breaking-change\", "; fi
if [[ "${{ contains(github.event.issue.labels.*.name, 'provider') }}" == "true" ]]; then LABELS+="\"provider\", "; fi
if [[ "${{ contains(github.event.issue.labels.*.name, 'stale') }}" == "true" ]]; then LABELS+="\"stale\", "; fi
if [[ ${#LABELS} != 1 ]]; then LABELS=${LABELS::-2}"]"; else LABELS+="]"; fi
echo "LABELS=${LABELS}" >> $GITHUB_OUTPUT
- name: Create ticket if an issue is filed, or if PR not by a team member is opened
if: github.event.action == 'opened'
uses: tomhjp/gh-action-jira-create@3ed1789cad3521292e591a7cfa703215ec1348bf # v0.2.1
with:
project: TFECO
issuetype: "${{ steps.set-ticket-type.outputs.TYPE }}"
summary: "${{ github.event.issue.title }}:[Issue-${{ github.event.issue.number }}] (${{ github.event.repository.name }})"
description: "${{ github.event.issue.body || github.event.pull_request.body }}\n\n_Created in GitHub by ${{ github.actor }}._\n\n${{ github.event.issue.html_url || github.event.pull_request.html_url }}"
# customfield_10089 is "Issue Link", customfield_10371 is "Source" (use JIRA API to retrieve)
extraFields: '{ "customfield_10089": "${{ github.event.issue.html_url || github.event.pull_request.html_url }}",
"customfield_10371": { "value": "GitHub" },
"customfield_10091": ["TF-HybridCloud"],
"labels": ${{ steps.set-ticket-labels.outputs.LABELS }} }'
env:
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }}
JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}
- name: Search
if: github.event.action != 'opened'
id: search
uses: tomhjp/gh-action-jira-search@04700b457f317c3e341ce90da5a3ff4ce058f2fa # v0.2.2
with:
# cf[10089] is Issue Link (use JIRA API to retrieve)
jql: 'issuetype = "${{ steps.set-ticket-type.outputs.TYPE }}" and cf[10089] = "${{ github.event.issue.html_url || github.event.pull_request.html_url }}"'
- name: Sync comment
if: github.event.action == 'created' && steps.search.outputs.issue
uses: tomhjp/gh-action-jira-comment@6eb6b9ead70221916b6badd118c24535ed220bd9 # v0.2.0
with:
issue: ${{ steps.search.outputs.issue }}
comment: "${{ github.actor }} ${{ github.event.review.state || 'commented' }}:\n\n${{ github.event.comment.body || github.event.review.body }}\n\n${{ github.event.comment.html_url || github.event.review.html_url }}"
- name: Close ticket
if: ( github.event.action == 'closed' || github.event.action == 'deleted' ) && steps.search.outputs.issue
uses: atlassian/gajira-transition@38fc9cd61b03d6a53dd35fcccda172fe04b36de3 # v3
with:
issue: ${{ steps.search.outputs.issue }}
transition: "Closed"
- name: Reopen ticket
if: github.event.action == 'reopened' && steps.search.outputs.issue
uses: atlassian/gajira-transition@38fc9cd61b03d6a53dd35fcccda172fe04b36de3 # v3
with:
issue: ${{ steps.search.outputs.issue }}
transition: "To Do"

View File

@ -0,0 +1,102 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0
on:
pull_request_target:
types: [opened, closed, reopened, edited]
workflow_dispatch:
name: Jira Community PR Sync
jobs:
sync:
runs-on: ubuntu-latest
name: Jira sync
steps:
- name: Login
uses: atlassian/gajira-login@ca13f8850ea309cf44a6e4e0c49d9aa48ac3ca4c # v3
env:
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }}
JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}
- name: Set ticket type
id: set-ticket-type
run: |
echo "TYPE=GH Issue" >> $GITHUB_OUTPUT
- name: Set ticket labels
if: github.event.action == 'opened'
id: set-ticket-labels
run: |
LABELS="[\"${{github.event.repository.name}}\", "
if [[ "${{ contains(github.event.pull_request.labels.*.name, 'bug') }}" == "true" ]]; then LABELS+="\"bug\", "; fi
if [[ "${{ contains(github.event.pull_request.labels.*.name, 'enhancement') }}" == "true" ]]; then LABELS+="\"enhancement\", "; fi
if [[ "${{ contains(github.event.pull_request.labels.*.name, 'documentation') }}" == "true" ]]; then LABELS+="\"documentation\", "; fi
if [[ "${{ contains(github.event.pull_request.labels.*.name, 'needs-investigation') }}" == "true" ]]; then LABELS+="\"needs-investigation\", "; fi
if [[ "${{ contains(github.event.pull_request.labels.*.name, 'question') }}" == "true" ]]; then LABELS+="\"question\", "; fi
if [[ "${{ contains(github.event.pull_request.labels.*.name, 'size/XS') }}" == "true" ]]; then LABELS+="\"size/XS\", "; fi
if [[ "${{ contains(github.event.pull_request.labels.*.name, 'size/S') }}" == "true" ]]; then LABELS+="\"size/S\", "; fi
if [[ "${{ contains(github.event.pull_request.labels.*.name, 'size/M') }}" == "true" ]]; then LABELS+="\"size/M\", "; fi
if [[ "${{ contains(github.event.pull_request.labels.*.name, 'size/L') }}" == "true" ]]; then LABELS+="\"size/L\", "; fi
if [[ "${{ contains(github.event.pull_request.labels.*.name, 'size/XL') }}" == "true" ]]; then LABELS+="\"size/XL\", "; fi
if [[ "${{ contains(github.event.pull_request.labels.*.name, 'size/XXL') }}" == "true" ]]; then LABELS+="\"size/XXL\", "; fi
if [[ "${{ contains(github.event.pull_request.labels.*.name, 'acknowledged') }}" == "true" ]]; then LABELS+="\"acknowledged\", "; fi
if [[ "${{ contains(github.event.pull_request.labels.*.name, 'help wanted') }}" == "true" ]]; then LABELS+="\"help wanted\", "; fi
if [[ "${{ contains(github.event.pull_request.labels.*.name, 'upstream-helm') }}" == "true" ]]; then LABELS+="\"upstream-helm\", "; fi
if [[ "${{ contains(github.event.pull_request.labels.*.name, 'upstream-terraform') }}" == "true" ]]; then LABELS+="\"upstream-terraform\", "; fi
if [[ "${{ contains(github.event.pull_request.labels.*.name, 'progressive apply') }}" == "true" ]]; then LABELS+="\"progressive apply\", "; fi
if [[ "${{ contains(github.event.pull_request.labels.*.name, 'pr/changelog') }}" == "true" ]]; then LABELS+="\"pr/changelog\", "; fi
if [[ "${{ contains(github.event.pull_request.labels.*.name, 'crash') }}" == "true" ]]; then LABELS+="\"crash\", "; fi
if [[ "${{ contains(github.event.pull_request.labels.*.name, 'breaking-change') }}" == "true" ]]; then LABELS+="\"breaking-change\", "; fi
if [[ "${{ contains(github.event.pull_request.labels.*.name, 'provider') }}" == "true" ]]; then LABELS+="\"provider\", "; fi
if [[ "${{ contains(github.event.pull_request.labels.*.name, 'stale') }}" == "true" ]]; then LABELS+="\"stale\", "; fi
if [[ ${#LABELS} != 1 ]]; then LABELS=${LABELS::-2}"]"; else LABELS+="]"; fi
echo "LABELS=${LABELS}" >> $GITHUB_OUTPUT
- name: Create ticket if a PR is opened
if: ( github.event.action == 'opened')
uses: tomhjp/gh-action-jira-create@3ed1789cad3521292e591a7cfa703215ec1348bf # v0.2.1
with:
project: TFECO
issuetype: "${{ steps.set-ticket-type.outputs.TYPE }}"
summary: "${{ github.event.pull_request.title }}:[PR-${{ github.event.pull_request.number }}] (${{ github.event.repository.name }})"
description: "${{ github.event.issue.body || github.event.pull_request.body }}\n\n_Created in GitHub by ${{ github.actor }}._\n\n${{ github.event.pull_request.html_url }}"
# customfield_10089 is "Issue Link", customfield_10371 is "Source" (use JIRA API to retrieve)
extraFields: '{ "customfield_10089": "${{ github.event.pull_request.html_url }}",
"customfield_10371": { "value": "GitHub" },
"customfield_10091": ["TF-HybridCloud"],
"labels": ${{ steps.set-ticket-labels.outputs.LABELS }} }'
env:
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }}
JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}
- name: Search
if: github.event.action != 'opened'
id: search
uses: tomhjp/gh-action-jira-search@04700b457f317c3e341ce90da5a3ff4ce058f2fa # v0.2.2
with:
# cf[10089] is Issue Link (use JIRA API to retrieve)
jql: 'issuetype = "${{ steps.set-ticket-type.outputs.TYPE }}" and cf[10089] = "${{ github.event.issue.html_url || github.event.pull_request.html_url }}"'
- name: Sync comment
if: github.event.action == 'created' && steps.search.outputs.issue
uses: tomhjp/gh-action-jira-comment@6eb6b9ead70221916b6badd118c24535ed220bd9 # v0.2.0
with:
issue: ${{ steps.search.outputs.issue }}
comment: "${{ github.actor }} ${{ github.event.review.state || 'commented' }}:\n\n${{ github.event.comment.body || github.event.review.body }}\n\n${{ github.event.comment.html_url || github.event.review.html_url }}"
- name: Close PR
if: ( github.event.action == 'closed' || github.event.action == 'deleted' || github.event.pull_request.merged == true) && steps.search.outputs.issue
uses: atlassian/gajira-transition@38fc9cd61b03d6a53dd35fcccda172fe04b36de3 # v3
with:
issue: ${{ steps.search.outputs.issue }}
transition: "Closed"
- name: Reopen PR
if: github.event.action == 'reopened' && steps.search.outputs.issue
uses: atlassian/gajira-transition@38fc9cd61b03d6a53dd35fcccda172fe04b36de3 # v3
with:
issue: ${{ steps.search.outputs.issue }}
transition: "To Do"

View File

@ -0,0 +1,23 @@
name: 'Lock Threads'
on:
schedule:
- cron: '49 1 * * *'
jobs:
lock:
runs-on: ubuntu-latest
steps:
- uses: dessant/lock-threads@1bf7ec25051fe7c00bdd17e6a7cf3d7bfb7dc771 # v5.0.1
with:
github-token: ${{ github.token }}
issue-lock-comment: >
I'm going to lock this issue because it has been closed for _30 days_ ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
issue-lock-inactive-days: '30'
pr-lock-comment: >
I'm going to lock this pull request because it has been closed for _30 days_ ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
pr-lock-inactive-days: '30'

View File

@ -0,0 +1,15 @@
name: "Close stale issues"
on:
schedule:
- cron: "0 0 * * *"
jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@28ca1036281a5e5922ead5184a1bbf96e5fc984e # 9.0.0
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: 'Marking this issue as stale due to inactivity. If this issue receives no comments in the next 30 days it will automatically be closed. If this issue was automatically closed and you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. This helps our maintainers find and focus on the active issues. Maintainers may also remove the stale label at their discretion. Thank you!'
days-before-stale: 365
days-before-close: 30

View File

@ -0,0 +1,25 @@
name: "Pull Request Triage"
on: [pull_request_target]
jobs:
triage:
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@ba790c862c380240c6d5e7427be5ace9a05c754b # v4.0.3
with:
configuration-path: .github/labeler-pull-request-triage.yml
repo-token: "${{ secrets.GITHUB_TOKEN }}"
- uses: CodelyTV/pr-size-labeler@54ef36785e9f4cb5ecf1949cfc9b00dbb621d761 # v1.8.1
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
xs_label: 'size/XS'
xs_max_size: '30'
s_label: 'size/S'
s_max_size: '60'
m_label: 'size/M'
m_max_size: '150'
l_label: 'size/L'
l_max_size: '300'
xl_label: 'size/XL'
message_if_xl: ''

View File

@ -0,0 +1,63 @@
name: "tests"
on:
push:
branches:
- main
pull_request:
branches:
- main
env:
KUBECONFIG: ${{ github.workspace }}/.kube/config
jobs:
get_version_matrix:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
- id: get_version_matrix
shell: bash
run: scripts/get-version-matrix.sh
outputs:
version_matrix: ${{ steps.get_version_matrix.outputs.matrix }}
unit_test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
- name: Set up Go
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
with:
go-version-file: go.mod
- name: Unit tests
env:
GOPATH: /home/runner/go
run: |
make test
make vet
acc_test:
needs: get_version_matrix
runs-on: ubuntu-latest
strategy:
# Don't cancel all in-progress and queued jobs in the matrix if any job in the matrix fails.
# That will be helpful to catch any issues related to a particular Terraform version.
fail-fast: false
matrix:
terraform_version: ${{ fromJson(needs.get_version_matrix.outputs.version_matrix) }}
steps:
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
- name: Set up Go
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
with:
go-version-file: go.mod
- uses: helm/kind-action@0025e74a8c7512023d06dc019c617aa3cf561fde # v1.10.0
id: kind
with:
wait: 2m
- name: Acceptance Tests
env:
KUBE_CONFIG_PATH: ${{ env.KUBECONFIG }}
TF_ACC_TERRAFORM_VERSION: ${{ matrix.terraform_version }}
TF_ACC_TEMP_DIR: ${{ runner.temp }}
TESTARGS: "-parallel 1"
run: |
make testacc

View File

@ -0,0 +1,17 @@
name: website
on:
push:
paths:
- "docs/**"
pull_request:
branches:
- main
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
- name: website-lint
run: |
make website-lint

View File

@ -0,0 +1,38 @@
terraform-provider-helm
terraform-provider-helm_v*
*.tfstate*
/build
assets
.terraform
_output/
.vscode
/results
*.dll
*.exe
.DS_Store
example.tf
terraform.tfvars
terraform.tfplan
bin/
modules-dev/
/pkg/
website/.vagrant
website/.bundle
website/build
website/node_modules
.vagrant/
*.backup
*.log
*.bak
*~
.*.swp
.idea
*.iml
*.test
*.iml
website/vendor
# Test exclusions
!command/test-fixtures/**/*.tfstate
!command/test-fixtures/**/.terraform/

View File

@ -0,0 +1,29 @@
{
"ignorePatterns": [
{
"pattern": "^http(s)?:\/\/terraform.io/(.*)"
}
],
"replacementPatterns": [
{
"pattern": "^(/docs/(?!providers/helm/))",
"replacement": "https://terraform.io$1"
},
{
"pattern": "^(?!http(s)?://)(.*)\\.html(#.*)?$",
"replacement": "$2.html.markdown$3"
},
{
"pattern": "^/docs/providers/helm/",
"replacement": "file:///github/workspace/docs/"
},
{
"pattern": "^(getting-started).html.markdown(#.*)?$",
"replacement": "file:///github/workspace/docs/guides/$1.html.md$2"
},
{
"pattern": "^file:///github/workspace/docs/guides/(.*)\\.markdown(#.*)?$",
"replacement": "file:///github/workspace/docs/guides/$1.md$2"
}
]
}

View File

@ -0,0 +1,19 @@
# Configuration for markdownlint
# https://github.com/DavidAnson/markdownlint#configuration
default: true
MD007:
indent: 2
# Disabled Rules
# https://github.com/DavidAnson/markdownlint/blob/master/doc/Rules.md
MD001: false
MD004: false
MD006: false
MD012: false
MD013: false
MD014: false
MD022: false
MD024: false
MD033: false

View File

@ -0,0 +1,81 @@
schema = "2"
project "terraform-provider-helm" {
team = "terraform"
slack {
notification_channel = "C051FAAHL8M" // #feed-terraform-ecosystem-kubernetes-releases
}
github {
organization = "hashicorp"
repository = "terraform-provider-helm"
release_branches = ["main", "release/**"]
}
}
event "merge" {
}
event "build" {
action "build" {
depends = ["merge"]
organization = "hashicorp"
repository = "terraform-provider-helm"
workflow = "build"
}
}
event "prepare" {
depends = ["build"]
action "prepare" {
organization = "hashicorp"
repository = "crt-workflows-common"
workflow = "prepare"
depends = ["build"]
}
notification {
on = "fail"
}
}
event "trigger-staging" {
}
event "promote-staging" {
action "promote-staging" {
organization = "hashicorp"
repository = "crt-workflows-common"
workflow = "promote-staging"
depends = null
config = "release-metadata.hcl"
}
depends = ["trigger-staging"]
notification {
on = "always"
}
}
event "trigger-production" {
}
event "promote-production" {
action "promote-production" {
organization = "hashicorp"
repository = "crt-workflows-common"
workflow = "promote-production"
depends = null
config = ""
}
depends = ["trigger-production"]
notification {
on = "always"
}
}

View File

@ -0,0 +1,4 @@
url_source_repository = "https://github.com/hashicorp/terraform-provider-helm"
url_project_website = "https://registry.terraform.io/providers/hashicorp/helm"
url_license = "https://github.com/hashicorp/terraform-provider-helm/blob/main/LICENSE"
url_release_notes = "https://github.com/hashicorp/terraform-provider-helm/blob/main/CHANGELOG.md"

View File

@ -0,0 +1,18 @@
binary {
secrets {
all = true
}
go_modules = true
osv = true
oss_index = false
nvd = false
triage {
suppress {
vulnerabilities = [
"GO",
"GHSA"
]
}
}
}

View File

@ -0,0 +1,16 @@
schema = 1
artifacts {
zip = [
"terraform-provider-helm_${version}_darwin_amd64.zip",
"terraform-provider-helm_${version}_darwin_arm64.zip",
"terraform-provider-helm_${version}_freebsd_386.zip",
"terraform-provider-helm_${version}_freebsd_amd64.zip",
"terraform-provider-helm_${version}_freebsd_arm.zip",
"terraform-provider-helm_${version}_linux_386.zip",
"terraform-provider-helm_${version}_linux_amd64.zip",
"terraform-provider-helm_${version}_linux_arm.zip",
"terraform-provider-helm_${version}_linux_arm64.zip",
"terraform-provider-helm_${version}_windows_386.zip",
"terraform-provider-helm_${version}_windows_amd64.zip",
]
}

View File

@ -0,0 +1,585 @@
## 3.0.1 (Jun 18, 2025)
This is a hotfix release.
HOTFIX:
- `helm_release`: Fix state upgrader code to use correct type for "values" attribute. [[GH-1638](https://github.com/hashicorp/terraform-provider-helm/pull/1638)]
## 3.0.0 (Jun 18, 2025)
This release migrates ports the provider project from `terraform-plugin-sdk/v2` to `terraform-plugin-framework` [[GH-1379](https://github.com/hashicorp/terraform-provider-helm/pull/1379)]
Please refer to the [migration guide](./docs/guides/v3-upgrade-guide.md).
BREAKING CHANGES:
- **Blocks to Nested Objects**: Blocks like `kubernetes`, `registry`, and `experiments` are now represented as nested objects.
- **List Syntax for Nested Attributes**: Attributes like `set`, `set_list`, and `set_sensitive` in `helm_release` and `helm_template` are now lists of nested objects instead of blocks
- The new framework code uses [Terraform Plugin Protocol Version 6](https://developer.hashicorp.com/terraform/plugin/terraform-plugin-protocol#protocol-version-6) which is compatible with Terraform versions 1.0 and aboove. Users of earlier versions of Terraform can continue to use the Helm provider by pinning their configuration to the 2.x version.
FEATURES:
* Add `"literal"` as a supported `type` for the `set` block [[GH-1615](https://github.com/hashicorp/terraform-provider-helm/issues/1615)]
* `helm_release`: Add support for ResourceIdentity. [[GH-1625](https://github.com/hashicorp/terraform-provider-helm/issues/1625)]
* `helm_release`: Add `set_wo` write-only attribute [[GH-1592](https://github.com/hashicorp/terraform-provider-helm/issues/1592)]
ENHANCEMENT:
* `helm_release`: Add `UpgradeState` logic to support migration from SDKv2 to Plugin Framework [[GH-1633](https://github.com/hashicorp/terraform-provider-helm/issues/1633)]
* update helm dependency to v3.17.2 [[GH-1608](https://github.com/hashicorp/terraform-provider-helm/issues/1608)]
BUG FIXES:
* `helm_release`: Fix namespace behaviour for dependency charts in non-default namespaces [[GH-1583](https://github.com/hashicorp/terraform-provider-helm/issues/1583)]
* change `set.value` && `set_list.value` to optional instead of required [[GH-1572](https://github.com/hashicorp/terraform-provider-helm/issues/1572)]
## 3.0.0-pre2 (Feb 27, 2025)
FEATURES:
* `helm_release`: Add `set_wo` write-only attribute [[GH-1592](https://github.com/hashicorp/terraform-provider-helm/issues/1592)]
BUG FIXES:
* change `set.value` && `set_list.value` to optional instead of required [[GH-1572](https://github.com/hashicorp/terraform-provider-helm/issues/1572)]
## 3.0.0-pre1 (Jan 16, 2025)
* This pre-release migrates ports the provider project from `terraform-plugin-sdk/v2` to `terraform-plugin-framework` [[GH-1379](https://github.com/hashicorp/terraform-provider-helm/pull/1379)]
Please refer to the [migration guide](./docs/guides/v3-upgrade-guide.md).
## 2.17.0 (Dec 19, 2024)
ENHANCEMENT:
* `resource/helm_release`: the dry-run option is now set to `server` to execute any chart lookups against the server during the plan stage. [[GH-1335](https://github.com/hashicorp/terraform-provider-helm/issues/1335)]
BUG FIXES:
* `resource/helm_release`: fix an issue where `postrender.args` is not parsed correctly. [[GH-1534](https://github.com/hashicorp/terraform-provider-helm/issues/1534)]
## 2.16.1 (Oct 15, 2024)
BUG FIXES:
* `helm_release`: Fix nil pointer deref panic on destroy when helm release is not found [[GH-1501](https://github.com/hashicorp/terraform-provider-helm/issues/1501)]
## 2.16.0 (Oct 10, 2024)
BUG FIXES:
* `helm_release`: On destroy, do not error when release is not found [[GH-1487](https://github.com/hashicorp/terraform-provider-helm/issues/1487)]
* `resource/helm_release`: Fix: only recompute metadata when the version in the metadata changes [[GH-1458](https://github.com/hashicorp/terraform-provider-helm/issues/1458)]
## 2.15.0 (Aug 14, 2024)
ENHANCEMENT:
* resource/helm_release: add `upgrade_install` boolean attribute to enable idempotent release installation, addressing components of [GH-425](https://github.com/hashicorp/terraform-provider-helm/issues/425) [[GH-1247](https://github.com/hashicorp/terraform-provider-helm/issues/1247)]
## 2.14.1 (Aug 7, 2024)
DEPENDENCIES:
* Bump golang.org/x/crypto from v0.23.0 to v0.25.0 [[GH-1399](https://github.com/hashicorp/terraform-provider-helm/pull/1399)]
* Bump k8s.io/api from v0.30.0 to v0.30.3 [[GH-1436](https://github.com/hashicorp/terraform-provider-helm/pull/1436)]
* Bump k8s.io/apimachinery from v0.30.0 to v0.30.3 [[GH-1436](https://github.com/hashicorp/terraform-provider-helm/pull/1436)]
* Bump k8s.io/client-go from v0.30.0 to v0.30.3 [[GH-1436](https://github.com/hashicorp/terraform-provider-helm/pull/1436)]
* Bump helm.sh/helm/v3 from v3.13.2 to v3.15.3 [[GH-1422](https://github.com/hashicorp/terraform-provider-helm/pull/1422)]
## 2.14.0 (June 13, 2024)
ENHANCEMENT:
* Add support for Terraform's experimental deferred actions [[GH-1377](https://github.com/hashicorp/terraform-provider-helm/issues/1377)]
* `helm_release`: add new attributes metadata.last_deployed, metadata.first_deployed, metadata.notes [[GH-1380](https://github.com/hashicorp/terraform-provider-helm/issues/1380)]
## 2.13.2 (May 8, 2024)
DEPENDENCIES:
* Bump github.com/docker/docker from 24.0.7 to 24.0.9
* Bump golang.org/x/net from 0.21.0 to 0.23.0
* Bundle license file with TF provider release artifacts
## 2.13.1 (Apr 15, 2024)
HOTFIX:
* `helm_release`: Fix regression causing errors at plan time.
## 2.13.0 (Apr 4, 2024)
BUG FIXES:
* `provider`: Fix manifest diff rendering for OCI charts. [[GH-1326](https://github.com/hashicorp/terraform-provider-helm/issues/1326)]
DOCS:
* `docs`: Use templatefile() instead of "template_file" provider in GKE example. [[GH-1329](https://github.com/hashicorp/terraform-provider-helm/issues/1329)]
## 2.12.1 (Nov 30, 2023)
DEPENDENCIES:
* Bump Golang from `1.20` to `1.21`. [[GH-1300](https://github.com/hashicorp/terraform-provider-helm/issues/1300)]
* Bump github.com/hashicorp/go-cty from `v1.4.1-0.20200414143053-d3edf31b6320` to `v1.4.1-0.20200723130312-85980079f637`. [[GH-1300](https://github.com/hashicorp/terraform-provider-helm/issues/1300)]
* Bump github.com/hashicorp/terraform-plugin-docs from `v0.14.1` to `v0.16.0`. [[GH-1300](https://github.com/hashicorp/terraform-provider-helm/issues/1300)]
* Bump github.com/hashicorp/terraform-plugin-sdk/v2 from `v2.26.1` to `v2.30.0`. [[GH-1300](https://github.com/hashicorp/terraform-provider-helm/issues/1300)]
* Bump golang.org/x/crypto from `v0.14.0` to `v0.16.0`. [[GH-1300](https://github.com/hashicorp/terraform-provider-helm/issues/1300)]
* Bump helm.sh/helm/v3 from `v3.13.1` to `v3.13.2`. [[GH-1300](https://github.com/hashicorp/terraform-provider-helm/issues/1300)]
* Bump k8s.io/api from `v0.28.3` to `v0.28.4`. [[GH-1300](https://github.com/hashicorp/terraform-provider-helm/issues/1300)]
* Bump k8s.io/apimachinery from `v0.28.3` to `v0.28.4`. [[GH-1300](https://github.com/hashicorp/terraform-provider-helm/issues/1300)]
* Bump k8s.io/client-go from `v0.28.3` to `v0.28.4`. [[GH-1300](https://github.com/hashicorp/terraform-provider-helm/issues/1300)]
* Bump sigs.k8s.io/yaml from `v1.3.0` to `v1.4.0`. [[GH-1300](https://github.com/hashicorp/terraform-provider-helm/issues/1300)]
## 2.12.0 (Nov 27, 2023)
BUG FIXES:
* `helm_release`: Fix perpetual diff when version attribute is an empty string [[GH-1246](https://github.com/hashicorp/terraform-provider-helm/issues/1246)]
DEPENDENCIES:
* Bump `helm.sh/helm/v3` from `3.12.0` to `3.13.1`
## 2.11.0 (Aug 24, 2023)
ENHANCEMENT:
* `kubernetes/provider.go`: Add `tls_server_name` kubernetes provider options. [[GH-839](https://github.com/hashicorp/terraform-provider-helm/issues/839)]
* `resource/helm_release`: add `name` field validation to be limited to 53 characters. [[GH-1228](https://github.com/hashicorp/terraform-provider-helm/issues/1228)]
BUG FIXES:
* `helm/resource_release.go`: Fix: version conflicts when using local chart [[GH-1176](https://github.com/hashicorp/terraform-provider-helm/issues/1176)]
* `resource/helm_release`: Add nil check for `set_list.value` to prevent provider ChartPathOptions [[GH-1231](https://github.com/hashicorp/terraform-provider-helm/issues/1231)]
## 2.10.1 (Jun 5, 2023)
HOTFIX:
* `helm_release`: Fix: Only recompute metadata if version actually changes. [[GH-1150](https://github.com/hashicorp/terraform-provider-helm/issues/1150)]
## 2.10.0 (May 30, 2023)
FEATURES:
* `helm_release`: Add `set_list` attribute [[GH-1071](https://github.com/hashicorp/terraform-provider-helm/issues/1071)]
BUG FIXES:
* `helm_release`: Always recompute metadata when a release is updated [[GH-1097](https://github.com/hashicorp/terraform-provider-helm/issues/1097)]
DEPENDENCIES:
* Bump `helm.sh/helm/v3` from `3.11.2` to `3.12.0` [[GH-1143](https://github.com/hashicorp/terraform-provider-helm/issues/1143)]
## 2.9.0 (February 14, 2023)
FEATURES:
* `provider`: Add a new attribute `burst_limit` for client-side throttling limit configuration. [[GH-1012](https://github.com/hashicorp/terraform-provider-helm/issues/1012)]
ENHANCEMENT:
* `data_source/helm_template`: Add a new attribute `crds` which when `include_crds` is set to `true` will be populated with a list of the manifests from the `crds/` folder of the chart. [[GH-1050](https://github.com/hashicorp/terraform-provider-helm/issues/1050)]
BUG FIXES:
* `resource/helm_release`: Fix an issue when the provider crashes with the error message `Provider produced inconsistent final plan` after upgrading from `v2.5.1` to `v2.6.0` and higher. That happened due to changes in the provider schema and the introduction of a new attribute `pass_credentials` that was not properly handled. [[GH-982](https://github.com/hashicorp/terraform-provider-helm/issues/982)]
DOCS:
* `data_source/helm_template`: Add a new attribute `crds` [[GH-1050](https://github.com/hashicorp/terraform-provider-helm/issues/1050)]
* `data_source/helm_template`: Correct some errors in examples. [[GH-1027](https://github.com/hashicorp/terraform-provider-helm/issues/1027)]
* `provider`: Add a new attribute `burst_limit`. [[GH-1012](https://github.com/hashicorp/terraform-provider-helm/issues/1012)]
* `provider`: Add a note regarding the `KUBECONFIG` environment variable. [[GH-1051](https://github.com/hashicorp/terraform-provider-helm/issues/1051)]
* `resource/helm_release`: Add usage example for `OCI` repositories. [[GH-1030](https://github.com/hashicorp/terraform-provider-helm/issues/1030)]
* `resource/helm_release`: Add usage examples for `GCS` and `S3` plugins. [[GH-1026](https://github.com/hashicorp/terraform-provider-helm/issues/1026)]
DEPENDENCIES:
* Bump `github.com/containerd/containerd` from `1.6.6` to `1.6.12` [[GH-1029](https://github.com/hashicorp/terraform-provider-helm/issues/1029)]
* Bump `golang.org/x/crypto` from `0.5.0` to `0.6.0` [[GH-1055](https://github.com/hashicorp/terraform-provider-helm/issues/1055)]
* Bump `helm.sh/helm/v3` from `3.9.4` to `3.11.1` [[GH-1036](https://github.com/hashicorp/terraform-provider-helm/issues/1036)] [[GH-1054](https://github.com/hashicorp/terraform-provider-helm/issues/1054)]
* Bump `k8s.io/client-go` from `0.24.2` to `0.26.1` [[GH-1037](https://github.com/hashicorp/terraform-provider-helm/issues/1037)]
NOTES:
* `provider`: `kubernetes.exec.api_version` no longer supports `client.authentication.k8s.io/v1alpha1`. Please, switch to `client.authentication.k8s.io/v1beta1` or `client.authentication.k8s.io/v1`. [[GH-1037](https://github.com/hashicorp/terraform-provider-helm/issues/1037)]
## Community Contributors :raised_hands:
- @loafoe made their contribution in https://github.com/hashicorp/terraform-provider-helm/pull/1012
## 2.8.0 (December 13, 2022)
FEATURES:
* Add support for configuring OCI registries inside provider block [[GH-862](https://github.com/hashicorp/terraform-provider-helm/issues/862)]
* Add support for setting kube version on helm_template data source [[GH-994](https://github.com/hashicorp/terraform-provider-helm/issues/994)]
BUG FIXES:
* Fix larger diff than expected when updating helm_release "set" block value [[GH-915](https://github.com/hashicorp/terraform-provider-helm/issues/915)]
## 2.7.1 (October 12, 2022)
BUG FIXES:
* Crash Fix: Fix Unknown Value in Manifest Diff [[GH-966](https://github.com/hashicorp/terraform-provider-helm/issues/966)]
## 2.7.0 (September 28, 2022)
FEATURES:
* Update helm package to 3.9.4 (#945)
* Show Manifest when creating release [[GH-903](https://github.com/hashicorp/terraform-provider-helm/issues/903)]
BUG FIXES:
* Do dependency update in resourceDiff #771 (#855)
* Crash: Fix `show_only` crash when string is empty [[GH-950](https://github.com/hashicorp/terraform-provider-helm/issues/950)]
## 2.6.0 (June 17, 2022)
IMPROVEMENTS:
* Upgrade helm dependency to 3.9.0 (#867)
* Add `args` attribute in `post_render` block in (#869)
* Add `pass_credentials` attribute (#841)
* Add `proxy_url` attribute to provider block (#843)
BUG FIXES:
* Don't persist state when update causes an error (#857)
## 2.5.1 (April 11, 2022)
FIX:
* Only run OCI login on create and update (#846)
* OCI login concurrency issue (#848)
## 2.5.0 (March 28, 2022)
* Upgrade helm dependency to v3.8.1
* Add support for OCI registries
## 2.4.1 (November 09, 2021)
HOTFIX:
* Fix exec plugin interactive mode regression (#798)
## 2.4.0 (November 08, 2021)
* Upgrade helm to 3.7.1
## 2.3.0 (August 27, 2021)
* Support templates with multiple resources in helm_template data source (#772)
* Upgrade helm to 3.6.2
## 2.2.0 (June 10, 2021)
* Add support for stand-alone debug mode (launch with -debug argument) (#748)
* Add helm_template data source to render chart templates locally (#483)
* Surface diagnostics when helm release creation fails (#727)
## 2.1.2 (April 27, 2021)
* Fix dependency download on resource update (#580)
* Add support for the --wait-for-jobs option (#720)
## 2.1.1 (April 16, 2021)
* Fix dry-run happening at plan when manifest is not enabled (#724)
## 2.1.0 (April 01, 2021)
IMPROVEMENTS:
* Add chart diff support by storing the rendered manifest (#702)
* Update to Helm 3.5.3 (#709)
* Docs: add link to Learn tutorial (#714)
BUG FIXES:
* Remove kubeconfig file check (#708)
## 2.0.3 (March 11, 2021)
BUG FIXES:
* Fix documentation for KUBE_TOKEN env var name (#684)
* Fix destroy stage error for charts with "helm.sh/resource-policy:keep" annotation (#671)
* Fix read function to set resource id to null when not found (#674)
IMPROVEMENTS:
* Update provider configuration docs (#673)
## 2.0.2 (January 18, 2021)
BUG FIXES:
* Remove check for empty kubernetes block
## 2.0.1 (December 19, 2020)
BUG FIXES:
* Move kubernetes config check out of providerConfigure (#648)
## 2.0.0 (December 19, 2020)
BREAKING CHANGES:
Please review our [upgrade guide](https://github.com/hashicorp/terraform-provider-helm/blob/master/website/docs/guides/v2-upgrade-guide.markdown).
* Update Terraform SDK to v2 (#594).
* Remove deprecated helm_repository resource and data source (#600)
* Remove implicit support for KUBECONFIG (#604)
* Remove load_config_file attribute (#604)
* Remove set_string attribute from helm_release (#608)
IMPROVEMENTS:
* Add support for multiple paths to kubeconfig files (#636)
* Remove remote dependencies from test-fixtures (#638)
* Set up matrix build to run acc tests against different tf versions (#637)
## 1.3.2 (October 07, 2020)
BUG FIXES:
* Fix nil pointer crash when using Helm plugins (#598)
## 1.3.1 (September 29, 2020)
IMPROVEMENTS:
* Upgrade Helm to 3.3.4 (#572)
## 1.3.0 (September 02, 2020)
IMPROVEMENTS:
* Added app_version to metadata attribute block (#532)
BUG FIXES:
* Fix nil path for `dependency_update` flag (#482)
## 1.2.4 (July 22, 2020)
BUG FIXES:
* Update go-version for CVE-2020-14039 (#548)
## 1.2.3 (June 16, 2020)
BUG FIXES:
* Fix concurrent read/write crash (#525)
* Fix for provider hang (#505)
## 1.2.2 (June 01, 2020)
BUG FIXES:
* Add a lint attribute to helm_release (#514)
## 1.2.1 (May 08, 2020)
BUG FIXES:
* Fix linter crash (#487)
## 1.2.0 (May 06, 2020)
IMPROVEMENTS:
* Cloak sensitive values in metadata field (#480)
* Upgrade to Helm 3.2.0
* Deprecate helm_repository data source
* Lint chart at plan time
## 1.1.1 (March 26, 2020)
BUG FIXES:
* Fix chart path bug causing unwanted diff (#449)
## 1.1.0 (March 19, 2020)
IMPROVEMENTS:
* Add import feature for helm_release (#394)
* Run acceptance tests in travis-ci using kind
* Upgrade helm to version v3.1.2 (#440)
* Add description attribute
* Add post-rendering support
BUG FIXES:
* Fix errors being swallowed when creating a helm_release (#406)
* Various documentation fixes
## 1.0.0 (February 05, 2020)
BREAKING CHANGES:
* No longer supports helm v2 (#378)
* Provider no longer supports the following parameters
* host
* home
* namespace
* init_helm_home
* install_tiller
* tiller_image
* connection_timeout
* service_account
* automount_service_account_token
* override
* max_history (Moved to the release)
* plugins_disable
* insecure
* enable_tls
* client_key
* client_certificate
* ca_certificate
* Release no longer supports the following parameters
* disable_crd_hooks
* Release Parameters that were renamed
* reuse was renamed to replace to match the rename in helm v3
IMPROVEMENTS:
* Upgrade Helm to v3.0
* Adds the following parameters to the provider
* plugins_path - (Optional) The path to the plugins directory. Defaults to `HELM_PLUGINS` env if it is set, otherwise uses the default path set by helm.
* registry_config_path - (Optional) The path to the registry config file. Defaults to `HELM_REGISTRY_CONFIG` env if it is set, otherwise uses the default path set by helm.
* repository_config_path - (Optional) The path to the file containing repository names and URLs. Defaults to `HELM_REPOSITORY_CONFIG` env if it is set, otherwise uses the default path set by helm.
* repository_cache - (Optional) The path to the file containing cached repository indexes. Defaults to `HELM_REPOSITORY_CACHE` env if it is set, otherwise uses the default path set by helm.
* helm_driver - (Optional) "The backend storage driver. Valid values are: `configmap`, `secret`, `memory`. Defaults to `secret`
* Adds the following parameters to the release
* repository_key_file - (Optional) The repositories cert key file
* repository_cert_file - (Optional) The repositories cert file
* repository_ca_file - (Optional) The Repositories CA File.
* repository_username - (Optional) Username for HTTP basic authentication against the repository.
* repository_password - (Optional) Password for HTTP basic authentication against the reposotory.
* reset_values - (Optional) When upgrading, reset the values to the ones built into the chart. Defaults to `false`.
* cleanup_on_fail - (Optional) Allow deletion of new resources created in this upgrade when upgrade fails. Defaults to `false`.
* max_history - (Optional) Maximum number of release versions stored per release. Defaults to 0 (no limit).
* atomic - (Optional) If set, installation process purges chart on fail. The wait flag will be set automatically if atomic is used. Defaults to false.
* skip_crds - (Optional) If set, no CRDs will be installed. By default, CRDs are installed if not already present. Defaults to false.
* render_subchart_notes - (Optional) If set, render subchart notes along with the parent. Defaults to true.
* dependency_update - (Optional) Runs helm dependency update before installing the chart. Defaults to false
## 0.10.5 (Unreleased)
## 0.10.4 (October 28, 2019)
BUG FIXES:
* Tiller installed version should match helm client (#365)
## 0.10.3 (October 27, 2019)
IMPROVEMENTS:
* Upgrade Helm to v2.15.1 and Kubernetes to v1.15.5
* Migrate to terraform-plugin-sdk
* Allow for colon separated KUBECONFIG (#98)
* Modernise docs
BUG FIXES:
* Remove manual installation instructions
* Fix loading kubeconfig when disabled (#307)
* Don't enable TLS if `enable_tls` is false (#245)
* Remove ForceNew on repo and chart changes (#173)
## 0.10.2 (August 07, 2019)
BUG FIXES:
* Revert "Escape commas in set_string" (#310)
## 0.10.1 (July 30, 2019)
IMPROVEMENTS:
* Update helm and tiller to 2.14.1 (#294)
* Wait for tiller if it's not ready (#295)
## 0.10.0 (June 18, 2019)
FEATURES:
* Automatically initialize the configured helm home directory (#185)
IMPROVEMENTS:
* Update helm and tiller to 2.14.0 (#277)
* Update terraform to 0.12.1 (#289 #290)
BUG FIXES:
* Fix concurrency issues reading multiple repos (#272)
* Documentation fixes (#262 #270 #276)
* helm/resource_release: typo fixes (#282)
## 0.9.1 (April 24, 2019)
FEATURES:
IMPROVEMENTS:
* Migrate to Terraform 0.12 SDK
* Move to Go modules for dep-management
BUG FIXES:
* Properly handle commas in attribute values
* Documentation fixes
## 0.9.0 (March 07, 2019)
FEATURES:
* `helm_repository` is now a data source. We retain backwards compatibility through `DataSourceResourceShim` (#221)
* Use configured helm home when reading default TLS settings (#210)
* Added `load_config_file` option to enable or disable the load of kubernetes config file (#231)
IMPROVEMENTS:
* CI and doc improvements
## 0.8.0 (February 11, 2019)
FEATURES:
* Added the possibility to set sensitive values (#153)
IMPROVEMENTS:
* Multiple README, logs and docs improvements
* Go 1.11 and modules (#179, #200 and #201)
* Default tiller version v2.11.0 (#194)
* Suppress diff of "keyring" and "devel" attributes (#193)
* Add entries to .gitignore to roughly match the Google provider (#206)
BUG FIXES:
* Fix when Helm provider ignores FAILED release state (#161)
* Use `127.0.0.1` as default `localhost` (#207)
## 0.7.0 (December 17, 2018)
- Based on Helm 2.11
## 0.6.2 (October 26, 2018)
- Bug fix: A recursion between the read and create methods as described in PR #137
## 0.6.1 (October 25, 2018)
- Re-release after induction into 'terraform-providers'. This is to align to the de-facto repository version sequence.
## 0.1.0 (October 10, 2018)
- Initial Release by Hashicorp

View File

@ -0,0 +1,111 @@
# How To Use
Helm Provider uses `go-changelog` to generate its changelog on release:
* https://github.com/hashicorp/go-changelog
To install, run the following commands:
```
go install github.com/hashicorp/go-changelog/cmd/changelog-build
go install github.com/hashicorp/go-changelog/cmd/changelog-entry
```
Either command can be ran with the following make command:
```
make changelog
make changelog-entry
```
## CHANGELOG entry examples
CHANGELOG entries are expected to be txt files created inside this folder
`.changelog`. The file name is expected to be the same pull request number that will
be linked when the CHANGELOG is generated. So for example, if your pull request is
\#1234, your file name would be `.changelog/1234.txt`.
While for git commit messages, we expect the leading subject to be more specific
as to the section it updates, for example a change with k8s might be:
```
builtin/k8s: Add support for feature Y
This commit adds support for feature Y....
```
The changelog entry should be more user facing friendly, so it would instead read:
~~~
```release-note:improvement
plugin/k8s: Add support for feature Y
```
~~~
Below are some examples of how to generate a CHANGELOG entry with your pull
request.
### Improvement
~~~
```release-note:improvement
server: Add new option for configs
```
~~~
### Feature
~~~
```release-note:feature
plugin/nomad: New feature integration
```
~~~
### Bug
~~~
```release-note:bug
plugin/docker: Fix broken code
```
~~~
### Multiple Entries
~~~
```release-note:bug
plugin/docker: Fix broken code
```
```release-note:bug
plugin/nomad: Fix broken code
```
```release-note:bug
plugin/k8s: Fix broken code
```
~~~
### Long Description with Markdown
~~~
```release-note:feature
cli: Lorem ipsum dolor `sit amet`, _consectetur_ adipiscing elit, **sed** do
eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim
veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
```
~~~
## How to generate CHANGELOG entries for release
Below is an example for running `go-changelog` to generate a collection of
entries. It will generate output that can be inserted into CHANGELOG.md.
For more information as to what each flag does, make sure to run `changelog-build -help`.
```
changelog-build -last-release v0.5.0 -entries-dir .changelog/ -changelog-template changelog.tmpl -note-template note.tmpl -this-release 86b6b38faa7c69f26f1d4c71e271cd4285daadf9
```

View File

@ -0,0 +1,130 @@
TEST?="./helm"
GOFMT_FILES?=$$(find . -name '*.go' |grep -v vendor)
COVER_TEST?=$$(go list ./... |grep -v 'vendor')
WEBSITE_REPO=github.com/hashicorp/terraform-website
PKG_NAME=helm
PKG_OS ?= darwin linux
PKG_ARCH ?= amd64
BASE_PATH ?= $(shell pwd)
BUILD_PATH ?= $(BASE_PATH)/build
PROVIDER := $(shell basename $(BASE_PATH))
BRANCH := $(shell git rev-parse --abbrev-ref HEAD)
VERSION ?= v0.0.0
ifneq ($(origin TRAVIS_TAG), undefined)
BRANCH := $(TRAVIS_TAG)
VERSION := $(TRAVIS_TAG)
endif
# For changelog generation, default the last release to the last tag on
# any branch, and this release to just be the current branch we're on.
LAST_RELEASE?=$$(git describe --tags $$(git rev-list --tags --max-count=1))
THIS_RELEASE?=$$(git rev-parse --abbrev-ref HEAD)
default: build
build: fmtcheck
go build -v .
# expected to be invoked by make changelog LAST_RELEASE=gitref THIS_RELEASE=gitref
changelog:
@echo "Generating changelog for $(THIS_RELEASE) from $(LAST_RELEASE)..."
@echo
@changelog-build -last-release $(LAST_RELEASE) \
-entries-dir .changelog/ \
-changelog-template .changelog/changelog.tmpl \
-note-template .changelog/note.tmpl \
-this-release $(THIS_RELEASE)
changelog-entry:
@changelog-entry -dir .changelog/
test: fmtcheck
go test $(TEST) -v || exit 1
echo $(TEST) | \
xargs -t -n4 go test $(TESTARGS) -timeout=30s
testacc: fmtcheck
TF_ACC=1 go test $(TEST) -v $(TESTARGS) -timeout 10m
testrace: fmtcheck
TF_ACC= go test -race $(TEST) $(TESTARGS)
cover:
@go tool cover 2>/dev/null; if [ $$? -eq 3 ]; then \
go get -u golang.org/x/tools/cmd/cover; \
fi
go test $(COVER_TEST) -coverprofile=coverage.out
go tool cover -html=coverage.out
rm coverage.out
vet:
@echo "go vet ."
@go vet $$(go list ./... | grep -v vendor/) ; if [ $$? -eq 1 ]; then \
echo ""; \
echo "Vet found suspicious constructs. Please check the reported constructs"; \
echo "and fix them if necessary before submitting the code for review."; \
exit 1; \
fi
fmt:
gofmt -w $(GOFMT_FILES)
fmtcheck:
@sh -c "'$(CURDIR)/scripts/gofmtcheck.sh'"
errcheck:
@sh -c "'$(CURDIR)/scripts/errcheck.sh'"
test-compile: fmtcheck
@if [ "$(TEST)" = "./..." ]; then \
echo "ERROR: Set TEST to a specific package. For example,"; \
echo " make test-compile TEST=./helm"; \
exit 1; \
fi
go test -c $(TEST) $(TESTARGS)
packages:
@for os in $(PKG_OS); do \
for arch in $(PKG_ARCH); do \
mkdir -p $(BUILD_PATH)/$(PROVIDER)_$${os}_$${arch} && \
cd $(BASE_PATH) && \
CGO_ENABLED=0 GOOS=$${os} GOARCH=$${arch} go build -o $(BUILD_PATH)/$(PROVIDER)_$${os}_$${arch}/$(PROVIDER)_$(VERSION) . && \
cd $(BUILD_PATH) && \
tar -cvzf $(BUILD_PATH)/$(PROVIDER)_$(BRANCH)_$${os}_$${arch}.tar.gz $(PROVIDER)_$${os}_$${arch}/; \
done; \
done;
clean:
@rm -rf $(BUILD_PATH)
# The docker command and run options may be overridden using env variables DOCKER and DOCKER_RUN_OPTS.
# Example:
# DOCKER="podman --cgroup-manager=cgroupfs" make website-lint
# DOCKER_RUN_OPTS="--userns=keep-id" make website-lint
# This option is needed for systems using SELinux and rootless containers.
# DOCKER_VOLUME_OPTS="rw,Z"
# For more info, see https://docs.docker.com/storage/bind-mounts/#configure-the-selinux-label
DOCKER?=$(shell which docker)
ifeq ($(strip $(DOCKER)),)
$(error "Docker binary could not be found in PATH. Please install docker, or specify an alternative by setting DOCKER=/path/to/binary")
endif
DOCKER_VOLUME_OPTS?="rw"
DOCKER_SELINUX := $(shell which setenforce)
ifeq ($(.SHELLSTATUS),0)
DOCKER_VOLUME_OPTS="rw,Z"
endif
# PROVIDER_DIR_DOCKER is used instead of PWD since docker volume commands can be dangerous to run in $HOME.
# This ensures docker volumes are mounted from within provider directory instead.
PROVIDER_DIR_DOCKER := $(abspath $(lastword $(dir $(MAKEFILE_LIST))))
website-lint:
@echo "==> Checking website against linters..."
@echo "==> Running markdownlint-cli using DOCKER='$(DOCKER)', DOCKER_RUN_OPTS='$(DOCKER_RUN_OPTS)' and DOCKER_VOLUME_OPTS='$(DOCKER_VOLUME_OPTS)'"
@$(DOCKER) run --rm $(DOCKER_RUN_OPTS) -v $(PROVIDER_DIR_DOCKER):/workspace:$(DOCKER_VOLUME_OPTS) -w /workspace 06kellyjac/markdownlint-cli ./docs \
&& (echo; echo "PASS - website markdown files pass linting"; echo ) \
|| (echo; echo "FAIL - issues found in website markdown files"; echo ; exit 1)
@echo "==> Checking for broken links..."
@scripts/markdown-link-check.sh "$(DOCKER)" "$(DOCKER_RUN_OPTS)" "$(DOCKER_VOLUME_OPTS)" "$(PROVIDER_DIR_DOCKER)"
.PHONY: build test testacc testrace cover vet fmt fmtcheck errcheck test-compile packages clean website-lint changelog changelog-entry

View File

@ -0,0 +1,375 @@
Copyright (c) 2017 HashiCorp, Inc.
Mozilla Public License Version 2.0
==================================
1. Definitions
--------------
1.1. "Contributor"
means each individual or legal entity that creates, contributes to
the creation of, or owns Covered Software.
1.2. "Contributor Version"
means the combination of the Contributions of others (if any) used
by a Contributor and that particular Contributor's Contribution.
1.3. "Contribution"
means Covered Software of a particular Contributor.
1.4. "Covered Software"
means Source Code Form to which the initial Contributor has attached
the notice in Exhibit A, the Executable Form of such Source Code
Form, and Modifications of such Source Code Form, in each case
including portions thereof.
1.5. "Incompatible With Secondary Licenses"
means
(a) that the initial Contributor has attached the notice described
in Exhibit B to the Covered Software; or
(b) that the Covered Software was made available under the terms of
version 1.1 or earlier of the License, but not also under the
terms of a Secondary License.
1.6. "Executable Form"
means any form of the work other than Source Code Form.
1.7. "Larger Work"
means a work that combines Covered Software with other material, in
a separate file or files, that is not Covered Software.
1.8. "License"
means this document.
1.9. "Licensable"
means having the right to grant, to the maximum extent possible,
whether at the time of the initial grant or subsequently, any and
all of the rights conveyed by this License.
1.10. "Modifications"
means any of the following:
(a) any file in Source Code Form that results from an addition to,
deletion from, or modification of the contents of Covered
Software; or
(b) any new file in Source Code Form that contains any Covered
Software.
1.11. "Patent Claims" of a Contributor
means any patent claim(s), including without limitation, method,
process, and apparatus claims, in any patent Licensable by such
Contributor that would be infringed, but for the grant of the
License, by the making, using, selling, offering for sale, having
made, import, or transfer of either its Contributions or its
Contributor Version.
1.12. "Secondary License"
means either the GNU General Public License, Version 2.0, the GNU
Lesser General Public License, Version 2.1, the GNU Affero General
Public License, Version 3.0, or any later versions of those
licenses.
1.13. "Source Code Form"
means the form of the work preferred for making modifications.
1.14. "You" (or "Your")
means an individual or a legal entity exercising rights under this
License. For legal entities, "You" includes any entity that
controls, is controlled by, or is under common control with You. For
purposes of this definition, "control" means (a) the power, direct
or indirect, to cause the direction or management of such entity,
whether by contract or otherwise, or (b) ownership of more than
fifty percent (50%) of the outstanding shares or beneficial
ownership of such entity.
2. License Grants and Conditions
--------------------------------
2.1. Grants
Each Contributor hereby grants You a world-wide, royalty-free,
non-exclusive license:
(a) under intellectual property rights (other than patent or trademark)
Licensable by such Contributor to use, reproduce, make available,
modify, display, perform, distribute, and otherwise exploit its
Contributions, either on an unmodified basis, with Modifications, or
as part of a Larger Work; and
(b) under Patent Claims of such Contributor to make, use, sell, offer
for sale, have made, import, and otherwise transfer either its
Contributions or its Contributor Version.
2.2. Effective Date
The licenses granted in Section 2.1 with respect to any Contribution
become effective for each Contribution on the date the Contributor first
distributes such Contribution.
2.3. Limitations on Grant Scope
The licenses granted in this Section 2 are the only rights granted under
this License. No additional rights or licenses will be implied from the
distribution or licensing of Covered Software under this License.
Notwithstanding Section 2.1(b) above, no patent license is granted by a
Contributor:
(a) for any code that a Contributor has removed from Covered Software;
or
(b) for infringements caused by: (i) Your and any other third party's
modifications of Covered Software, or (ii) the combination of its
Contributions with other software (except as part of its Contributor
Version); or
(c) under Patent Claims infringed by Covered Software in the absence of
its Contributions.
This License does not grant any rights in the trademarks, service marks,
or logos of any Contributor (except as may be necessary to comply with
the notice requirements in Section 3.4).
2.4. Subsequent Licenses
No Contributor makes additional grants as a result of Your choice to
distribute the Covered Software under a subsequent version of this
License (see Section 10.2) or under the terms of a Secondary License (if
permitted under the terms of Section 3.3).
2.5. Representation
Each Contributor represents that the Contributor believes its
Contributions are its original creation(s) or it has sufficient rights
to grant the rights to its Contributions conveyed by this License.
2.6. Fair Use
This License is not intended to limit any rights You have under
applicable copyright doctrines of fair use, fair dealing, or other
equivalents.
2.7. Conditions
Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted
in Section 2.1.
3. Responsibilities
-------------------
3.1. Distribution of Source Form
All distribution of Covered Software in Source Code Form, including any
Modifications that You create or to which You contribute, must be under
the terms of this License. You must inform recipients that the Source
Code Form of the Covered Software is governed by the terms of this
License, and how they can obtain a copy of this License. You may not
attempt to alter or restrict the recipients' rights in the Source Code
Form.
3.2. Distribution of Executable Form
If You distribute Covered Software in Executable Form then:
(a) such Covered Software must also be made available in Source Code
Form, as described in Section 3.1, and You must inform recipients of
the Executable Form how they can obtain a copy of such Source Code
Form by reasonable means in a timely manner, at a charge no more
than the cost of distribution to the recipient; and
(b) You may distribute such Executable Form under the terms of this
License, or sublicense it under different terms, provided that the
license for the Executable Form does not attempt to limit or alter
the recipients' rights in the Source Code Form under this License.
3.3. Distribution of a Larger Work
You may create and distribute a Larger Work under terms of Your choice,
provided that You also comply with the requirements of this License for
the Covered Software. If the Larger Work is a combination of Covered
Software with a work governed by one or more Secondary Licenses, and the
Covered Software is not Incompatible With Secondary Licenses, this
License permits You to additionally distribute such Covered Software
under the terms of such Secondary License(s), so that the recipient of
the Larger Work may, at their option, further distribute the Covered
Software under the terms of either this License or such Secondary
License(s).
3.4. Notices
You may not remove or alter the substance of any license notices
(including copyright notices, patent notices, disclaimers of warranty,
or limitations of liability) contained within the Source Code Form of
the Covered Software, except that You may alter any license notices to
the extent required to remedy known factual inaccuracies.
3.5. Application of Additional Terms
You may choose to offer, and to charge a fee for, warranty, support,
indemnity or liability obligations to one or more recipients of Covered
Software. However, You may do so only on Your own behalf, and not on
behalf of any Contributor. You must make it absolutely clear that any
such warranty, support, indemnity, or liability obligation is offered by
You alone, and You hereby agree to indemnify every Contributor for any
liability incurred by such Contributor as a result of warranty, support,
indemnity or liability terms You offer. You may include additional
disclaimers of warranty and limitations of liability specific to any
jurisdiction.
4. Inability to Comply Due to Statute or Regulation
---------------------------------------------------
If it is impossible for You to comply with any of the terms of this
License with respect to some or all of the Covered Software due to
statute, judicial order, or regulation then You must: (a) comply with
the terms of this License to the maximum extent possible; and (b)
describe the limitations and the code they affect. Such description must
be placed in a text file included with all distributions of the Covered
Software under this License. Except to the extent prohibited by statute
or regulation, such description must be sufficiently detailed for a
recipient of ordinary skill to be able to understand it.
5. Termination
--------------
5.1. The rights granted under this License will terminate automatically
if You fail to comply with any of its terms. However, if You become
compliant, then the rights granted under this License from a particular
Contributor are reinstated (a) provisionally, unless and until such
Contributor explicitly and finally terminates Your grants, and (b) on an
ongoing basis, if such Contributor fails to notify You of the
non-compliance by some reasonable means prior to 60 days after You have
come back into compliance. Moreover, Your grants from a particular
Contributor are reinstated on an ongoing basis if such Contributor
notifies You of the non-compliance by some reasonable means, this is the
first time You have received notice of non-compliance with this License
from such Contributor, and You become compliant prior to 30 days after
Your receipt of the notice.
5.2. If You initiate litigation against any entity by asserting a patent
infringement claim (excluding declaratory judgment actions,
counter-claims, and cross-claims) alleging that a Contributor Version
directly or indirectly infringes any patent, then the rights granted to
You by any and all Contributors for the Covered Software under Section
2.1 of this License shall terminate.
5.3. In the event of termination under Sections 5.1 or 5.2 above, all
end user license agreements (excluding distributors and resellers) which
have been validly granted by You or Your distributors under this License
prior to termination shall survive termination.
************************************************************************
* *
* 6. Disclaimer of Warranty *
* ------------------------- *
* *
* Covered Software is provided under this License on an "as is" *
* basis, without warranty of any kind, either expressed, implied, or *
* statutory, including, without limitation, warranties that the *
* Covered Software is free of defects, merchantable, fit for a *
* particular purpose or non-infringing. The entire risk as to the *
* quality and performance of the Covered Software is with You. *
* Should any Covered Software prove defective in any respect, You *
* (not any Contributor) assume the cost of any necessary servicing, *
* repair, or correction. This disclaimer of warranty constitutes an *
* essential part of this License. No use of any Covered Software is *
* authorized under this License except under this disclaimer. *
* *
************************************************************************
************************************************************************
* *
* 7. Limitation of Liability *
* -------------------------- *
* *
* Under no circumstances and under no legal theory, whether tort *
* (including negligence), contract, or otherwise, shall any *
* Contributor, or anyone who distributes Covered Software as *
* permitted above, be liable to You for any direct, indirect, *
* special, incidental, or consequential damages of any character *
* including, without limitation, damages for lost profits, loss of *
* goodwill, work stoppage, computer failure or malfunction, or any *
* and all other commercial damages or losses, even if such party *
* shall have been informed of the possibility of such damages. This *
* limitation of liability shall not apply to liability for death or *
* personal injury resulting from such party's negligence to the *
* extent applicable law prohibits such limitation. Some *
* jurisdictions do not allow the exclusion or limitation of *
* incidental or consequential damages, so this exclusion and *
* limitation may not apply to You. *
* *
************************************************************************
8. Litigation
-------------
Any litigation relating to this License may be brought only in the
courts of a jurisdiction where the defendant maintains its principal
place of business and such litigation shall be governed by laws of that
jurisdiction, without reference to its conflict-of-law provisions.
Nothing in this Section shall prevent a party's ability to bring
cross-claims or counter-claims.
9. Miscellaneous
----------------
This License represents the complete agreement concerning the subject
matter hereof. If any provision of this License is held to be
unenforceable, such provision shall be reformed only to the extent
necessary to make it enforceable. Any law or regulation which provides
that the language of a contract shall be construed against the drafter
shall not be used to construe this License against a Contributor.
10. Versions of the License
---------------------------
10.1. New Versions
Mozilla Foundation is the license steward. Except as provided in Section
10.3, no one other than the license steward has the right to modify or
publish new versions of this License. Each version will be given a
distinguishing version number.
10.2. Effect of New Versions
You may distribute the Covered Software under the terms of the version
of the License under which You originally received the Covered Software,
or under the terms of any subsequent version published by the license
steward.
10.3. Modified Versions
If you create software not governed by this License, and you want to
create a new license for such software, you may create and use a
modified version of this License if you rename the license and remove
any references to the name of the license steward (except to note that
such modified license differs from this License).
10.4. Distributing Source Code Form that is Incompatible With Secondary
Licenses
If You choose to distribute Source Code Form that is Incompatible With
Secondary Licenses under the terms of this version of the License, the
notice described in Exhibit B of this License must be attached.
Exhibit A - Source Code Form License Notice
-------------------------------------------
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
If it is not possible or desirable to put the notice in a particular
file, then You may include the notice in a location (such as a LICENSE
file in a relevant directory) where a recipient would be likely to look
for such a notice.
You may add additional accurate notices of copyright ownership.
Exhibit B - "Incompatible With Secondary Licenses" Notice
---------------------------------------------------------
This Source Code Form is "Incompatible With Secondary Licenses", as
defined by the Mozilla Public License, v. 2.0.

View File

@ -0,0 +1,15 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0
---
schema: 1.1
partition: tf-ecosystem
summary:
owner: team-tf-hybrid-cloud
description: |
This Helm provider for Terraform allows you to install and manage Helm Charts in your Kubernetes cluster using Terraform.
visibility: external

View File

@ -0,0 +1,10 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0
runbooks: []
#- name: <Link name>
# link: <Link URL>
other_links: []
#- name: <Link name>
# link: <Link URL>

View File

@ -0,0 +1,60 @@
<a href="https://terraform.io">
<img src=".github/tf.png" alt="Terraform logo" title="Terraform" align="left" height="50" />
</a>
# Helm Provider for Terraform [![Actions Status](https://github.com/hashicorp/terraform-provider-helm/workflows/tests/badge.svg)](https://github.com/hashicorp/terraform-provider-helm/actions)[![GitHub tag (latest SemVer)](https://img.shields.io/github/v/tag/hashicorp/terraform-provider-helm?label=release)](https://github.com/hashicorp/terraform-provider-helm/releases)[![license](https://img.shields.io/github/license/hashicorp/terraform-provider-helm.svg)]()[![Go Report Card](https://goreportcard.com/badge/github.com/hashicorp/terraform-provider-helm)](https://goreportcard.com/report/github.com/hashicorp/terraform-provider-helm)
- [Documentation](https://www.terraform.io/docs/providers/helm/index.html)
- [#terraform-providers in Kubernetes Slack](https://kubernetes.slack.com/messages/CJY6ATQH4) ([Sign up here](http://slack.k8s.io/))
This is the [Helm](https://github.com/kubernetes/helm) provider for [Terraform](https://www.terraform.io/).
This provider allows you to install and manage [Helm Charts](https://artifacthub.io/packages/search?kind=0&sort=relevance&page=1) in your Kubernetes cluster using Terraform.
## Contents
* [Requirements](#requirements)
* [Getting Started](#getting-started)
* [Contributing to the provider](#contributing)
## Requirements
- [Terraform](https://www.terraform.io/downloads.html) v1.x.x
- [Go](https://golang.org/doc/install) v1.22.x (to build the provider plugin)
## Getting Started
This is a small example of how to install the nginx ingress controller chart. Please read the [documentation](https://www.terraform.io/docs/providers/helm/index.html) for more
information.
```hcl
provider "helm" {
kubernetes = {
config_path = "~/.kube/config"
}
}
resource "helm_release" "nginx_ingress" {
name = "nginx-ingress-controller"
repository = "oci://registry-1.docker.io/bitnamicharts"
chart = "nginx-ingress-controller"
set = [
{
name = "service.type"
value = "ClusterIP"
}
]
}
```
## Contributing
The Helm Provider for Terraform is the work of many contributors. We appreciate your help!
To contribute, please read the [contribution guidelines](_about/CONTRIBUTING.md). You may also [report an issue](https://github.com/hashicorp/terraform-provider-helm/issues/new/choose). Once you've filed an issue, it will follow the [issue lifecycle](_about/ISSUES.md).
Also available are some answers to [Frequently Asked Questions](_about/FAQ.md).

View File

@ -0,0 +1,37 @@
Developing the Provider
------------
Thank you for your interest in contributing to the Helm provider. We welcome your contributions. Here you'll find information to help you get started with provider development.
## Documentation
Our [provider development documentation](https://www.terraform.io/docs/extend/) provides a good start into developing an understanding of provider development. It's the best entry point if you are new to contributing to this provider.
To learn more about how to create issues and pull requests in this repository, and what happens after they are created, you may refer to the resources below:
- [Issue creation and lifecycle](ISSUES.md)
- [Pull Request creation and lifecycle](PULL_REQUESTS.md)
### Installation from sources
If you wish to compile the provider from source code, you'll first need [Go](http://www.golang.org) installed on your machine (version >=1.14 is *required*). You'll also need to correctly setup a [GOPATH](http://golang.org/doc/code.html#GOPATH), as well as adding `$GOPATH/bin` to your `$PATH`.
Clone repository to: `$GOPATH/src/github.com/hashicorp/terraform-provider-helm`
```sh
> mkdir -p $GOPATH/src/github.com/terraform-providers
> git clone https://github.com/hashicorp/terraform-provider-helm.git $GOPATH/src/github.com/hashicorp/terraform-provider-helm
```
Enter the provider directory and build the provider
```sh
> cd $GOPATH/src/github.com/hashicorp/terraform-provider-helm
> make build
```
Now copy the compiled binary to the Terraform plugins folder. If this is your first plugin it may not be present.
```sh
> mkdir -p ~/.terraform.d/plugins/
> mv terraform-provider-helm ~/.terraform.d/plugins/
```

View File

@ -0,0 +1,45 @@
# Frequently Asked Questions
### Who are the maintainers?
The HashiCorp Terraform Kubernetes provider team is :
* Vishnu Ravindra, Product Manager - [@vravind1](https://github.com/vravind1)
* Alex Somesan, Engineer - [@alexsomesan](https://github.com/alexsomesan)
* John Houston, Engineer - [@jrhouston](https://github.com/jrhouston)
* Sacha Rybolovlev, Engineer - [@arybolovlev](https://github.com/arybolovlev)
* Mauricio Alvarez Leon, Engineer - [@BBBmau](https://github.com/BBBmau)
* Sheneska Williams, Engineer - [@sheneska](https://github.com/sheneska)
* Brandy Jackson, Engineering Manager - [@ibrandyjackson](https://github.com/ibrandyjackson)
Our collaborators are:
* Maximo Cuadros - [@mcuadros](https://github.com/mcuadros)
### Why isnt my PR merged yet?
Unfortunately, due to the volume of issues and new pull requests we receive, we are unable to give each one the full attention that we would like. We do our best to focus on the contributions that provide the greatest value to the most community members.
### How do you decide what gets merged for each release?
The number one factor we look at when deciding what issues to look at are your 👍 [reactions](https://blog.github.com/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/) to the original issue/PR description as these can be easily discovered. Comments that further explain desired use cases or poor user experience are also heavily factored. The items with the most support are always on our radar, and we do our best to keep the community updated on their status and potential timelines.
We also are investing time to improve the contributing experience by improving documentation.
### Backward Compatibility Promise
Our policy is described on the Terraform website [here](https://www.terraform.io/docs/extend/best-practices/versioning.html). While we do our best to prevent breaking changes until major version releases of the provider, it is generally recommended to [pin the provider version in your configuration](https://www.terraform.io/docs/configuration/providers.html#provider-versions).
Due to the constant release pace of Kubernetes and the relatively infrequent major version releases of the provider, there can be cases where a minor version update may contain unexpected changes depending on your configuration or environment.
### Where is the result of NOTES.txt?
Helm charts often contain NOTES.txt output that provide helpful next steps and occasionally provide debug information on missing environment variables etc. At present, this provider will not output or log the result of NOTES.txt on any installed charts. Temporarily install the chart via helm directly to see the output of NOTES.txt
### How can I help?
Check out the [Contributing Guide](CONTRIBUTING.md) for additional information.
### How can I become a maintainer?
This is an area under active research. Stay tuned!

View File

@ -0,0 +1,56 @@
# Issue Reporting and Lifecycle
## Issue Reporting Checklists
We welcome your feature requests and bug reports. Below you'll find short checklists with guidelines for well-formed
issues of each type.
### [Bug Reports](https://github.com/hashicorp/terraform-provider-helm/issues/new/choose)
- [ ] __Test against the latest release__: Make sure you test against the latest
released version. It is possible we already fixed the bug you're experiencing.
- [ ] __Search for possible duplicate reports__: It's helpful to keep bug
reports consolidated to one thread, so do a quick search on existing bug
reports to check if anybody else has reported the same thing. You can [scope
searches by the label "bug"](https://github.com/hashicorp/terraform-provider-helm/issues?q=is%3Aopen+is%3Aissue+label%3Abug) to help narrow things down.
- [ ] __Include steps to reproduce__: Provide steps to reproduce the issue,
along with your `.tf` files, with secrets removed, so we can try to
reproduce it. Without this, it makes it much harder to fix the issue.
- [ ] __For panics, include `crash.log`__: If you experienced a panic, please
create a [gist](https://gist.github.com) of the *entire* generated crash log
for us to look at. Double check no sensitive items were in the log.
### [Feature Requests](https://github.com/hashicorp/terraform-provider-helm/issues/new/choose)
- [ ] __Search for possible duplicate requests__: It's helpful to keep requests
consolidated to one thread, so do a quick search on existing requests to
check if anybody else has reported the same thing. You can [scope searches by
the label "enhancement"](https://github.com/hashicorp/terraform-provider-helm/issues?q=is%3Aopen+is%3Aissue+label%3Aenhancement) to help narrow things down.
- [ ] __Include a use case description__: In addition to describing the
behavior of the feature you'd like to see added, it's helpful to also lay
out the reason why the feature would be important and how it would benefit
Terraform users.
## Issue Lifecycle
1. The issue is reported on Github.
2. The issue is verified and categorized by a Terraform collaborator.
Categorization is done via GitHub labels. We use
one of `bug`, `enhancement`, `documentation`, or `question` using some automated workflows.
3. An initial triage process determines whether the issue is critical and must
be addressed immediately, or can be left open for community discussion. In this step, we typically assign a size estimate to the work involved for that issue for our reference. We'll label the issue `acknowledged` when we've run through this step.
4. The issue queued in our backlog to be addressed in a pull request or commit. The issue number will be
referenced in the commit message so that the code that fixes it is clearly
linked.
5. The issue is closed. Sometimes, valid issues will be closed because they are
tracked elsewhere or non-actionable. The issue is still indexed and
available for future viewers, or can be re-opened if necessary.

View File

@ -0,0 +1,46 @@
# Pull Request Submission and Lifecycle
We appreciate direct contributions to the provider codebase. Here's what to
expect:
* For pull requests that follow the guidelines, we will proceed to reviewing
and merging, following the provider team's review schedule. There may be some
internal or community discussion needed before we can complete this.
* Pull requests that don't follow the guidelines will be commented with what
they're missing. The person who submits the pull request or another community
member will need to address those requests before they move forward.
## Pull Request Lifecycle
1. [Fork the GitHub repository](https://help.github.com/en/articles/fork-a-repo),
modify the code, and [create a pull request](https://help.github.com/en/articles/creating-a-pull-request-from-a-fork).
You are welcome to submit your pull request for commentary or review before
it is fully completed by creating a [draft pull request](https://help.github.com/en/articles/about-pull-requests#draft-pull-requests).
Please include specific questions or items you'd like feedback on.
1. Our documentation utilizes the [`tfplugindocs`](https://github.com/hashicorp/terraform-plugin-docs) tool. When making updates to documentation, please only edit the `.md.tmpl` files and execute the `tfplugindocs generate` command to ensure the changes are reflected in the `.md` files.
1. Once you believe your pull request is ready to be reviewed, ensure the
pull request is not a draft pull request by [marking it ready for review](https://help.github.com/en/articles/changing-the-stage-of-a-pull-request) and a
maintainer will review it.
1. One of Terraform's provider team members will look over your contribution and
either approve it or provide comments letting you know if there is anything
left to do. We do our best to keep up with the volume of PRs waiting for
review, but it will take some time for us to reach your PR based on the tasks we have in our backlog. Please do not leave LGTM comments or approvals on PRs unless you are a maintainer on the repository.
1. Once all outstanding comments and checklist items have been addressed, your
contribution will be merged! Merged PRs will be included in the next
Terraform release. The provider team takes care of updating the CHANGELOG as
they merge.
1. In some cases, we might decide that a PR should be closed without merging.
We'll make sure to provide clear reasoning when this happens.
### Go Coding Style
The following Go language resources provide common coding preferences that may be referenced during review, if not automatically handled by the project's linting tools.
- [Effective Go](https://golang.org/doc/effective_go.html)
- [Go Code Review Comments](https://github.com/golang/go/wiki/CodeReviewComments)

View File

@ -0,0 +1,232 @@
---
page_title: "helm: helm_template"
sidebar_current: "docs-helm-template"
description: |-
---
# Data Source: helm_template
Render chart templates locally.
`helm_template` renders chart templates locally and exposes the rendered manifests in the data source attributes. `helm_template` mimics the functionality of the `helm template` command.
The arguments aim to be identical to the `helm_release` resource.
For further details on the `helm template` command, refer to the [Helm documentation](https://helm.sh/docs/helm/helm_template/).
<!-- schema generated by tfplugindocs -->
## Schema
### Required
- `chart` (String) Chart name to be installed. A path may be used.
- `name` (String) Release name.
### Optional
- `api_versions` (List of String) Kubernetes api versions used for Capabilities.APIVersions
- `atomic` (Boolean) If set, installation process purges chart on fail. The wait flag will be set automatically if atomic is used. Defaults to `false`.
- `crds` (List of String) List of rendered CRDs from the chart.
- `create_namespace` (Boolean) Create the namespace if it does not exist. Defaults to `false`.
- `dependency_update` (Boolean) Run helm dependency update before installing the chart. Defaults to `false`.
- `description` (String) Add a custom description
- `devel` (Boolean) Use chart development versions, too. Equivalent to version '>0.0.0-0'. If `version` is set, this is ignored
- `disable_openapi_validation` (Boolean) If set, the installation process will not validate rendered templates against the Kubernetes OpenAPI Schema.Defaults to `false`.
- `disable_webhooks` (Boolean) Prevent hooks from running.Defaults to `300` seconds.
- `include_crds` (Boolean) Include CRDs in the templated output
- `is_upgrade` (Boolean) Set .Release.IsUpgrade instead of .Release.IsInstall
- `keyring` (String) Location of public keys used for verification. Used only if `verify` is true. Defaults to `/.gnupg/pubring.gpg` in the location set by `home`.
- `kube_version` (String) Kubernetes version used for Capabilities.KubeVersion
- `manifest` (String) Concatenated rendered chart templates. This corresponds to the output of the `helm template` command.
- `manifests` (Map of String) Map of rendered chart templates indexed by the template name.
- `namespace` (String) Namespace to install the release into. Defaults to `default`.
- `notes` (String) Rendered notes if the chart contains a `NOTES.txt`.
- `pass_credentials` (Boolean) Pass credentials to all domains. Defaults to `false`.
- `postrender` (Block List, Max: 1) Postrender command configuration. (see [below for nested schema](#nestedblock--postrender))
- `render_subchart_notes` (Boolean) If set, render subchart notes along with the parent. Defaults to `true`.
- `replace` (Boolean) Re-use the given name, even if that name is already used. This is unsafe in production. Defaults to `false`.
- `repository` (String) Repository where to locate the requested chart. If is a URL the chart is installed without installing the repository.
- `repository_ca_file` (String) The Repositories CA File
- `repository_cert_file` (String) The repositories cert file
- `repository_key_file` (String) The repositories cert key file
- `repository_password` (String, Sensitive) Password for HTTP basic authentication
- `repository_username` (String) Username for HTTP basic authentication
- `reset_values` (Boolean) When upgrading, reset the values to the ones built into the chart.Defaults to `false`.
- `reuse_values` (Boolean) When upgrading, reuse the last release's values and merge in any overrides. If 'reset_values' is specified, this is ignored. Defaults to `false`.
- `set` (Block Set) Custom values to be merged with the values. (see [below for nested schema](#nestedblock--set))
- `set_list` (Block List) Custom list values to be merged with the values. (see [below for nested schema](#nestedblock--set_list))
- `set_sensitive` (Block Set) Custom sensitive values to be merged with the values. (see [below for nested schema](#nestedblock--set_sensitive))
- `set_string` (Block Set, Deprecated) Custom string values to be merged with the values. (see [below for nested schema](#nestedblock--set_string))
- `show_only` (List of String) Only show manifests rendered from the given templates
- `skip_crds` (Boolean) If set, no CRDs will be installed. By default, CRDs are installed if not already present. Defaults to `false`.
- `skip_tests` (Boolean) If set, tests will not be rendered. By default, tests are rendered. Defaults to `false`.
- `timeout` (Number) Time in seconds to wait for any individual kubernetes operation. Defaults to `300` seconds.
- `validate` (Boolean) Validate your manifests against the Kubernetes cluster you are currently pointing at. This is the same validation performed on an install
- `values` (List of String) List of values in raw yaml format to pass to helm.
- `verify` (Boolean) Verify the package before installing it.Defaults to `false`.
- `version` (String) Specify the exact chart version to install. If this is not specified, the latest version is installed.
- `wait` (Boolean) Will wait until all resources are in a ready state before marking the release as successful.Defaults to `true`.
### Read-Only
- `id` (String) The ID of this resource.
<a id="nestedblock--postrender"></a>
### Nested Schema for `postrender`
Required:
- `binary_path` (String) The command binary path.
<a id="nestedblock--set"></a>
### Nested Schema for `set`
Required:
- `name` (String)
Optional:
- `type` (String)
- `value` (String)
<a id="nestedblock--set_list"></a>
### Nested Schema for `set_list`
Required:
- `name` (String)
- `value` (List of String)
<a id="nestedblock--set_sensitive"></a>
### Nested Schema for `set_sensitive`
Required:
- `name` (String)
- `value` (String, Sensitive)
Optional:
- `type` (String)
<a id="nestedblock--set_string"></a>
### Nested Schema for `set_string`
Required:
- `name` (String)
- `value` (String)
## Example Usage
### Render all chart templates
The following example renders all templates of the `mariadb` chart of the official Helm stable repository. Concatenated manifests are exposed as output variable `mariadb_instance_manifest`.
```terraform
data "helm_template" "mariadb_instance" {
name = "mariadb-instance"
namespace = "default"
repository = "https://charts.helm.sh/stable"
chart = "mariadb"
version = "7.1.0"
set = [
{
name = "service.port"
value = "13306"
}
]
set_sensitive = [
{
name = "rootUser.password"
value = "s3cr3t!"
}
]
}
resource "local_file" "mariadb_manifests" {
for_each = data.helm_template.mariadb_instance.manifests
filename = "./${each.key}"
content = each.value
}
output "mariadb_instance_manifest" {
value = data.helm_template.mariadb_instance.manifest
}
output "mariadb_instance_manifests" {
value = data.helm_template.mariadb_instance.manifests
}
output "mariadb_instance_notes" {
value = data.helm_template.mariadb_instance.notes
}
```
### Render selected chart templates
The following example renders only the templates `master-statefulset.yaml` and `master-svc.yaml` of the `mariadb` chart of the official Helm stable repository.
```terraform
data "helm_template" "mariadb_instance" {
name = "mariadb-instance"
namespace = "default"
repository = "https://charts.helm.sh/stable"
chart = "mariadb"
version = "7.1.0"
show_only = [
"templates/master-statefulset.yaml",
"templates/master-svc.yaml",
]
set = [
{
name = "service.port"
value = "13306"
}
]
set_sensitive = [
{
name = "rootUser.password"
value = "s3cr3t!"
}
]
}
resource "local_file" "mariadb_manifests" {
for_each = data.helm_template.mariadb_instance.manifests
filename = "./${each.key}"
content = each.value
}
output "mariadb_instance_manifest" {
value = data.helm_template.mariadb_instance.manifest
}
output "mariadb_instance_manifests" {
value = data.helm_template.mariadb_instance.manifests
}
output "mariadb_instance_notes" {
value = data.helm_template.mariadb_instance.notes
}
```

View File

@ -0,0 +1,72 @@
---
layout: "helm"
page_title: "Helm: Upgrade Guide for Helm Provider v2.0.0"
description: |-
This guide covers the changes introduced in v2.0.0 of the Helm provider and what you may need to do to upgrade your configuration.
---
# Upgrading to v2.0.0 of the Helm provider
This guide covers the changes introduced in v2.0.0 of the Helm provider and what you may need to do to upgrade your configuration.
## Changes in v2.0.0
### Changes to Kubernetes credentials supplied in the provider block
We have made several changes to the way access to Kubernetes is configured in the provider block.
1. The `load_config_file` attribute has been removed.
2. Support for the `KUBECONFIG` environment variable has been dropped and replaced with `KUBE_CONFIG_PATH`.
3. The `config_path` attribute will no longer default to `~/.kube/config` and must be set explicitly.
The above changes have been made to encourage the best practise of configuring access to Kubernetes in the provider block explicitly, instead of relying upon default paths or `KUBECONFIG` being set. We have done this because allowing the provider to configure its access to Kubernetes implicitly caused confusion with a subset of our users. It also created risk for users who use Terraform to manage multiple clusters. Requiring explicit configuring for kubernetes in the provider block eliminates the possibility that the configuration will be applied to the wrong cluster.
You will therefore need to explicity configure access to your Kubernetes cluster in the provider block going forward. For many users this will simply mean specifying the `config_path` attribute in the provider block. Users already explicitly configuring the provider should not be affected by this change, but will need to remove the `load_config_file` attribute if they are currently using it.
When running Terraform inside a Kubernetes cluster no provider configuration is neccessary, as the provider will detect that is has access to a service account token.
### Removal of the `helm_repository` data source
This feature of the provider caused a fair bit of confusion and was a source of instability as data sources are not supposed to be stateful. This data source performed a stateful operation that modified the filesystem, mirroring similar functionality to the `helm repo add` command. It has been the recommendation for some time to configure repository information explicity at the `helm_resource` level and so the data source has been removed. See the example below.
```hcl
resource "helm_release" "redis" {
name = "redis"
repository = "https://charts.bitnami.com/bitnami"
chart = "redis"
}
```
The provider will continue to work with repositories that are configured with `helm repo add` before Terraform is run.
### Removal of `set_string` in the `helm_release` resource
The addition of a `type` attribute to the `set` block has rendered `set_string` superfluous so it has been removed. See the example below on how to set a string using the `set` block. This is used when the type of a value is an ambigious (e.g strings containing only numbers, true, false) and we want it to be explicitly parsed as a string.
```hcl
resource "helm_release" "redis" {
name = "redis"
repository = "https://charts.bitnami.com/bitnami"
chart = "redis"
set {
name = "test.value"
value = "123456"
type = "string"
}
}
```
### Dropped support for Terraform 0.11
All builds of the Helm provider going forward will no longer work with Terraform 0.11. See [Upgrade Guides](https://www.terraform.io/upgrade-guides/index.html) for how to migrate your configurations to a newer version of Terraform.
### Upgrade to v2 of the Terraform Plugin SDK
Contributors to the provider will be interested to know this upgrade has brought the latest version of the [Terraform Plugin SDK](https://github.com/hashicorp/terraform-plugin-sdk) which introduced a number of enhancements to the developer experience. Details of the changes introduced can be found under [Extending Terraform](https://www.terraform.io/docs/extend/guides/v2-upgrade-guide.html).
## Helm 2
We removed support in the provider for Helm 2 earlier this year. In accordance with the [Helm v2 deprecation timeline](https://helm.sh/blog/helm-v2-deprecation-timeline/) we will no longer be accepting PRs or handling issues that relate to Helm 2 going forward.

View File

@ -0,0 +1,246 @@
---
layout: "helm"
page_title: "Helm: Upgrade Guide for Helm Provider v3.0.0"
description: |-
This guide covers the changes introduced in v3.0.0 of the Helm provider and what you may need to do to upgrade your configuration.
---
# Upgrading to v3.0.0 of the Helm provider
This guide covers the changes introduced in v3.0.0 of the Helm provider and what you may need to do to upgrade your configuration.
## Changes in v3.0.0
### Adoption of the Terraform Plugin Framework
The Helm provider has been migrated from the legacy [Terraform Plugin SDKv2](https://github.com/hashicorp/terraform-plugin-sdk) to the [Terraform Plugin Framework](https://github.com/hashicorp/terraform-plugin-framework). This migration introduces structural changes to the schema, affecting nested blocks, attribute names, and how configurations are represented. Users must update their configurations to align with the new framework. Key changes include:
- **Blocks to Nested Objects**: Blocks like `kubernetes`, `registry`, and `experiments` are now represented as nested objects.
- **List Syntax for Nested Attributes**: Attributes like `set`, `set_list`, and `set_sensitive` in `helm_release` and `helm_template` are now lists of nested objects instead of blocks.
### Terraform Version Compatability
The new framework code uses [Terraform Plugin Protocol Version 6](https://developer.hashicorp.com/terraform/plugin/terraform-plugin-protocol#protocol-version-6) which is compatible with Terraform versions 1.0 and aboove. Users of earlier versions of Terraform can continue to use the Helm provider by pinning their configuration to the 2.x version.
---
### Changes to Provider Attributes
#### Kubernetes Configuration (`kubernetes`)
The `kubernetes` block has been updated to a single nested object.
**Old SDKv2 Configuration:**
```hcl
provider "helm" {
kubernetes {
config_path = "~/.kube/config"
}
registry {
url = "oci://localhost:5000"
username = "username"
password = "password"
}
registry {
url = "oci://private.registry"
username = "username"
password = "password"
}
}
```
**New Plugin Framework Configuration:**
```hcl
provider "helm" {
kubernetes = {
config_path = "~/.kube/config"
}
registries = [
{
url = "oci://localhost:5000"
username = "username"
password = "password"
},
{
url = "oci://private.registry"
username = "username"
password = "password"
}
]
}
```
**What Changed?**
- `kubernetes` is now a single nested object attribute using `{ ... }`.
- `registry` blocks have been replaced by a `registries` list attribute.
#### Experiments Configuration (experiments)
The `experiments` block has been updated to a list of nested objects.
**Old SDKv2 Configuration:**
```hcl
provider "helm" {
experiments {
manifest = true
}
}
```
**New Plugin Framework Configuration:**
```hcl
provider "helm" {
experiments = {
manifest = true
}
}
```
**What Changed?**
- `experiments` is now a single nested object attribute using `{ ... }`.
### Changes to helm_release Resource
#### `set`, `set_list`, and `set_sensitive` Configuration
Attributes `set`, `set_list`, and `set_sensitive` are now represented as lists of nested objects instead of individual blocks.
**Old SDKv2 Configuration:**
```hcl
resource "helm_release" "nginx_ingress" {
name = "nginx-ingress-controller"
repository = "https://charts.bitnami.com/bitnami"
chart = "nginx-ingress-controller"
set {
name = "service.type"
value = "ClusterIP"
}
set_list {
name = "allowed.hosts"
value = ["host1", "host2"]
}
set_sensitive {
name = "api.key"
value = "super-secret-key"
}
}
```
**New Plugin Framework Configuration:**
```hcl
resource "helm_release" "nginx_ingress" {
name = "nginx-ingress-controller"
repository = "https://charts.bitnami.com/bitnami"
chart = "nginx-ingress-controller"
set = [
{
name = "service.type"
value = "ClusterIP"
}
]
set_list = [
{
name = "allowed.hosts"
value = ["host1", "host2"]
}
]
set_sensitive = [
{
name = "api.key"
value = "super-secret-key"
}
]
}
```
**What Changed?**
- `set`, `set_list`, and `set_sensitive` is now a list of nested objects using `[ { ... } ]`.
### Changes to helm_template Data Source
#### `set`, `set_list`, and `set_sensitive` Configuration
Attributes `set`, `set_list`, and `set_sensitive` are now represented as lists of nested objects instead of individual blocks.
**Old SDKv2 Configuration:**
```hcl
data "helm_template" "example" {
name = "my-release"
chart = "my-chart"
namespace = "my-namespace"
values = ["custom-values.yaml"]
set {
name = "image.tag"
value = "1.2.3"
}
set_list {
name = "allowed.hosts"
value = ["host1", "host2"]
}
set_sensitive {
name = "api.key"
value = "super-secret-key"
}
}
```
**New Plugin Framework Configuration:**
```hcl
data "helm_template" "example" {
name = "my-release"
chart = "my-chart"
namespace = "my-namespace"
values = ["custom-values.yaml"]
set = [
{
name = "image.tag"
value = "1.2.3"
}
]
set_list = [
{
name = "allowed.hosts"
value = ["host1", "host2"]
}
]
set_sensitive = [
{
name = "api.key"
value = "super-secret-key"
}
]
}
```
**What Changed?**
- `set`, `set_list`, and `set_sensitive` is now a list of nested objects using `[ { ... } ]`.

View File

@ -0,0 +1,212 @@
---
page_title: "Provider: Helm"
sidebar_current: "docs-helm-index"
description: |-
The Helm provider is used to deploy software packages in Kubernetes. The provider needs to be configured with the proper credentials before it can be used.
---
# Helm Provider
The Helm provider is used to deploy software packages in Kubernetes. The provider needs to be configured with the proper credentials before it can be used.
Try the [hands-on tutorial](https://learn.hashicorp.com/tutorials/terraform/helm-provider?in=terraform/kubernetes) on the Helm provider on the HashiCorp Learn site.
## Resources
* [Resource: helm_release](r/release.md)
## Data Sources
* [Data Source: helm_template](d/template.html)
## Example Usage
```terraform
provider "helm" {
kubernetes = {
config_path = "~/.kube/config"
}
registries = [
{
url = "oci://localhost:5000"
username = "username"
password = "password"
},
{
url = "oci://private.registry"
username = "username"
password = "password"
}
]
}
resource "helm_release" "nginx_ingress" {
name = "nginx-ingress-controller"
repository = "https://charts.bitnami.com/bitnami"
chart = "nginx-ingress-controller"
set = [
{
name = "service.type"
value = "ClusterIP"
}
]
}
```
## Requirements
~> NOTE: The provider does not use the `KUBECONFIG` environment variable by default. See the attribute reference below for the environment variables that map to provider block attributes.
- You must have a Kubernetes cluster available. We support version 1.14.0 or higher.
## Authentication
The Helm provider can get its configuration in two ways:
1. *Explicitly* by supplying attributes to the provider block. This includes:
* [Using a kubeconfig file](#file-config)
* [Supplying credentials](#credentials-config)
* [Exec plugins](#exec-plugins)
2. *Implicitly* through environment variables. This includes:
* [Using the in-cluster config](#in-cluster-config)
For a full list of supported provider authentication arguments and their corresponding environment variables, see the [argument reference](#argument-reference) below.
### File config
The easiest way is to supply a path to your kubeconfig file using the `config_path` attribute or using the `KUBE_CONFIG_PATH` environment variable. A kubeconfig file may have multiple contexts. If `config_context` is not specified, the provider will use the `default` context.
```terraform
provider "helm" {
kubernetes = {
config_path = "~/.kube/config"
}
}
```
The provider also supports multiple paths in the same way that kubectl does using the `config_paths` attribute or `KUBE_CONFIG_PATHS` environment variable.
```terraform
provider "helm" {
kubernetes = {
config_paths = [
"/path/to/config_a.yaml",
"/path/to/config_b.yaml"
]
}
}
```
### Credentials config
You can also configure the host, basic auth credentials, and client certificate authentication explicitly or through environment variables.
```terraform
provider "helm" = {
kubernetes {
host = "https://cluster_endpoint:port"
client_certificate = file("~/.kube/client-cert.pem")
client_key = file("~/.kube/client-key.pem")
cluster_ca_certificate = file("~/.kube/cluster-ca-cert.pem")
}
}
```
### In-cluster Config
The provider uses the `KUBERNETES_SERVICE_HOST` and `KUBERNETES_SERVICE_PORT` environment variables to detect when it is running inside a cluster, so in this case you do not need to specify any attributes in the provider block if you want to connect to the local kubernetes cluster.
If you want to connect to a different cluster than the one terraform is running inside, configure the provider as [above](#credentials-config).
## Exec plugins
Some cloud providers have short-lived authentication tokens that can expire relatively quickly. To ensure the Kubernetes provider is receiving valid credentials, an exec-based plugin can be used to fetch a new token before initializing the provider. For example, on EKS, the command `eks get-token` can be used:
```terraform
provider "helm" {
kubernetes = {
host = var.cluster_endpoint
cluster_ca_certificate = base64decode(var.cluster_ca_cert)
exec = {
api_version = "client.authentication.k8s.io/v1beta1"
args = ["eks", "get-token", "--cluster-name", var.cluster_name]
command = "aws"
}
}
}
```
For example, to [authenticate with GKE](https://registry.terraform.io/providers/hashicorp/google/latest/docs/guides/using_gke_with_terraform#using-the-kubernetes-and-helm-providers), the `gke-cloud-auth-plugin` can be used:
```terraform
provider "helm" {
kubernetes = {
host = "https://${data.google_container_cluster.my_cluster.endpoint}"
token = data.google_client_config.provider.access_token
cluster_ca_certificate = base64decode(
data.google_container_cluster.my_cluster.master_auth[0].cluster_ca_certificate,)
exec = {
api_version = "client.authentication.k8s.io/v1beta1"
command = "gke-gcloud-auth-plugin"
}
}
}
```
## Argument Reference
The following arguments are supported:
* `debug` - (Optional) - Debug indicates whether or not Helm is running in Debug mode. Defaults to `false`.
* `plugins_path` - (Optional) The path to the plugins directory. Defaults to `HELM_PLUGINS` env if it is set, otherwise uses the default path set by helm.
* `registry_config_path` - (Optional) The path to the registry config file. Defaults to `HELM_REGISTRY_CONFIG` env if it is set, otherwise uses the default path set by helm.
* `repository_config_path` - (Optional) The path to the file containing repository names and URLs. Defaults to `HELM_REPOSITORY_CONFIG` env if it is set, otherwise uses the default path set by helm.
* `repository_cache` - (Optional) The path to the file containing cached repository indexes. Defaults to `HELM_REPOSITORY_CACHE` env if it is set, otherwise uses the default path set by helm.
* `helm_driver` - (Optional) "The backend storage driver. Valid values are: `configmap`, `secret`, `memory`, `sql`. Defaults to `secret`. Note: Regarding the sql driver, as of helm v3.2.0 SQL support exists only for the postgres dialect. The connection string can be configured by setting the `HELM_DRIVER_SQL_CONNECTION_STRING` environment variable e.g. `HELM_DRIVER_SQL_CONNECTION_STRING=postgres://username:password@host/dbname` more info [here](https://pkg.go.dev/github.com/lib/pq).
* `burst_limit` - (Optional) The helm burst limit to use. Set this value higher if your cluster has many CRDs. Default: `100`
* `kubernetes` - Kubernetes configuration block.
* `registries` - Private OCI registry configuration block. Can be specified multiple times.
The `kubernetes` block supports:
* `config_path` - (Optional) Path to the kube config file. Can be sourced from `KUBE_CONFIG_PATH`.
* `config_paths` - (Optional) A list of paths to the kube config files. Can be sourced from `KUBE_CONFIG_PATHS`.
* `host` - (Optional) The hostname (in form of URI) of the Kubernetes API. Can be sourced from `KUBE_HOST`.
* `username` - (Optional) The username to use for HTTP basic authentication when accessing the Kubernetes API. Can be sourced from `KUBE_USER`.
* `password` - (Optional) The password to use for HTTP basic authentication when accessing the Kubernetes API. Can be sourced from `KUBE_PASSWORD`.
* `token` - (Optional) The bearer token to use for authentication when accessing the Kubernetes API. Can be sourced from `KUBE_TOKEN`.
* `insecure` - (Optional) Whether server should be accessed without verifying the TLS certificate. Can be sourced from `KUBE_INSECURE`.
* `tls_server_name` - (Optional) Server name passed to the server for SNI and is used in the client to check server certificates against. Can be sourced from `KUBE_TLS_SERVER_NAME`.
* `client_certificate` - (Optional) PEM-encoded client certificate for TLS authentication. Can be sourced from `KUBE_CLIENT_CERT_DATA`.
* `client_key` - (Optional) PEM-encoded client certificate key for TLS authentication. Can be sourced from `KUBE_CLIENT_KEY_DATA`.
* `cluster_ca_certificate` - (Optional) PEM-encoded root certificates bundle for TLS authentication. Can be sourced from `KUBE_CLUSTER_CA_CERT_DATA`.
* `config_context` - (Optional) Context to choose from the config file. Can be sourced from `KUBE_CTX`.
* `proxy_url` - (Optional) URL to the proxy to be used for all API requests. URLs with "http", "https", and "socks5" schemes are supported. Can be sourced from `KUBE_PROXY_URL`.
* `exec` - (Optional) Configuration block to use an [exec-based credential plugin](https://kubernetes.io/docs/reference/access-authn-authz/authentication/#client-go-credential-plugins), e.g. call an external command to receive user credentials.
* `api_version` - (Required) API version to use when decoding the ExecCredentials resource, e.g. `client.authentication.k8s.io/v1beta1`.
* `command` - (Required) Command to execute.
* `args` - (Optional) List of arguments to pass when executing the plugin.
* `env` - (Optional) Map of environment variables to set when executing the plugin.
The `registries` block has options:
* `url` - (Required) url to the registry in format `oci://host:port`
* `username` - (Required) username to registry
* `password` - (Required) password to registry
## Experiments
The provider takes an `experiments` block that allows you enable experimental features by setting them to `true`.
* `manifest` - Enable storing of the rendered manifest for `helm_release` so the full diff of what is changing can been seen in the plan.
```terraform
provider "helm" {
experiments = {
manifest = true
}
}
```

View File

@ -0,0 +1,386 @@
---
page_title: "helm: helm_release"
sidebar_current: "docs-helm-release"
description: |-
---
# Resource: helm_release
A Release is an instance of a chart running in a Kubernetes cluster.
A Chart is a Helm package. It contains all of the resource definitions necessary to run an application, tool, or service inside of a Kubernetes cluster.
`helm_release` describes the desired status of a chart in a kubernetes cluster.
<!-- schema generated by tfplugindocs -->
## Schema
### Required
- `chart` (String) Chart name to be installed. A path may be used.
- `name` (String) Release name. The length must not be longer than 53 characters.
### Optional
- `atomic` (Boolean) If set, installation process purges chart on fail. The wait flag will be set automatically if atomic is used. Defaults to `false`.
- `cleanup_on_fail` (Boolean) Allow deletion of new resources created in this upgrade when upgrade fails. Defaults to `false`.
- `create_namespace` (Boolean) Create the namespace if it does not exist. Defaults to `false`.
- `dependency_update` (Boolean) Run helm dependency update before installing the chart. Defaults to `false`.
- `description` (String) Add a custom description
- `devel` (Boolean) Use chart development versions, too. Equivalent to version '>0.0.0-0'. If `version` is set, this is ignored
- `disable_crd_hooks` (Boolean) Prevent CRD hooks from, running, but run other hooks. See helm install --no-crd-hook
- `disable_openapi_validation` (Boolean) If set, the installation process will not validate rendered templates against the Kubernetes OpenAPI Schema. Defaults to `false`.
- `disable_webhooks` (Boolean) Prevent hooks from running.Defaults to `false`.
- `force_update` (Boolean) Force resource update through delete/recreate if needed. Defaults to `false`.
- `keyring` (String) Location of public keys used for verification. Used only if `verify` is true. Defaults to `/.gnupg/pubring.gpg` in the location set by `home`.
- `lint` (Boolean) Run helm lint when planning. Defaults to `false`.
- `max_history` (Number) Limit the maximum number of revisions saved per release. Use 0 for no limit. Defaults to 0 (no limit).
- `namespace` (String) Namespace to install the release into. Defaults to `default`.
- `pass_credentials` (Boolean) Pass credentials to all domains. Defaults to `false`.
- `postrender` (Block List, Max: 1) Postrender command configuration. (see [below for nested schema](#nestedblock--postrender))
- `recreate_pods` (Boolean) Perform pods restart during upgrade/rollback. Defaults to `false`.
- `render_subchart_notes` (Boolean) If set, render subchart notes along with the parent. Defaults to `true`.
- `replace` (Boolean) Re-use the given name, even if that name is already used. This is unsafe in production. Defaults to `false`.
- `repository` (String) Repository where to locate the requested chart. If is a URL the chart is installed without installing the repository.
- `repository_ca_file` (String) The Repositories CA File
- `repository_cert_file` (String) The repositories cert file
- `repository_key_file` (String) The repositories cert key file
- `repository_password` (String, Sensitive) Password for HTTP basic authentication
- `repository_username` (String) Username for HTTP basic authentication
- `reset_values` (Boolean) When upgrading, reset the values to the ones built into the chart. Defaults to `false`.
- `reuse_values` (Boolean) When upgrading, reuse the last release's values and merge in any overrides. If 'reset_values' is specified, this is ignored. Defaults to `false`.
- `set` (Block Set) Custom values to be merged with the values. (see [below for nested schema](#nestedblock--set))
- `set_wo` (Attribute List) Custom values to be merged with the values. This is the same as "set" but write-only. (see [below for nested schema](#nestedblock--set))
- `set_wo_revision` (Number) The current revision of the write-only "set_wo" attribute. Incrementing this integer value will cause Terraform to update the write-only value.`
- `set_list` (Block List) Custom list values to be merged with the values. (see [below for nested schema](#nestedblock--set_list))
- `set_sensitive` (Block Set) Custom sensitive values to be merged with the values. (see [below for nested schema](#nestedblock--set_sensitive))
- `skip_crds` (Boolean) If set, no CRDs will be installed. By default, CRDs are installed if not already present. Defaults to `false`.
- `timeout` (Number) Time in seconds to wait for any individual kubernetes operation. Defaults to 300 seconds.
- `upgrade_install` (Boolean) If true, the provider will install the release at the specified version even if a release not controlled by the provider is present: this is equivalent to running 'helm upgrade --install' with the Helm CLI. WARNING: this may not be suitable for production use -- see the 'Upgrade Mode' note in the provider documentation. Defaults to `false`.
- `values` (List of String) List of values in raw yaml format to pass to helm.
- `verify` (Boolean) Verify the package before installing it.Defaults to `false`.
- `version` (String) Specify the exact chart version to install. If this is not specified, the latest version is installed.
- `wait` (Boolean) Will wait until all resources are in a ready state before marking the release as successful. Defaults to `true`.
- `wait_for_jobs` (Boolean) If wait is enabled, will wait until all Jobs have been completed before marking the release as successful. Defaults to `false``.
### Read-Only
- `id` (String) The ID of this resource.
- `manifest` (String) The rendered manifest as JSON.
- `metadata` (List of Object) Status of the deployed release. (see [below for nested schema](#nestedatt--metadata))
- `status` (String) Status of the release.
<a id="nestedblock--postrender"></a>
### Nested Schema for `postrender`
Required:
- `binary_path` (String) The command binary path.
Optional:
- `args` (List of String) an argument to the post-renderer (can specify multiple)
<a id="nestedblock--set"></a>
### Nested Schema for `set`
Required:
- `name` (String)
Optional:
- `type` (String)
- `value` (String)
<a id="nestedblock--set_list"></a>
### Nested Schema for `set_list`
Required:
- `name` (String)
- `value` (List of String)
<a id="nestedblock--set_sensitive"></a>
### Nested Schema for `set_sensitive`
Required:
- `name` (String)
- `value` (String, Sensitive)
Optional:
- `type` (String)
<a id="nestedatt--metadata"></a>
### Nested Schema for `metadata`
Read-Only:
- `app_version` (String)
- `chart` (String)
- `first_deployed` (Number)
- `last_deployed` (Number)
- `name` (String)
- `namespace` (String)
- `notes` (String)
- `revision` (Number)
- `values` (String)
- `version` (String)
## Example Usage - Chart Repository
```terraform
resource "helm_release" "example" {
name = "my-redis-release"
repository = "https://charts.bitnami.com/bitnami"
chart = "redis"
version = "6.0.1"
set = [
{
name = "cluster.enabled"
value = "true"
},
{
name = "metrics.enabled"
value = "true"
}
]
set = [
{
name = "service.annotations.prometheus\\.io/port"
value = "9127"
type = "string"
}
]
}
```
## Example Usage - Local Chart
In case a Chart is not available from a repository, a path may be used:
```terraform
resource "helm_release" "example" {
name = "my-local-chart"
chart = "./charts/example"
}
```
## Example Usage - Chart URL
An absolute URL to the .tgz of the Chart may also be used:
```terraform
resource "helm_release" "example" {
name = "redis"
chart = "https://charts.bitnami.com/bitnami/redis-10.7.16.tgz"
}
```
## Example Usage - Chart Repository configured from OCI Registry
Provider supports grabbing charts from an OCI repository:
```terraform
provider "helm" {
kubernetes = {
config_path = "~/.kube/config"
}
registries = [
{
url = "oci://localhost:5000"
username = "username"
password = "password"
}
]
}
resource "helm_release" "example" {
name = "testchart"
namespace = "helm_registry"
repository = "oci://localhost:5000/helm-charts"
version = "1.2.3"
chart = "test-chart"
}
```
## Example Usage - Chart Repository configured using GCS/S3
The provider also supports helm plugins such as GCS and S3 that add S3/GCS helm repositories by using `helm plugin install`
```terraform
# Install GCS plugin
`helm plugin install https://github.com/hayorov/helm-gcs.git`
# Run follow commands to setup GCS repository
# Init a new repository:
# helm gcs init gs://bucket/path
# Add your repository to Helm:
# helm repo add repo-name gs://bucket/path
# Push a chart to your repository:
# helm gcs push chart.tar.gz repo-name
# Update Helm cache:
# helm repo update
# Get your chart:
resource "helm_release" "GCS" {
name = "GCS"
repository = "gs://tf-test-helm-repo/charts"
chart = "chart"
}
```
```terraform
# Install AWS S3 plugin
`helm plugin install https://github.com/hypnoglow/helm-s3.git`
# Run follow commands to setup S3 repository
# Init a new repository:
# helm s3 init s3://my-helm-charts/stable/myapp
# Add your repository to Helm:
# helm repo add stable-myapp s3://my-helm-charts/stable/myapp/
# Push a chart to your repository:
# helm s3 push chart.tar.gz repo-name
# Update Helm cache:
# helm repo update
# Get your chart:
resource "helm_release" "S3" {
name = "S3"
repository = "s3://tf-test-helm-repo/charts"
chart = "chart"
}
```
## Example Usage - Chart Repository configured outside of Terraform
The provider also supports repositories that are added to the local machine outside of Terraform by running `helm repo add`
```terraform
# run this first: `helm repo add bitnami https://charts.bitnami.com/bitnami`
resource "helm_release" "example" {
name = "redis"
chart = "bitnami/redis"
}
```
The `set`, `set_list`, and `set_sensitive` blocks support:
* `name` - (Required) full name of the variable to be set.
* `value` - (Required; Optional for `set`) value of the variable to be set.
* `type` - (Optional) type of the variable to be set. Valid options are `auto` and `string`.
Since Terraform Utilizes HCL as well as Helm using the Helm Template Language, it's necessary to escape the `{}`, `[]`, `.`, and `,` characters twice in order for it to be parsed. `name` should also be set to the `value path`, and `value` is the desired value that will be set.
```terraform
set = [
{
name = "grafana.ingress.annotations.alb\\.ingress\\.kubernetes\\.io/group\\.name"
value = "shared-ingress"
}
]
```
```terraform
set_list = [
{
name = "hashicorp"
value = ["terraform", "nomad", "vault"]
}
]
```
```terraform
controller:
pod:
annotations:
status.kubernetes.io/restart-on-failure: {"timeout": "30s"}
```
```terraform
set = [
{
name = "controller.pod.annotations.status\\.kubernetes\\.io/restart-on-failure"
value = "\\{\"timeout\": \"30s\"\\}"
}
]
```
The `postrender` block supports two attributes:
* `binary_path` - (Required) relative or full path to command binary.
* `args` - (Optional) a list of arguments to supply to the post-renderer.
## Upgrade Mode Notes
When using the Helm CLI directly, it is possible to use `helm upgrade --install` to
_idempotently_ install a release. For example, `helm upgrade --install mariadb charts/mariadb --verson 7.1.0`
will check to see if there is already a release called `mariadb`: if there is, ensure that it is set to version
7.1.0, and if there is not, install that version from scratch. (See the documentation for the
[helm upgrade](https://helm.sh/docs/helm/helm_upgrade) command for more details.)
**NOTE:** The mechanics of this approach are subtly different from the defaults and you can easily produce unexpected or undesirable results if you are not careful:
using this approach in production is not necessarily recommended!
If upgrade mode is enabled by setting the `upgrade_install` attribute to `true`, the provider will first check to see
if a release with the given name already exists. If the release does not already exist, the provider will perform a
from-scratch installation of the chart. In this case, all resource attributes are honored.
However, if the release _does_ already exist, the provider will attempt to upgrade the release to
the state defined in the resource, using the same strategy as the [helm upgrade](https://helm.sh/docs/helm/helm_upgrade)
command.
When using `upgrade_install`, the `version` attribute is used to determine the version of the chart to install or
upgrade to. If the `version` attribute is not set, the provider will attempt to determine the version of the chart
from the existing release and will use that version for the upgrade: this is to ensure that using `upgrade_install`
does not inadvertently change the version of the chart being used.
**CRITICAL**: The user-supplied values passed to the chart in the new revision will be the ones specified in the
`helm_release` resource, not the values used in the original installation of the chart. This means that if
you are using `upgrade_install` to manage a release that was originally installed with a different set of values,
you must ensure that the values in the `helm_release` resource are correct, or you may inadvertently change the
configuration of the release. Additionally, since there is no existing terraform state to compare against, you
must manually inspect the installed release's values with the `helm get values` CLI command.
**IMPORTANT**: Even if you are "upgrading" to the same version of the chart that is already present in the cluster,
the `helm_release` resource will still show as "changed" in the terraform plan output, because there is no existing
state for it to compare against. This also means that in the apply stage, the provider will in fact reinstall the
chart, which means that if there are any
[deployment](https://kubernetes.io/docs/concepts/workloads/controllers/deployment/),
[daemonset](https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/) or
[statefulset](https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/) resources in the chart, they will
be replaced, which will cause a rolling update of the pods.
## Import
A Helm Release resource can be imported using its namespace and name e.g.
```shell
$ terraform import helm_release.example default/example-name
```
~> **NOTE:** Since the `repository` attribute is not being persisted as metadata by helm, it will not be set to any value by default. All other provider specific attributes will be set to their default values and they can be overriden after running `apply` using the resource definition configuration.

View File

@ -0,0 +1,41 @@
data "helm_template" "mariadb_instance" {
name = "mariadb-instance"
namespace = "default"
repository = "https://charts.helm.sh/stable"
chart = "mariadb"
version = "7.1.0"
set = [
{
name = "service.port"
value = "13306"
}
]
set_sensitive = [
{
name = "rootUser.password"
value = "s3cr3t!"
}
]
}
resource "local_file" "mariadb_manifests" {
for_each = data.helm_template.mariadb_instance.manifests
filename = "./${each.key}"
content = each.value
}
output "mariadb_instance_manifest" {
value = data.helm_template.mariadb_instance.manifest
}
output "mariadb_instance_manifests" {
value = data.helm_template.mariadb_instance.manifests
}
output "mariadb_instance_notes" {
value = data.helm_template.mariadb_instance.notes
}

View File

@ -0,0 +1,46 @@
data "helm_template" "mariadb_instance" {
name = "mariadb-instance"
namespace = "default"
repository = "https://charts.helm.sh/stable"
chart = "mariadb"
version = "7.1.0"
show_only = [
"templates/master-statefulset.yaml",
"templates/master-svc.yaml",
]
set = [
{
name = "service.port"
value = "13306"
}
]
set_sensitive = [
{
name = "rootUser.password"
value = "s3cr3t!"
}
]
}
resource "local_file" "mariadb_manifests" {
for_each = data.helm_template.mariadb_instance.manifests
filename = "./${each.key}"
content = each.value
}
output "mariadb_instance_manifest" {
value = data.helm_template.mariadb_instance.manifest
}
output "mariadb_instance_manifests" {
value = data.helm_template.mariadb_instance.manifests
}
output "mariadb_instance_notes" {
value = data.helm_template.mariadb_instance.notes
}

View File

@ -0,0 +1,31 @@
provider "helm" {
kubernetes = {
config_path = "~/.kube/config"
}
registries = [
{
url = "oci://localhost:5000"
username = "username"
password = "password"
},
{
url = "oci://private.registry"
username = "username"
password = "password"
}
]
}
resource "helm_release" "nginx_ingress" {
name = "nginx-ingress-controller"
repository = "https://charts.bitnami.com/bitnami"
chart = "nginx-ingress-controller"
set = [
{
name = "service.type"
value = "ClusterIP"
}
]
}

Some files were not shown because too many files have changed in this diff Show More