hcl/parser/test-fixtures/complex.hcl

40 lines
632 B
HCL
Raw Normal View History

2015-10-18 20:25:17 +00:00
variable "foo" {
2015-10-25 22:34:41 +00:00
default = "bar"
description = "bar"
2015-10-18 20:25:17 +00:00
}
provider "aws" {
2015-10-25 22:34:41 +00:00
access_key = "foo"
secret_key = "bar"
2015-10-18 20:25:17 +00:00
}
provider "do" {
2015-10-25 22:34:41 +00:00
api_key = "${var.foo}"
2015-10-18 20:25:17 +00:00
}
resource "aws_security_group" "firewall" {
2015-10-25 22:34:41 +00:00
count = 5
2015-10-18 20:25:17 +00:00
}
resource aws_instance "web" {
2015-10-25 22:34:41 +00:00
ami = "${var.foo}"
security_groups = [
"foo",
"${aws_security_group.firewall.foo}",
]
network_interface = {
device_index = 0
description = "Main network interface"
}
2015-10-18 20:25:17 +00:00
}
resource "aws_instance" "db" {
2015-10-25 22:34:41 +00:00
security_groups = "${aws_security_group.firewall.*.id}"
VPC = "foo"
depends_on = ["aws_instance.web"]
2015-10-18 20:25:17 +00:00
}
output "web_ip" {
2015-10-25 22:34:41 +00:00
value = "${aws_instance.web.private_ip}"
2015-10-18 20:25:17 +00:00
}