Skip to content

Commit 806f398

Browse files
feat: remove terraform token from terrafrom pod, SD-1235
1 parent bdd3620 commit 806f398

File tree

5 files changed

+8
-29
lines changed

5 files changed

+8
-29
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@
44

55
[dev]
66

7+
- [associated PR](https://github.com/saritasa-nest/saritasa-devops-helm-charts/pull/181)
8+
- Update terraform-pod to not use terraform token secret
9+
10+
## 2025-10-16
11+
12+
[dev]
13+
714
- [associated PR](https://github.com/saritasa-nest/saritasa-devops-helm-charts/pull/178)
815
- Update slack-notification `get-failed-info` step
916

charts/terraform-pod/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ type: application
66
# This is the chart version. This version number should be incremented each time you make changes
77
# to the chart and its templates, including the app version.
88
# Versions are expected to follow Semantic Versioning (https://semver.org/)
9-
version: 0.0.40
9+
version: 0.0.41
1010

1111
maintainers:
1212
- url: https://www.saritasa.com/

charts/terraform-pod/README.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ For infra-aws repos you may want to pass short-term TTL AWS credentials from the
8383
--set github.username=YOUR-GITHUB-USERNAME \
8484
--set github.email=YOUR-GITHUB-EMAIL \
8585
--set gitCryptKey=$(base64 -w 0 path/to/git-crypt-key) \
86-
--set terraform.token=xxx \
8786
--set aws.accessKeyId=$(echo $creds | jq -r ".AccessKeyId") \
8887
--set aws.secretAccessKey=$(echo $creds | jq -r ".SecretAccessKey") \
8988
--set aws.sessionToken="$(echo $creds | jq -r ".SessionToken")" \
@@ -189,6 +188,4 @@ unset creds
189188
| terraform.client | string | `""` | terraform client name (used to decide what workspace in the org to use) |
190189
| terraform.initCommand | string | `"make _dev init"` | makefile target in the Makefile of the repository to run during initialization phase (can be any valid bash one-liner if you want to skip the makefile targets of the repository) |
191190
| terraform.organization | string | `"saritasa-team"` | terraform org |
192-
| terraform.token | string | `""` | terraform api token value (optional, if passed - takes precedence over tokenSecret) |
193-
| terraform.tokenSecret | string | `"terraform-cli-token-saritasa-team"` | secret name containing terraform team API token name (optional) |
194191
| tolerations | list | `[]` | tolerations |

charts/terraform-pod/templates/_helpers.tpl

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -151,22 +151,9 @@ Define env vars containing argocd access to be passed as TF_VAR value into terra
151151
Define env vars for terraform
152152
*/}}
153153
{{- define "terraform-pod.terraform-env-vars" -}}
154-
{{- $hasCustomTerraformToken := gt (len .Values.terraform.token) 0 -}}
155-
{{- $secretName := ternary (include "terraform-pod.terraform-token" .) .Values.terraform.tokenSecret $hasCustomTerraformToken }}
156-
157154
# terraform vars
158155
- name: TF_ORG
159156
value: {{ .Values.terraform.organization }}
160-
- name: TF_TOKEN_app_terraform_io
161-
valueFrom:
162-
secretKeyRef:
163-
name: {{ printf "%s" $secretName }}
164-
key: token
165-
- name: TF_TOKEN_registry_terraform_io
166-
valueFrom:
167-
secretKeyRef:
168-
name: {{ printf "%s" $secretName }}
169-
key: token
170157
{{ include "terraform-pod.terraform-env-database-vars" . }}
171158
{{ include "terraform-pod.terraform-env-argocd-vars" . }}
172159
{{ include "terraform-pod.terraform-env-sentry-vars" . }}
@@ -315,14 +302,6 @@ terraform.organization:
315302
terraform.client:
316303
`client` is required and should be a non-empty string. It should contain client name, which would be used as a suffix for the workspace for infra-dev-aws solutions (skipped otherwise)
317304
{{- end -}}
318-
{{ if not (or (and .Values.terraform.tokenSecret (kindIs "string" .Values.terraform.tokenSecret))
319-
(and .Values.terraform.token (kindIs "string" .Values.terraform.token))
320-
) }}
321-
terraform.tokenSecret|token:
322-
You didn't set either tokenSecret or token. One is required for the terraform pod to be functional.
323-
`tokenSecret` is required and should be a non-empty string. It should contain a name of the secret containing terraform auth token for the organnization.
324-
or
325-
`token` is required and should be a non-empty string. It should terraform api token as a string
326305
{{- end -}}
327306
{{ if not (and .Values.terraform.initCommand (kindIs "string" .Values.terraform.initCommand)) }}
328307
terraform.initCommand:

charts/terraform-pod/values.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,6 @@ terraform:
3232
organization: saritasa-team
3333
# -- terraform client name (used to decide what workspace in the org to use)
3434
client: ""
35-
# -- secret name containing terraform team API token name (optional)
36-
tokenSecret: terraform-cli-token-saritasa-team
37-
# -- terraform api token value (optional, if passed - takes precedence over tokenSecret)
38-
token: ""
3935
# -- makefile target in the Makefile of the repository to run during initialization phase (can be any valid bash one-liner if you want to skip the makefile targets of the repository)
4036
initCommand: make _dev init
4137

0 commit comments

Comments
 (0)