-
Notifications
You must be signed in to change notification settings - Fork 4
/
aws_example.tf
37 lines (31 loc) · 1.09 KB
/
aws_example.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
module "aws_app" {
source = "github.com/kzap/terraform-modules//providers/aws/app-server"
# Custom Config
servers = "${var.aws_servers}"
prefix = "${var.env}-app"
public_key = "${file("${var.public_key_file}")}"
key_file_path = "${var.private_key_file}"
azs = "${var.aws_azs}"
ami_id = "${var.aws_ami_id}"
create_eip = "${var.aws_create_eip}"
instance_type = "${var.aws_instance_type}"
# AWS config
access_key = "${var.aws_access_key}"
secret_key = "${var.aws_secret_key}"
region = "${var.aws_region}"
key_name = "${var.aws_key_name}"
}
module "centos_app_provisioner" {
source = "github.com/kzap/terraform-modules//provisioners/bash/centos-7/app-db-server"
# Server Info
servers = "${var.aws_servers}"
server_ips = ["${module.aws_app.ec2_ips}"]
server_ids = ["${module.aws_app.ec2_ids}"]
# Login Information
user_login = "${var.aws_user_login}"
public_key = "${file("${var.public_key_file}")}"
key_file_path = "${var.private_key_file}"
}
output "aws_app_ips" {
value = ["${module.aws_app.ec2_ips}"]
}