Emre Cosar's Terraform Control repository to manage cloud components infra-as-code
- polarissquad.fun
| Account Number | Account Name |
|---|---|
| ACCOUNT_ID | ACCOUNT_NAME |
-- To start working, please update account.yaml's aws_account_id and aws_region based on your configurations.
| Folder | Description |
|---|---|
| .github | Contains default github Pull-Request template and workflows |
| terraform | Contains terraform and terragrunt files needed for automation deployment |
| .pre-commit-config.yaml | Git hook testing scripts |
Install dependencies via Homebrew and setup terraform and terragrunt respectively:
# Install packages
brew install awsume awscli pre-commit tflint tfenv tgenv
# Install terraform and terragrunt from inside terraform folder
cd terraform
tfenv install
tgenv installYou can uninstall terraform and terragrunt from your system, they will be managed by tfenv & tgenv tools.
Please run the following command regularly to ensure the installed tools are up to date:
brew update && brew upgrade && brew cleanup
- tfenv Terraform version manager.
- tgenv Terragrunt version manager.
- tflint TFLint is a Terraform linter focused on possible errors, best practices, etc.
pre-commit run --all-files
# or you can use a short one:
pre-commit run -aThere are several pre-commit hooks to keep Terraform configurations (both tf and tfvars) and Terragrunt configurations (hcl) along with others (json, yaml, sh) in a good shape:
terraform_fmt- Rewrites all Terraform configuration files to a canonical format.terraform_validate- Validates all Terraform configuration files.terraform_tflint- Validates all Terraform configuration files with TFLint.terraform_docs- Runsterraform-docsand inserts input and output documentation intoREADME.md.terraform_docs_without_aggregate_type_defaults- Sames as above without aggregate type defaults.terraform_docs_replace- Runsterraform-docsand pipes the output directly to README.mdterragrunt_fmt- Rewrites all Terragrunt configuration files (*.hcl) to a canonical format.
Gitflow is a branching strategy model for Git but currently is not being used. Please read this doc to understand it in more details.
We are using git sqush and merge for getting the PRs merged into the taget branch. It’s simple – before you merge a feature branch back into your main branch (often main or develop), your feature branch should be squashed down to a single buildable commit, and then rebased from the up-to-date main branch.
Please watch this small video (1:27min) to understand the benefit of git squash: