lord-kyron / terraform-provider-phpipam

Terrform provider for PHPIPAM
https://registry.terraform.io/providers/lord-kyron/phpipam/latest
Apache License 2.0
54 stars 30 forks source link

can we pass specific subnet range using terraform to multiple vms. #16

Closed thatsk closed 4 years ago

thatsk commented 4 years ago
data "phpipam_subnet" "srvsubnet" {
  subnet_address = "10.174.68.0"
  subnet_mask    = 22
}

resource "phpipam_first_free_address" "new_ip" {
  count = 3

  subnet_id   = element(data.phpipam_subnet.srvsubnet.*, count.index).subnet_id
  description = "Managed by Terraform"
}

by defaults its passing from intial counting like 1 2 3 4. Lets say we need to pass from 30 to 40 because 1 to 10 is reserved for some other purpose. can we do that

lord-kyron commented 4 years ago

count.index + 30 this will start the count from the number 30. for example - if you have count = 3 and count.index +30 this combination will count 3 numbers, starting from the number 30 (31,32 and 33)