Skip to content

Commit

Permalink
refactor(tf): stop using aws for state managment, remove gh repo mana…
Browse files Browse the repository at this point in the history
…gement

Signed-off-by: unusualpseudo <[email protected]>
  • Loading branch information
unusualpseudo committed Aug 1, 2024
1 parent 87f8be7 commit 7a3224a
Show file tree
Hide file tree
Showing 42 changed files with 87 additions and 1,109 deletions.
4 changes: 0 additions & 4 deletions .github/labeler.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
---
aws:
- "terraform/aws/*"
cloudflare:
- "terraform/cloudflare/*"
github:
- "terraform/github/*"
cicd:
- ".github/**/*"
8 changes: 0 additions & 8 deletions .github/labels.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
---
- name: aws
color: "ff9900"
description: >-
Changes made in the aws module
- name: github
color: "72ccf3"
description: >-
Changes made in the github module
- name: cloudflare
color: "171515"
description: >-
Expand Down
60 changes: 0 additions & 60 deletions .github/plan/action.yaml

This file was deleted.

4 changes: 0 additions & 4 deletions .github/release-drafter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,8 @@ tag-template: "v1.0.0"
change-template: "- $TITLE @$AUTHOR (#$NUMBER)"
change-title-escapes: '\<*_&'
categories:
- title: "AWS"
labels: ["aws"]
- title: "Cloudflare"
labels: ["cloudflare"]
- title: "Github"
labels: ["github"]
version-resolver:
major:
labels: ["type/break"]
Expand Down
117 changes: 0 additions & 117 deletions .github/workflows/tf-cicd.yaml

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
.terraform.tfstate*
terraform.tfstate*


# environments
.envrc

Expand Down
12 changes: 7 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,20 @@ repos:
rev: v1.81.0
hooks:
- id: terraform_fmt
files: ^state/
- id: terraform_tflint
files: ^state/
- id: terraform_validate
files: ^state/
args:
- --tf-init-args=-lockfile=readonly
- id: terraform_tfsec
files: ^terraform/
files: ^state/
args:
- >
--args=--config-file=__GIT_WORKING_DIR__/.tfsec.yaml
--format json
- id: terraform_checkov
files: ^state/

- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.5.1
Expand All @@ -41,8 +44,7 @@ repos:
args: [--maxkb=2048]
- id: check-merge-conflict
- id: check-executables-have-shebangs
- id: detect-aws-credentials
args: ['--allow-missing-credentials']


- repo: https://github.com/k8s-at-home/sops-pre-commit
rev: v2.1.1
Expand Down
81 changes: 11 additions & 70 deletions .taskfiles/TerraformTasks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,97 +2,38 @@
version: "3"

tasks:

gh-fmt:
desc: Format github tf files
dir: terraform/github
cmds:
- terraform fmt --recursive

gh-nuke:
desc: Destroy github tf files
dir: terraform/github
cmds:
- terraform destroy


gh-init:
desc: Init github provision
dir: terraform/github
cmds:
- terraform init -input=false

gh-plan:
desc: Show github provision execution plan
dir: terraform/github
cmds:
- terraform plan -input=false

gh-apply:
desc: Provision Github provision
dir: terraform/github
cmds:
- terraform apply -input=false -auto-approve


aws-fmt:
desc: Format aws tf files
dir: terraform/aws
cmds:
- terraform fmt --recursive

aws-nuke:
desc: Destroy aws infra
dir: terraform/aws
cmds:
- terraform destroy


aws-init:
desc: Init aws provision
dir: terraform/aws
cmds:
- terraform init -input=false -upgrade

aws-plan:
desc: Show aws provision execution plan
dir: terraform/aws
cmds:
- terraform plan -input=false

aws-apply:
desc: Provision aws
dir: terraform/aws
cmds:
- terraform apply -input=false -auto-approve


cf-fmt:
desc: Format cloudflare tf files
dir: terraform/cloudflare
dir: state/cloudflare
cmds:
- terraform fmt --recursive

cf-nuke:
desc: Destroy cloudflare tf files
dir: terraform/cloudflare
dir: state/cloudflare
cmds:
- terraform destroy

cf-init:
desc: Init cloudflare provision
dir: terraform/cloudflare
dir: state/cloudflare
cmds:
- terraform init -input=false

cf-plan:
desc: Show cloudflare execution plan
dir: terraform/cloudflare
dir: state/cloudflare
cmds:
- terraform plan -input=false

cf-apply:
desc: Provision cloudflare provision
dir: terraform/cloudflare
dir: state/cloudflare
cmds:
- terraform apply -input=false -auto-approve

cf-out:
desc: Provision cloudflare provision
dir: state/cloudflare
cmds:
- terraform output -json
6 changes: 0 additions & 6 deletions .tfsec.yaml

This file was deleted.

3 changes: 0 additions & 3 deletions README.md

This file was deleted.

File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 7a3224a

Please sign in to comment.