forked from jdallen-a10/a10-terraform-thunder-container
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcthunder.tf
85 lines (81 loc) · 1.71 KB
/
cthunder.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
##
## Thunder Container Terraform file
##
## John D. Allen
## Sr. Solutions Engineer
## A10 Networks, Inc.
## August, 2020
##
## Licensed under Apache-2.0 for private use.
## All other Rights Reserved.
##
resource "docker_image" "cthunder" {
name = "acos_docker_5_2_0_154:latest"
keep_locally = true
}
resource "docker_container" "cthunder" {
depends_on = [
docker_network.slb-outside-net,
docker_network.slb-inside-net
]
image = docker_image.cthunder.latest
name = "cthunder52"
ports {
# SSH Port
internal = 22
external = 222
}
networks_advanced {
name = "bridge"
}
networks_advanced {
name = "slb-inside-net"
}
networks_advanced {
name = "slb-outside-net"
}
restart = "always"
#
# Container Resources
memory = 4096
cpu_set = "0-3"
sysctls = map(
"net.ipv6.conf.all.disable_ipv6", 0
)
privileged = true
capabilities {
add = [
"NET_ADMIN",
"SYS_ADMIN",
"IPC_LOCK"
]
}
#
# cThunder Startup Environment Variables
env = [
"ACOS_CTH_SUPPORT_MGMT=y",
"ACOS_CTH_PRODUCT=ADC",
"ACOS_CTH_CONFIG_PATH=/tmp/demo.cfg",
"ACOS_CTH_VETH_DRIVER_LST=veth,macvlan"
]
# Our startup configuration
volumes {
host_path = "/root/terraform/basic-slb/cthunder/demo.cfg"
container_path = "/tmp/demo.cfg"
}
}
#
# Setup local vars for use by main.tf
locals {
depends_on = [docker_container.cthunder]
cth_ips = {
for net in docker_container.cthunder.network_data :
net.network_name => net.ip_address
}
}
#
# Print out the Incoming IP address where connections to the SLB are made.
output "ips" {
depends_on = [docker_container.cthunder]
value = "${local.cth_ips["slb-outside-net"]}"
}