User Tools

Site Tools


virtualization:cloud:terraform

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
virtualization:cloud:terraform [2023/09/29 15:13] jotasandokuvirtualization:cloud:terraform [2023/11/02 14:38] (current) – external edit 127.0.0.1
Line 36: Line 36:
 ---- ----
  **DATA SOURCES (RO)** : Are more like to grab info. from existing, read-only stuff ( you can't always (actually, far from it) have the complete infrastructure in your tf templates, resources already exist and you don't have much control over them but you still need to use them inside your Terraform templates).   **DATA SOURCES (RO)** : Are more like to grab info. from existing, read-only stuff ( you can't always (actually, far from it) have the complete infrastructure in your tf templates, resources already exist and you don't have much control over them but you still need to use them inside your Terraform templates). 
 +\\
 +Do not confuse with data sources. Output comes from the successful creation of a thing (like the output of a module). Data is accessing a thing that already exists but isn't necessarily managed in this state. E.g. getting a vpc id when your networking layer is in a different terraform state,
  
   data "oci_identity_availability_domains" "test_availability_domains" {   data "oci_identity_availability_domains" "test_availability_domains" {
Line 61: Line 63:
   * terraform.tfvars :  tfvars file extension is in the root folder of an environment to define values to variables. So we use a *.tfvar file to load in defaults as they are automatically loaded without any additional command line option.   * terraform.tfvars :  tfvars file extension is in the root folder of an environment to define values to variables. So we use a *.tfvar file to load in defaults as they are automatically loaded without any additional command line option.
   * variables.tf : the .tf uses modules to declare them   * variables.tf : the .tf uses modules to declare them
- +  * variable.tfvar vs. variable.tf : The former contains just the vaulues in a ''map'' format. More info [[https://drive.google.com/file/d/1sjIazwMtXbcSOnTruvrsUner9xCz63uQ/view?usp=sharing|Here]]
-variable.tfvar vs. variable.tf+
  
   * **VARIABLE TYPES:**   * **VARIABLE TYPES:**
Line 212: Line 213:
  
  
-**OUTPUTS**: +**OUTPUTS**: 
 +\\ 
 +Do not confuse with data sources. Output comes from the successful creation of a thing (like the output of a module). Data is accessing a thing that already exists but isn't necessarily managed in this state. E.g. getting a vpc id when your networking layer is in a different terraform state,
 \\ \\
 Example1:  If you wanted to output the arn of the following resource in a module: Example1:  If you wanted to output the arn of the following resource in a module:
Line 303: Line 306:
   * https://developer.hashicorp.com/terraform/language/expressions/strings   * https://developer.hashicorp.com/terraform/language/expressions/strings
  
 +
 +----
 +**ITERATIONS**
 +  * By means of [[https://blog.gruntwork.io/terraform-tips-tricks-loops-if-statements-and-gotchas-f739bbae55f9|list_comprehensions]]
  
 ---- ----
virtualization/cloud/terraform.1696000406.txt.gz · Last modified: (external edit)