2021-12-24 13:35:41 +07:00
|
|
|
apiVersion: tekton.dev/v1beta1
|
|
|
|
kind: Task
|
|
|
|
metadata:
|
|
|
|
name: terraform-external
|
|
|
|
spec:
|
2021-12-24 15:06:49 +07:00
|
|
|
workspaces:
|
|
|
|
- name: source
|
2021-12-24 13:35:41 +07:00
|
|
|
stepTemplate:
|
2022-01-28 01:19:34 +07:00
|
|
|
image: hashicorp/terraform:1.1.4
|
2021-12-24 16:02:58 +07:00
|
|
|
workingDir: /workspace/source/external
|
2021-12-24 13:35:41 +07:00
|
|
|
volumeMounts:
|
2021-12-25 03:03:46 +07:00
|
|
|
- name: terraform-secrets
|
|
|
|
mountPath: /root/.terraform.d/credentials.tfrc.json
|
|
|
|
subPath: credentials.tfrc.json
|
|
|
|
- name: terraform-secrets
|
|
|
|
mountPath: /workspace/source/external/terraform.tfvars
|
|
|
|
subPath: terraform.tfvars
|
2021-12-24 16:02:58 +07:00
|
|
|
command:
|
|
|
|
- terraform
|
2021-12-24 13:35:41 +07:00
|
|
|
volumes:
|
2021-12-25 03:03:46 +07:00
|
|
|
- name: terraform-secrets
|
2021-12-24 13:35:41 +07:00
|
|
|
secret:
|
2021-12-25 10:52:07 +07:00
|
|
|
secretName: terraform-secrets
|
2021-12-24 13:35:41 +07:00
|
|
|
steps:
|
|
|
|
- name: init
|
|
|
|
args:
|
|
|
|
- init
|
|
|
|
- name: plan
|
|
|
|
args:
|
|
|
|
- plan
|
2021-12-24 16:28:34 +07:00
|
|
|
- -out=tfplan
|
2021-12-24 13:35:41 +07:00
|
|
|
- name: apply
|
|
|
|
args:
|
|
|
|
- apply
|
|
|
|
- -auto-approve
|
2021-12-24 16:28:34 +07:00
|
|
|
- tfplan
|