-
Notifications
You must be signed in to change notification settings - Fork 15
/
main.tf-public
130 lines (107 loc) · 3.23 KB
/
main.tf-public
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
variable "compartment_ocid" {
type = string
}
variable "tenancy_ocid" {
type = string
}
variable "user_ocid" {
type = string
}
variable "fingerprint" {
type = string
}
variable "private_key_path" {
type = string
}
variable "region" {
default = "<change-me>"
}
variable "environment" {
default = "staging"
}
variable "availability_domain" {
default = "<change-me>"
}
module "simple-vcn" {
region = var.region
compartment_ocid = var.compartment_ocid
my_public_ip_cidr = "<change-me>"
environment = var.environment
source = "../simple-vcn"
}
output "vcn_id" {
value = module.simple-vcn.vcn_id
}
output "public_subnet_id" {
value = module.simple-vcn.public_subnet_id
}
output "secondary_public_subnet_id" {
value = module.simple-vcn.secondary_public_subnet_id
}
output "security_list_id" {
value = module.simple-vcn.security_list_id
}
output "public_subnet_cidr" {
value = module.simple-vcn.public_subnet_cidr
}
module "simple-instance" {
region = var.region
compartment_ocid = var.compartment_ocid
availability_domain = var.availability_domain
private_subnet_id = module.simple-vcn.secondary_public_subnet_id
public_subnet_id = module.simple-vcn.public_subnet_id
environment = var.environment
source = "../simple-instance"
}
output "instance_ip" {
value = module.simple-instance.instance_ip
}
module "instance-pool" {
region = var.region
compartment_ocid = var.compartment_ocid
availability_domain = var.availability_domain
private_subnet_id = module.simple-vcn.secondary_public_subnet_id
public_subnet_id = module.simple-vcn.public_subnet_id
public_subnet_cidr = module.simple-vcn.public_subnet_cidr
environment = var.environment
source = "../instance-pool"
}
output "instance_pool_ips" {
value = module.instance-pool.instances_ips
}
output "instance_pool_id" {
value = module.instance-pool.instance_pool_id
}
output "instance_pool_size" {
value = module.instance-pool.instance_pool_size
}
module "load-balancer" {
region = var.region
compartment_ocid = var.compartment_ocid
is_private = false
instance_pool_id = module.instance-pool.instance_pool_id
instance_pool_size = module.instance-pool.instance_pool_size
vcn_id = module.simple-vcn.vcn_id
private_subnet_id = module.simple-vcn.secondary_public_subnet_id
public_subnet_id = module.simple-vcn.public_subnet_id
environment = var.environment
source = "../load-balancer"
}
output "lb_ip" {
value = module.load-balancer.lb_ip
}
module "network-load-balancer" {
region = var.region
compartment_ocid = var.compartment_ocid
is_private = true
instance_pool_id = module.instance-pool.instance_pool_id
instance_pool_size = module.instance-pool.instance_pool_size
vcn_id = module.simple-vcn.vcn_id
private_subnet_id = module.simple-vcn.secondary_public_subnet_id
public_subnet_id = module.simple-vcn.public_subnet_id
environment = var.environment
source = "../network-load-balancer"
}
output "internal_lb_ip" {
value = module.network-load-balancer.lb_ip
}