github.com/jrasell/terraform@v0.6.17-0.20160523115548-2652f5232949/config/test-fixtures/basic.tf (about)

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