-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathmain.tf
153 lines (135 loc) · 5.95 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
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
# ---------------------------------------------------------------------------
# Trivadis AG, Infrastructure Managed Services
# Saegereistrasse 29, 8152 Glattbrugg, Switzerland
# ---------------------------------------------------------------------------
# Name.......: main.tf
# Author.....: Stefan Oehrli (oes) stefan.oehrli@trivadis.com
# Editor.....: Stefan Oehrli
# Date.......: 2020.10.12
# Revision...:
# Purpose....: Main file for the terraform module tvdlab vcn.
# Notes......: Define a minimal terraform version
# Reference..: --
# License....: Apache License Version 2.0, January 2004 as shown
# at http://www.apache.org/licenses/
# ---------------------------------------------------------------------------
terraform {
required_version = ">= 0.13.0"
}
# - ADD VCM Module ----------------------------------------------------------
module "tvdlab-vcn" {
source = "Trivadis/tvdlab-vcn/oci"
#source = "../terraform-oci-tvdlab-vcn"
version = ">= 1.1.2"
# - Mandatory Parameters --------------------------------------------------
region = var.region
compartment_id = var.compartment_id
# - Optional Parameters ---------------------------------------------------
# Lab Configuration
resource_name = var.resource_name
tvd_domain = var.tvd_domain
tvd_participants = var.tvd_participants
# general oci parameters
label_prefix = var.label_prefix
tags = var.tags
# VCN Network parameter
nat_gateway_enabled = var.nat_gateway_enabled
internet_gateway_enabled = var.internet_gateway_enabled
service_gateway_enabled = var.service_gateway_enabled
vcn_cidr = var.vcn_cidr
private_netnum = var.private_netnum
private_newbits = var.private_newbits
public_netnum = var.public_netnum
public_newbits = var.public_newbits
# Trivadis LAB specific parameter
tvd_dns_hostnum = var.tvd_dns_hostnum
tvd_private_dns = var.tvd_private_dns
tvd_public_dns = var.tvd_public_dns
}
# - ADD Bastion Host Module -------------------------------------------------
module "tvdlab-bastion" {
source = "Trivadis/tvdlab-bastion/oci"
#source = "../terraform-oci-tvdlab-bastion"
version = ">= 1.1.1"
# - Mandatory Parameters --------------------------------------------------
tenancy_ocid = var.tenancy_ocid
region = var.region
compartment_id = var.compartment_id
ssh_public_key = var.ssh_public_key
ssh_public_key_path = var.ssh_public_key_path
bastion_subnet = module.tvdlab-vcn.public_subnet_id
# - Optional Parameters ---------------------------------------------------
# general oci parameters
ad_index = var.ad_index
label_prefix = var.label_prefix
tags = var.tags
# Lab Configuration
resource_name = var.resource_name
tvd_domain = var.tvd_domain
tvd_participants = var.tvd_participants
# bastion parameters
bastion_enabled = var.bastion_enabled
bastion_dns_registration = var.bastion_dns_registration
bastion_name = var.bastion_name
bastion_image_id = var.bastion_image_id
bastion_shape = var.bastion_shape
bastion_ocpus = var.bastion_ocpus
bastion_memory_in_gbs = var.bastion_memory_in_gbs
bootstrap_cloudinit_template = var.bootstrap_cloudinit_template
bastion_state = var.bastion_state
bastion_os = var.bastion_os
bastion_os_version = var.bastion_os_version
bastion_boot_volume_size = var.bastion_boot_volume_size
hosts_file = var.hosts_file
yum_upgrade = var.yum_upgrade
guacamole_enabled = var.guacamole_enabled
guacamole_connections = var.guacamole_connections
webhost_name = var.webhost_name
webproxy_name = var.webproxy_name
fail2ban_template = var.fail2ban_template
guacamole_user = var.guacamole_user
guacadmin_user = var.guacadmin_user
guacadmin_password = var.guacadmin_password
admin_email = var.admin_email
staging = var.staging
}
# - ADD DB Module -----------------------------------------------------------
module "tvdlab-db" {
source = "Trivadis/tvdlab-compute/oci"
version = ">=0.1.1"
# - Mandatory Parameters --------------------------------------------------
tenancy_ocid = var.tenancy_ocid
region = var.region
compartment_id = var.compartment_id
# either ssh_public_key or ssh_public_key_path must be specified
ssh_public_key = var.ssh_public_key
ssh_public_key_path = var.ssh_public_key_path
host_subnet = module.tvdlab-vcn.private_subnet_id
# - Optional Parameters ---------------------------------------------------
# general oci parameters
ad_index = var.ad_index
label_prefix = var.label_prefix
tags = var.tags
# Lab Configuration
resource_name = var.resource_name
tvd_domain = var.tvd_domain
tvd_participants = var.tvd_participants
# host parameters
host_enabled = var.db_host_enabled
host_name = var.db_host_name
host_image_id = var.db_host_image_id
host_shape = var.db_host_shape
host_bootstrap = var.db_host_bootstrap
host_state = var.db_host_state
host_public_ip = var.db_host_public_ip
host_private_ip = var.db_host_private_ip
host_os = var.db_host_os
host_os_version = var.db_host_os_version
host_boot_volume_size = var.db_host_boot_volume_size
host_volume_enabled = var.db_host_volume_enabled
host_volume_attachment_type = var.db_host_volume_attachment_type
host_volume_size = var.db_host_volume_size
hosts_file = var.hosts_file
yum_upgrade = var.yum_upgrade
}
# --- EOF -------------------------------------------------------------------