1. Styles
1.1. bad
1.2. good
1.3. not as good
1.4. not as bad
1.5. important
1.6. warning
2. main
2.1. providers
2.1.1. keycloak
2.1.1.1. link
2.1.2. argocd
2.1.2.1. link
2.1.3. AWS
2.1.4. google cloud
2.2. commands
2.2.1. terraform validate
2.2.1.1. is the configuration valid
2.2.2. terraform plan
2.2.2.1. waht are the resources that will be going to used
2.2.3. terraform apply
2.2.4. terraform destroy
2.2.5. terraform init
2.2.5.1. When to Run terraform init
2.2.5.1.1. First Time Setup:
2.2.5.1.2. file structure change or module change
2.3. file structure
2.3.1. 1
2.3.1.1. module
2.3.1.1.1. variables
2.3.1.1.2. outputs
2.3.1.1.3. main
2.3.1.2. terraform.tfvars
2.3.1.2.1. Use the terraform.tfvars file to manage environment-specific variables. You can also use environment variables or command-line arguments to pass variables.
2.3.1.2.2. code
2.3.1.2.3. handling
2.3.1.3. example
2.3.1.3.1. nx
2.4. environment variables
2.4.1. 1
2.5. running command lines in terraform
2.5.1. you can run command-line commands in Terraform using the local-exec provisioner. The local-exec provisioner allows you to execute commands on the machine where Terraform is running, typically your local machine or the environment where the Terraform CLI is executed.
2.5.2. example
2.5.2.1. 1
2.5.2.1.1. provider "aws" { region = "us-east-1" # You can use any region or omit this provider if not needed } # Resource using local-exec to run a command resource "null_resource" "example" { provisioner "local-exec" { command = "echo 'Hello, World!'" } } # Another example of running a shell command (e.g., listing files) resource "null_resource" "list_files" { provisioner "local-exec" { command = "ls -al" } }
2.5.2.2. 2
2.5.2.2.1. local-exec
2.5.2.3. issue
2.5.2.3.1. In Terraform, even if you place a null_resource with a local-exec provisioner at the beginning of your code, it will not necessarily run before other resources by default. Terraform's execution is parallel and based on a dependency graph, meaning resources will be created based on their dependencies rather than the order in which they appear in your code.
2.5.2.3.2. solution
2.6. terraform registery
2.7. test
2.7.1. test
2.7.2. terra test
2.8. [email protected]
2.9. terraform plugind development
2.9.1. vid
2.9.1.1. architecture
2.9.1.1.1. boilerplates