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

Commit

Permalink
Merge pull request #10 from packet-labs/private/c0dyhi11/fixed-ip-res…
Browse files Browse the repository at this point in the history
…ervations

Fixed IP Reservatoins
  • Loading branch information
paemason authored Mar 4, 2020
2 parents 07756c8 + 21fe05f commit f6668b1
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
9 changes: 8 additions & 1 deletion 02-network-resources.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ resource "packet_reserved_ip_block" "ip_blocks" {
quantity = "${jsonencode(element(var.public_subnets.*.ip_count, count.index))}"
}

resource "packet_reserved_ip_block" "esx_ip_blocks" {
count = var.esxi_host_count
project_id = packet_project.new_project.id
facility = var.facility
quantity = 8
}

resource "packet_vlan" "private_vlans" {
count = "${length(var.private_subnets)}"
facility = "${var.facility}"
Expand All @@ -17,4 +24,4 @@ resource "packet_vlan" "public_vlans" {
facility = "${var.facility}"
project_id = "${packet_project.new_project.id}"
description = "${jsonencode(element(var.public_subnets.*.name, count.index))}"
}
}
12 changes: 11 additions & 1 deletion 04-esx-hosts.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,17 @@ resource "packet_device" "esxi_hosts" {
billing_cycle = "${var.billing_cycle}"
project_id = "${packet_project.new_project.id}"
network_type = "hybrid"
public_ipv4_subnet_size = 29
ip_address {
type = "public_ipv4"
cidr = 29
reservation_ids = [element(packet_reserved_ip_block.esx_ip_blocks.*.id, count.index)]
}
ip_address {
type = "private_ipv4"
}
ip_address {
type = "public_ipv6"
}
}


Expand Down

0 comments on commit f6668b1

Please sign in to comment.