-
Notifications
You must be signed in to change notification settings - Fork 59
/
main.tf
76 lines (64 loc) · 2.45 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
resource "citrixadc_service" "service1" {
servicetype = var.service1_servicetype
name = var.service1_name
ipaddress = var.service1_ip
ip = var.service1_ip
port = var.service1_port
}
resource "citrixadc_service" "service2" {
servicetype = var.service2_servicetype
name = var.service2_name
ipaddress = var.service2_ip
ip = var.service2_ip
port = var.service1_port
}
resource "citrixadc_lbvserver" "production_lb" {
depends_on = [citrixadc_sslparameter.defaultprofile]
name = var.production_lb_name
ipv46 = var.production_lb_ip
port = "443"
servicetype = "SSL"
ciphers = ["DEFAULT"]
sslprofile = "ns_default_ssl_profile_secure_frontend"
}
resource "citrixadc_systemfile" "sslcert_copy" {
filename = "sslcert.pem"
filelocation = "/var/tmp"
filecontent = file(var.ssl_certificate_path)
}
resource "citrixadc_systemfile" "sslkey_copy" {
filename = "sslkey.ky"
filelocation = "/var/tmp"
filecontent = file(var.ssl_key_path)
}
resource "citrixadc_sslcertkey" "sslcertkey1" {
depends_on = [citrixadc_sslcertkey.sslcacert]
certkey = var.ssl_certkey_name
cert = format("%s/%s", citrixadc_systemfile.sslcert_copy.filelocation, citrixadc_systemfile.sslcert_copy.filename)
key = format("%s/%s", citrixadc_systemfile.sslkey_copy.filelocation, citrixadc_systemfile.sslkey_copy.filename)
linkcertkeyname = var.ssl_cacert_name
}
resource "citrixadc_sslvserver_sslcertkey_binding" "sslvserver_sslcertkey_bind" {
vservername = citrixadc_lbvserver.production_lb.name
certkeyname = citrixadc_sslcertkey.sslcertkey1.certkey
}
resource "citrixadc_lbvserver_service_binding" "lbvserver_sslservice1_bind" {
name = citrixadc_lbvserver.production_lb.name
servicename = citrixadc_service.service1.name
}
resource "citrixadc_lbvserver_service_binding" "lbvserver_sslservice2_bind" {
name = citrixadc_lbvserver.production_lb.name
servicename = citrixadc_service.service2.name
}
resource "citrixadc_sslparameter" "defaultprofile" {
defaultprofile = "ENABLED"
}
resource "citrixadc_systemfile" "ssl_cacert_copy" {
filename = "cacert.crt"
filelocation = "/var/tmp"
filecontent = file(var.ssl_cacert_path)
}
resource "citrixadc_sslcertkey" "sslcacert" {
certkey = var.ssl_cacert_name
cert = format("%s/%s", citrixadc_systemfile.ssl_cacert_copy.filelocation, citrixadc_systemfile.ssl_cacert_copy.filename)
}