forked from uyuni-project/sumaform
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.tf.aws.example
102 lines (90 loc) · 3.12 KB
/
main.tf.aws.example
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
variable "cc_username" {
description = "SCC or NCC username"
default = "UC7"
}
variable "cc_password" {
description = "SCC or NCC password"
default = // add password here
}
provider "aws" {
region = "us-east-1"
access_key = // add access key as a string here
secret_key = // add secret key as a string here
}
module "aws_network" {
source = "./modules/aws/network"
region = "us-east-1"
availability_zone = "us-east-1e"
ssh_allowed_ips = [
// add comma-separated IP address strings here, those hosts will
// be able to access mirror via SSH
]
name_prefix = "sumaform"
}
module "aws_mirror" {
source = "./modules/aws/mirror"
region = "us-east-1"
availability_zone = "us-east-1e"
ami = "ami-33ee1f25" // change if appropriate (non-SUSE employees or non-us-east-1 region)
key_name = // add SSH key name as a string here
key_file = // add SSH private key path as a string here
data_volume_snapshot_id = "" // see top comment in modules/aws/mirror/main.tf
public_subnet_id = "${module.aws_network.public_subnet_id}"
public_security_group_id = "${module.aws_network.public_security_group_id}"
cc_username = "${var.cc_username}"
cc_password = "${var.cc_password}"
name_prefix = "sumaform"
}
module "aws_suma3pg" {
source = "./modules/aws/host"
name = "suma3pg"
region = "us-east-1"
availability_zone = "us-east-1e"
ami = "ami-febcf8e9" // change if appropriate (non-SUSE employees or non-us-east-1 region)
instance_type = "m4.2xlarge"
volume_size = 100 // GiB
key_name = // add SSH key name as a string here
key_file = // add SSH private key path as a string here
monitoring = true
private_subnet_id = "${module.aws_network.private_subnet_id}"
private_security_group_id = "${module.aws_network.private_security_group_id}"
name_prefix = "sumaform"
version = "3.0-nightly"
database = "postgres"
role = "suse_manager_server"
cc_username = "${var.cc_username}"
cc_password = "${var.cc_password}"
mirror_public_name = "${module.aws_mirror.public_name}"
mirror_private_name = "${module.aws_mirror.private_name}"
}
module "aws_minion" {
source = "./modules/aws/host"
name = "minion"
count = 10
region = "us-east-1"
availability_zone = "us-east-1e"
ami = "ami-febcf8e9" // change if appropriate (non-SUSE employees or non-us-east-1 region)
instance_type = "t2.nano"
volume_size = 2 // GiB
key_name = // add SSH key name as a string here
key_file = // add SSH private key path as a string here
private_subnet_id = "${module.aws_network.private_subnet_id}"
private_security_group_id = "${module.aws_network.private_security_group_id}"
name_prefix = "sumaform"
server = "${module.aws_suma3pg.private_names[0]}"
role = "minion"
mirror_public_name = "${module.aws_mirror.public_name}"
mirror_private_name = "${module.aws_mirror.private_name}"
}
output "key_file" {
value = // add SSH private key path as a string here
}
output "mirror_public_name" {
value = "${module.aws_mirror.public_name}"
}
output "aws_suma3pg_private_name" {
value = "${module.aws_suma3pg.private_names[0]}"
}
output "aws_minion_private_names" {
value = ["${module.aws_minion.private_names}"]
}