github.com/terraform-modules-krish/terratest@v0.29.0/examples/terraform-basic-example/main.tf (about)

     1  # ---------------------------------------------------------------------------------------------------------------------
     2  # PIN TERRAFORM VERSION TO >= 0.12
     3  # The examples have been upgraded to 0.12 syntax
     4  # ---------------------------------------------------------------------------------------------------------------------
     5  
     6  terraform {
     7    required_version = ">= 0.12"
     8  }
     9  
    10  # ---------------------------------------------------------------------------------------------------------------------
    11  # BASIC TERRAFORM EXAMPLE
    12  # See test/terraform_aws_example.go for how to write automated tests for this code.
    13  # ---------------------------------------------------------------------------------------------------------------------
    14  
    15  data "template_file" "example" {
    16    template = var.example
    17  }
    18  
    19  data "template_file" "example2" {
    20    template = var.example2
    21  }
    22  
    23  resource "local_file" "example" {
    24    content  = "${data.template_file.example.rendered} + ${data.template_file.example2.rendered}"
    25    filename = "example.txt"
    26  }
    27  
    28  resource "local_file" "example2" {
    29    content  = data.template_file.example2.rendered
    30    filename = "example2.txt"
    31  }
    32