1
0
Quellcode durchsuchen

Adding basic Terraform Taskfile

Sacha Ligthert vor 1 Jahr
Ursprung
Commit
b9b6bafe1f
1 geänderte Dateien mit 51 neuen und 0 gelöschten Zeilen
  1. 51 0
      Taskfile.Terraform.yml

+ 51 - 0
Taskfile.Terraform.yml

@@ -0,0 +1,51 @@
+version: '3'
+
+env:
+  AWS_PROFILE: test
+  VAULT_ADDR: "https://vault.prod.newmotion.com"
+  VAULT_TOKEN: ""
+  TF_VAR_region: eu-west-1
+  TF_VAR_team: sre
+  TF_VAR_repo: https://github.com/sede-enterprise/srseu-sre-
+  TF_VAR_gh-runner-name: randomstring
+
+tasks:
+
+  init:
+    cmds:
+      #- aws sso login --profile=shellsso-test
+      - terraform init
+      - terraform workspace select -or-create test
+
+  validate:
+    cmds:
+      - terraform validate
+
+  plan:
+    cmds:
+      - terraform plan -var-file="tfvars/test.tfvars"
+
+  apply:
+    cmds:
+      - terraform apply -var-file="tfvars/test.tfvars"
+
+  destroy:
+    cmds:
+      - terraform destroy -var-file="tfvars/test.tfvars"
+
+  fmt:
+    cmds:
+      - terraform fmt -recursive
+
+  lint:
+    cmds:
+      - tflint --var-file=tfvars/test.tfvars
+
+  precommit:
+    cmds:
+      - pre-commit autoupdate
+      - pre-commit run --all-files
+
+  cleanup:
+    cmds:
+      - rm -rf .terraform* terraform.*