Skip to content

Instantly share code, notes, and snippets.

@jnahelou
Created August 20, 2018 15:13
Show Gist options
  • Save jnahelou/abadbe41b839f70791bc053013aaeb62 to your computer and use it in GitHub Desktop.
Save jnahelou/abadbe41b839f70791bc053013aaeb62 to your computer and use it in GitHub Desktop.
VIP for F5
provider "bigip" {}
resource "bigip_ltm_node" "node" {
name = "/Common/10.2.0.2"
address = "10.2.0.2"
}
resource "bigip_ltm_pool" "pool" {
name = "/Common/my-pool"
monitors = ["/Common/http"]
allow_nat = "yes"
allow_snat = "yes"
load_balancing_mode = "round-robin"
slow_ramp_time = "5"
service_down_action = "reset"
reselect_tries = "2"
}
resource "bigip_ltm_pool_attachment" "test-pool_test-node" {
pool = "${bigip_ltm_pool.pool.id}"
node = "${bigip_ltm_node.node.id}:443"
#depends_on = ["bigip_ltm_node.node", "bigip_ltm_pool.pool"]
}
resource "bigip_ltm_virtual_server" "test-vs" {
name = "/Common/myapp.myorg.local"
destination = "10.0.0.1"
port = 443
mask = "255.255.255.255"
source_address_translation = "automap"
ip_protocol = "tcp"
profiles = ["/Common/http"]
client_profiles = ["/Common/tcp"]
server_profiles = ["/Common/tcp-lan-optimized"]
persistence_profiles = ["/Common/source_addr"]
fallback_persistence_profile = "/Common/dest_addr"
pool = "${bigip_ltm_pool.pool.id}"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment