github.com/chaithanya90/terraform-hashicorp@v0.11.12-beta1/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  locals {
    62    security_group_ids = "${aws_security_group.firewall.*.id}"
    63    web_ip = "${aws_instance.web.private_ip}"
    64  }
    65  
    66  locals {
    67    literal = 2
    68    literal_list = ["foo"]
    69    literal_map = {"foo" = "bar"}
    70  }
    71  
    72  resource "aws_instance" "db" {
    73      security_groups = "${aws_security_group.firewall.*.id}"
    74      VPC = "foo"
    75  
    76      depends_on = ["aws_instance.web"]
    77  
    78      provisioner "file" {
    79          source = "foo"
    80          destination = "bar"
    81      }
    82  }
    83  
    84  output "web_ip" {
    85      value = "${aws_instance.web.private_ip}"
    86  }
    87  
    88  output "web_id" {
    89      description = "The ID"
    90      value = "${aws_instance.web.id}"
    91  }
    92  
    93  atlas {
    94      name = "mitchellh/foo"
    95  }