github.com/erriapo/terraform@v0.6.12-0.20160203182612-0340ea72354f/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  resource "aws_security_group" "firewall" {
    28      count = 5
    29  }
    30  
    31  resource aws_instance "web" {
    32      ami = "${var.foo}"
    33      security_groups = [
    34          "foo",
    35          "${aws_security_group.firewall.foo}"
    36      ]
    37  
    38      network_interface {
    39          device_index = 0
    40          description = "Main network interface"
    41      }
    42  
    43      provisioner "file" {
    44          source = "foo"
    45          destination = "bar"
    46      }
    47  }
    48  
    49  resource "aws_instance" "db" {
    50      security_groups = "${aws_security_group.firewall.*.id}"
    51      VPC = "foo"
    52  
    53      depends_on = ["aws_instance.web"]
    54  
    55      provisioner "file" {
    56          source = "foo"
    57          destination = "bar"
    58      }
    59  }
    60  
    61  output "web_ip" {
    62      value = "${aws_instance.web.private_ip}"
    63  }
    64  
    65  atlas {
    66      name = "mitchellh/foo"
    67  }