Skip to content

Instantly share code, notes, and snippets.

@t0mk
Created February 27, 2019 14:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save t0mk/9b9ab2b004322a57ab4317924ed158c5 to your computer and use it in GitHub Desktop.
Save t0mk/9b9ab2b004322a57ab4317924ed158c5 to your computer and use it in GitHub Desktop.
packet bgp with count
variable "bgp_password" {
type = "string"
default = "955dB0b81Ef"
}
variable "worker_count" {
type = "string"
default = "2"
}
resource "packet_project" "test" {
name = "testpro"
bgp_config {
deployment_type = "local"
md5 = "${var.bgp_password}"
asn = 65000
}
}
resource "packet_device" "test" {
count = "${var.worker_count}"
hostname = "terraform-test-bgp-sesh"
plan = "baremetal_0"
facility = "ewr1"
operating_system = "ubuntu_16_04"
billing_cycle = "hourly"
project_id = "${packet_project.test.id}"
}
resource "packet_bgp_session" "test" {
count = "${var.worker_count}"
device_id = "${packet_device.test.*.id[count.index]}"
address_family = "ipv4"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment