github.com/nevins-b/terraform@v0.3.8-0.20170215184714-bbae22007d5a/config/test-fixtures/basic.tf (about)

     1  terraform {
     2      required_version = "foo"
     3  }
     4  
     5  variable "foo" {
     6      default = "bar"
     7      description = "bar"
     8  }
     9  
    10  variable "bar" {
    11      type = "string"
    12  }
    13  
    14  variable "baz" {
    15      type = "map"
    16  
    17      default = {
    18          key = "value"
    19      }
    20  }
    21  
    22  provider "aws" {
    23    access_key = "foo"
    24    secret_key = "bar"
    25  }
    26  
    27  provider "do" {
    28    api_key = "${var.foo}"
    29  }
    30  
    31  data "do" "simple" {
    32      foo = "baz"
    33  }
    34  
    35  data "do" "depends" {
    36      depends_on = ["data.do.simple"]
    37  }
    38  
    39  resource "aws_security_group" "firewall" {
    40      count = 5
    41  }
    42  
    43  resource aws_instance "web" {
    44      ami = "${var.foo}"
    45      security_groups = [
    46          "foo",
    47          "${aws_security_group.firewall.foo}"
    48      ]
    49  
    50      network_interface {
    51          device_index = 0
    52          description = "Main network interface"
    53      }
    54  
    55      provisioner "file" {
    56          source = "foo"
    57          destination = "bar"
    58      }
    59  }
    60  
    61  resource "aws_instance" "db" {
    62      security_groups = "${aws_security_group.firewall.*.id}"
    63      VPC = "foo"
    64  
    65      depends_on = ["aws_instance.web"]
    66  
    67      provisioner "file" {
    68          source = "foo"
    69          destination = "bar"
    70      }
    71  }
    72  
    73  output "web_ip" {
    74      value = "${aws_instance.web.private_ip}"
    75  }
    76  
    77  atlas {
    78      name = "mitchellh/foo"
    79  }