Giter Site home page Giter Site logo

Comments (6)

scshitole avatar scshitole commented on June 2, 2024
/* nodes with port1 */
 
resource "bigip_ltm_node" "nodes_port1" {
 
  count   = "${var.nodes_port1_count}"
 
  name    = "${format("/%s/%s", var.partition_name, element(keys(var.nodes_port1), count.index))}"
 
  address = "${lookup(var.nodes_port1, element(keys(var.nodes_port1), count.index))}"
 
 
 
  monitor       = "default"
 
  rate_limit    = "disabled"
 
  dynamic_ratio = "1"
 
}
 
 
 
/* nodes with port2 */
 
resource "bigip_ltm_node" "nodes_port2" {
 
  count   = "${var.nodes_port2_count}"
 
  name    = "${format("/%s/%s", var.partition_name, element(keys(var.nodes_port2), count.index))}"
 
  address = "${lookup(var.nodes_port2, element(keys(var.nodes_port2), count.index))}"
 
 
 
  monitor       = "default"
 
  rate_limit    = "disabled"
 
  dynamic_ratio = "1"
 
}
 
 
 
/* pool */
 
resource "bigip_ltm_pool" "pool" {
 
  name                = "${format("/%s/pool", var.partition_name)}"
 
  load_balancing_mode = "round-robin"
 
  monitors            = ["/Common/tcp"]
 
  allow_snat          = "yes"
 
  allow_nat           = "yes"
 
 
 
  depends_on = ["bigip_ltm_node.nodes_port1", "bigip_ltm_node.nodes_port2"]
 
}
 
 
 
/* Pool attachment nodes port1*/
 
resource "bigip_ltm_pool_attachment" "nodes_port1" {
 
  count = "${var.nodes_port1_count}"
 
  pool  = "${bigip_ltm_pool.pool.name}"
 
  node  = "${format("%s:443", bigip_ltm_node.nodes_port1.*.name[count.index])}"
 
 
 
  depends_on = ["bigip_ltm_node.nodes_port1", "bigip_ltm_pool.pool"]
 
}
 
 
 
/* Pool attachment nodes port2*/
 
resource "bigip_ltm_pool_attachment" "nodes_port2" {
 
  count = "${var.nodes_port2_count}"
 
  pool  = "${bigip_ltm_pool.pool.name}"
 
  node  = "${format("%s:80", bigip_ltm_node.nodes_port2.*.name[count.index])}"
 
 
 
  depends_on = ["bigip_ltm_node.nodes_port2", "bigip_ltm_pool.pool"]
 
}
 
 

from terraform-provider-bigip.

spirrello avatar spirrello commented on June 2, 2024

Thanks, i'll try this.

from terraform-provider-bigip.

vjvalenti2 avatar vjvalenti2 commented on June 2, 2024

@scshitole Would you be able to provide a version targeted for 0.12? It seems that the new for loop functionality would really come in handy here.

from terraform-provider-bigip.

dannyk81 avatar dannyk81 commented on June 2, 2024

release v0.12.3 is out (https://github.com/terraform-providers/terraform-provider-bigip/blob/v0.12.3/CHANGELOG.md#0123-june-06-2019) and includes support for 0.12

from terraform-provider-bigip.

vjvalenti2 avatar vjvalenti2 commented on June 2, 2024

Yes, I am aware. We are building an Big-IP configuration from scratch so it would be very helpful to take advantage of some of 0.12's new features like dynamic blocks and for loops. But I haven't yet seen any working examples of such with this provider.

How can we for example generate dynamic blocks of node resources from a list of node names?

from terraform-provider-bigip.

vjvalenti2 avatar vjvalenti2 commented on June 2, 2024

Nevermind - I now see that for/for_each does not (yet) apply at the resource level, so I went with the old count method.

from terraform-provider-bigip.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.