2014-07-28 19:43:00 +02:00
|
|
|
variable "foo" {
|
2014-08-05 07:04:48 +02:00
|
|
|
default = "bar"
|
|
|
|
description = "bar"
|
2014-07-28 19:43:00 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
variable "amis" {
|
|
|
|
default = {
|
2014-08-05 07:04:48 +02:00
|
|
|
east = "foo"
|
2014-07-28 19:43:00 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
provider "aws" {
|
2014-08-05 07:04:48 +02:00
|
|
|
access_key = "foo"
|
|
|
|
secret_key = "bar"
|
2014-07-28 19:43:00 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
provider "do" {
|
2014-08-05 07:04:48 +02:00
|
|
|
api_key = "${var.foo}"
|
2014-07-28 19:43:00 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
resource "aws_security_group" "firewall" {
|
|
|
|
}
|
|
|
|
|
|
|
|
resource aws_instance "web" {
|
2016-06-12 17:30:45 +02:00
|
|
|
ami = "${var.amis["east"]}"
|
2014-07-28 19:43:00 +02:00
|
|
|
security_groups = [
|
|
|
|
"foo",
|
|
|
|
"${aws_security_group.firewall.foo}"
|
|
|
|
]
|
|
|
|
|
|
|
|
network_interface {
|
|
|
|
device_index = 0
|
|
|
|
description = "Main network interface"
|
|
|
|
}
|
|
|
|
|
|
|
|
depends_on = ["aws_security_group.firewall"]
|
|
|
|
}
|