-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.tf
42 lines (37 loc) · 1.03 KB
/
main.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
variable "name" {}
variable "aws_access_key" { default = "" }
variable "aws_secret_key" { default = "" }
variable "tags" { type = "map" }
variable "region" {}
variable "vpc_cidr" {}
variable "ntp_servers" { type = "list" }
variable "ssh_key" {}
variable "route53_zone" { default = "" }
provider "aws" {
region = "${var.region}"
access_key = "${var.aws_access_key}"
secret_key = "${var.aws_secret_key}"
}
module "network" {
source = "./modules/network"
name = "${var.name}"
tags = "${var.tags}"
vpc_cidr = "${var.vpc_cidr}"
ntp_servers = "${var.ntp_servers}"
}
module "compute" {
source = "./modules/compute"
name = "${var.name}"
tags = "${var.tags}"
region = "${var.region}"
vpc_id = "${module.network.vpc_id}"
subnet_ids = "${module.network.subnet_ids}"
ssh_key = "${var.ssh_key}"
route53_zone = "${var.route53_zone}"
}
output "ip" {
value = "${module.compute.ip}"
}
output "dns" {
value = "${module.compute.dns}"
}