github.com/hashicorp/terraform-plugin-sdk@v1.17.2/terraform/testdata/graph-provisioners/main.tf (about)

     1  variable "foo" {
     2      default = "bar"
     3      description = "bar"
     4  }
     5  
     6  provider "aws" {}
     7  
     8  resource "aws_security_group" "firewall" {}
     9  
    10  resource "aws_instance" "web" {
    11      ami = "${var.foo}"
    12      security_groups = [
    13          "foo",
    14          "${aws_security_group.firewall.foo}"
    15      ]
    16      provisioner "winrm" {
    17          cmd = "echo foo"
    18      }
    19      provisioner "winrm" {
    20          cmd = "echo bar"
    21      }
    22  }
    23  
    24  resource "aws_load_balancer" "weblb" {
    25      provisioner "shell" {
    26          cmd = "add ${aws_instance.web.id}"
    27          connection {
    28              host = "localhost"
    29              type = "magic"
    30              user = "${aws_security_group.firewall.id}"
    31          }
    32      }
    33  }