-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.tf
71 lines (65 loc) · 1.56 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
provider "bigip" {
address = var.address
username = var.username
password = var.password
port = var.port
}
# pin to 1.1.2
terraform {
required_providers {
bigip = {
source = "F5Networks/bigip"
version = "1.11.1"
}
}
}
data "archive_file" "template_zip" {
type = "zip"
source_file = "ConsulWebinar.yaml"
output_path = "ConsulWebinar.zip"
}
resource "bigip_fast_template" "consul-webinar" {
name = "ConsulWebinar"
source = "ConsulWebinar.zip"
md5_hash = filemd5("ConsulWebinar.zip")
depends_on = [data.archive_file.template_zip]
}
resource "bigip_fast_application" "nginx-webserver" {
template = "ConsulWebinar/ConsulWebinar"
fast_json = <<EOF
{
"tenant": "Consul_SD",
"app": "Nginx",
"virtualAddress": "10.0.0.200",
"virtualPort": 8080,
"defpool": "nginx_pool"
}
EOF
depends_on = [bigip_fast_template.consul-webinar]
}
resource "bigip_fast_application" "nginx-app100" {
template = "ConsulWebinar/ConsulWebinar"
fast_json = <<EOF
{
"tenant": "App100",
"app": "App100",
"virtualAddress": "11.0.0.200",
"virtualPort": 8080,
"defpool": "app100_pool"
}
EOF
depends_on = [bigip_fast_template.consul-webinar]
}
resource "bigip_fast_application" "bbnginx-webserver" {
template = "ConsulWebinar/ConsulWebinar"
fast_json = <<EOF
{
"tenant": "S22Consul_SD",
"app": "wordpress",
"virtualAddress": "122.0.0.200",
"virtualPort": 8080,
"defpool": "wordpress_pool"
}
EOF
depends_on = [bigip_fast_template.consul-webinar]
}