Terraform: Difference between revisions
Jump to navigation
Jump to search
Line 384: | Line 384: | ||
* [https://spacelift.io/blog/terraform-output Terraform » Spacelift » Output] | * [https://spacelift.io/blog/terraform-output Terraform » Spacelift » Output] | ||
* [https://www.env0.com/blog/terraform-functions-guide-complete-list-with-examples Terraform » Functions » Guide] | * [https://www.env0.com/blog/terraform-functions-guide-complete-list-with-examples Terraform » Functions » Guide] | ||
* [https://medium.com/@satyen.167/terraform-console-and-output-d3acf1f533 Terraform » Console » Output] | |||
* [https://spacelift.io/blog/terraform-test Terraform » Spacelift » Test] | * [https://spacelift.io/blog/terraform-test Terraform » Spacelift » Test] | ||
* [https://developer.hashicorp.com/terraform/tutorials/cdktf/cdktf-install?variants=cdk-language%3Apython Terraform » CDK » Python] | * [https://developer.hashicorp.com/terraform/tutorials/cdktf/cdktf-install?variants=cdk-language%3Apython Terraform » CDK » Python] |
Revision as of 21:45, 22 July 2024
curl -fsSL https://apt.releases.hashicorp.com/gpg\
| sudo tee /etc/apt/keyrings/hashicorp.asc >/dev/null
cat << SRC | sudo tee /etc/apt/sources.list.d/hashicorp.list >/dev/null
deb [arch=$(dpkg --print-architecture)\
signed-by=/etc/apt/keyrings/hashicorp.asc]\
https://apt.releases.hashicorp.com $(lsb_release -cs) main
SRC
sudo apt update && sudo apt list --upgradeable
sudo apt upgrade && sudo apt install terraform
terraform version
Structure
sdlc/
├─ main.tf # Main Terraform config file
├─ variables.tf # Variable declarations
├─ terraform.tfvars # Variable assigned
├─ outputs.tf # Output definitions
├─ provider.tf # Provider-specific config
├─ terraform.tfstate # Terraform state file
├─ academia.auto.tfvars # User Sensitive Data
├─ dev.tf # Dev Env config for development
├─ prod.tf # Prod Env config for production
├─ modules/ # Directory for custom modules
│ ├─ module1/ # Custom module 1
│ │ ├─ main.tf # Module-specific Terraform config
│ │ ├─ variables.tf # Module-specific variables
│ │ └─ outputs.tf # Module-specific outputs
│ └─ module2/ # Custom module 2
│ ├─ main.tf
│ ├─ variables.tf
│ └─ outputs.tf
├─ environments/ # Directory for env
│ ├─ dev/ # Development env
│ │ ├─ main.tf # Env specific Terraform config
│ │ ├─ variables.tf
│ │ └─ outputs.tf
│ └─ prod/ # Production env
│ ├─ main.tf
│ ├─ variables.tf
│ └─ outputs.tf
├─ scripts/ # Scripts or utility for IaC
└── README.md
Summary
Backend » HTTP
Playground
References |