| 1 |
variable "foo" { |
| 2 |
default = "bar" |
| 3 |
description = "bar" |
| 4 |
} |
| 5 |
|
| 6 |
developer = ["fatih", "arslan"] |
| 7 |
|
| 8 |
provider "aws" { |
| 9 |
access_key = "foo" |
| 10 |
secret_key = "bar" |
| 11 |
} |
| 12 |
|
| 13 |
provider "do" { |
| 14 |
api_key = "${var.foo}" |
| 15 |
} |
| 16 |
|
| 17 |
resource "aws_security_group" "firewall" { |
| 18 |
count = 5 |
| 19 |
} |
| 20 |
|
| 21 |
resource aws_instance "web" { |
| 22 |
ami = "${var.foo}" |
| 23 |
|
| 24 |
security_groups = [ |
| 25 |
"foo", |
| 26 |
"${aws_security_group.firewall.foo}", |
| 27 |
] |
| 28 |
|
| 29 |
network_interface { |
| 30 |
device_index = 0 |
| 31 |
description = "Main network interface" |
| 32 |
} |
| 33 |
|
| 34 |
network_interface = { |
| 35 |
device_index = 1 |
| 36 |
|
| 37 |
description = <<EOF |
| 38 |
ANOTHER NETWORK INTERFACE |
| 39 |
EOF |
| 40 |
} |
| 41 |
} |
| 42 |
|
| 43 |
resource "aws_instance" "db" { |
| 44 |
security_groups = "${aws_security_group.firewall.*.id}" |
| 45 |
VPC = "foo" |
| 46 |
|
| 47 |
depends_on = ["aws_instance.web"] |
| 48 |
} |
| 49 |
|
| 50 |
output "web_ip" { |
| 51 |
value = <<EOF |
| 52 |
TUBES |
| 53 |
EOF |
| 54 |
} |