IAC to automate GitLab Omnibus installations with Praefect, Gitaly and runners on AWS
Terraform Guide
Chocolaty install
Install terraform-docs
Use Chocolaty to install. Run on Command Prompt. Link
choco install terraform-docs
terraform init
in each environment’s folderterraform get
in the environment’s folder to register the local modulesterraform validate
to check for syntax errors. Run terraform fmt
to format codeterraform plan
to understand the changes madeterraform apply -var-file="terraform.tfvars"
to run with the variables file (Create this file based on terraform.template.tfvars
provided)terraform apply -var-file="terraform.tfvars" -auto-approve
terraform apply -var-file="terraform.tfvars" -target module.eks
terraform destroy
after deployment if used for testingThe following links were used to provide guidance on the Directory Structure
Best practices for naming conventions
Code Styling
terraform-docs markdown . > README.md
to generate documentationterraform-docs markdown . --no-providers > README.md
because somehow my provider was showing up in requirements insteadterraform-docs markdown . --no-providers --no-requirements > README.md
Using modules
Getting part of the output of a command in bash
Refer to this link
Example: This command refers to the first output of the second line
kubectl get secrets | awk 'NR==2{print $1}'
Storing the output of a command in bash in a variable to be referenced elsewhere in a bash file
Refer to this link
Example
token_name=$(kubectl get secrets | awk 'NR==2{print $1}')