Skip to content
This repository has been archived by the owner on Aug 11, 2024. It is now read-only.

host_num attribute #15

Open
carmine73 opened this issue Jun 23, 2021 · 0 comments · May be fixed by #64
Open

host_num attribute #15

carmine73 opened this issue Jun 23, 2021 · 0 comments · May be fixed by #64
Assignees
Milestone

Comments

@carmine73
Copy link

carmine73 commented Jun 23, 2021

First of all, thanks for this great provider.
It would be nice to have one more attribute host_num that shows the host number inside the network, to be used with the terraform cidrhost function

Terraform Version

Terraform v1.0.0
on linux_amd64
+ provider registry.terraform.io/volcano-coffee-company/cidr v0.1.0

Terraform Configuration Files

locals {
  my-net = {
    ip   = "192.168.1.131"
    mask = "255.255.255.128"
  }

data "cidr_network" "my-net" {
  ip    = local.my-net.ip
  mask  = local.my-net.mask
}

output "my-net" {
  value = data.cidr_network.my-net
}

Expected Behavior

  + my-net          = {
      + broadcast = "192.168.1.255"
      + first_ip  = "192.168.1.129"
      + host_num  = 3
      + id        = "192.168.1.128/25"
      + ip        = "192.168.1.131"
      + last_ip   = "192.168.1.254"
      + mask      = "255.255.255.128"
      + mask_bits = 25
      + network   = "192.168.1.128/25"
      + prefix    = "192.168.1.131/25"
    }
@carmine73 carmine73 changed the title host attribute host_num attribute Jun 23, 2021
@joakimhellum joakimhellum self-assigned this Jun 28, 2021
@joakimhellum joakimhellum added this to the v0.1.1 milestone Jun 28, 2021
@mjrider mjrider linked a pull request Aug 1, 2022 that will close this issue
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants