Skip to content

Commit

Permalink
Merge pull request #675 from Juniper/feat/672
Browse files Browse the repository at this point in the history
#672 Update routing zone example code
  • Loading branch information
chrismarget-j authored May 30, 2024
2 parents 1a6c132 + 259d358 commit 69f652d
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 14 deletions.
4 changes: 2 additions & 2 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ before:
hooks:
- sh -c "[ \"$(git branch --show-current)\" = \"main\" ] || (echo must be on branch main; false)"
- sh -c "[ \"$(git pull)\" = \"Already up to date.\" ] || (echo not in sync with origin; false)"
- go run github.com/chrismarget-j/go-licenses save --ignore github.com/Juniper/terraform-provider-apstra --ignore github.com/Juniper/apstra-go-sdk --ignore golang.org/x/sys --save_path=./Third_Party_Code --force ./...
- sh -c "go run github.com/chrismarget-j/go-licenses report ./... --ignore github.com/Juniper/terraform-provider-apstra --ignore github.com/Juniper/apstra-go-sdk/apstra --ignore golang.org/x/sys --template .notices.tpl > Third_Party_Code/NOTICES.md"
- go run github.com/chrismarget-j/go-licenses save --ignore github.com/Juniper/terraform-provider-apstra --ignore github.com/Juniper/apstra-go-sdk --save_path=./Third_Party_Code --force ./...
- sh -c "go run github.com/chrismarget-j/go-licenses report ./... --ignore github.com/Juniper/terraform-provider-apstra --ignore github.com/Juniper/apstra-go-sdk/apstra --template .notices.tpl > Third_Party_Code/NOTICES.md"
- go run github.com/hashicorp/terraform-plugin-docs/cmd/tfplugindocs
- git update-index --refresh && git diff-index --quiet HEAD --
builds:
Expand Down
21 changes: 15 additions & 6 deletions docs/resources/datacenter_routing_zone.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,21 @@ This resource creates a Routing Zone within a Datacenter Blueprint.
# This example creates a routing zone within an
# existing datacenter blueprint.
resource "apstra_datacenter_routing_zone" "blue" {
name = "vrf blue"
blueprint_id = "<blueprint-id-goes-here>"
vlan_id = 5 # optional
vni = 5000 # optional
dhcp_servers = ["192.168.100.10", "192.168.200.10"] # optional
# routing_policy_id = "<routing-policy-node-id-goes-here>" # optional
name = "vrf blue"
blueprint_id = "<blueprint-id-goes-here>"
vlan_id = 5 # optional
vni = 5000 # optional
dhcp_servers = ["192.168.100.10", "192.168.200.10"] # optional
# routing_policy_id = "<routing-policy-node-id-goes-here>" # optional
}
# Next, assign an IPv4 pool to be used by loopback interfaces of leaf
# switches participating in the Routing Zone.
resource "apstra_datacenter_resource_pool_allocation" "blue_loopbacks" {
blueprint_id = "<blueprint-id-goes-here>"
routing_zone_id = apstra_datacenter_routing_zone.blue.id
pool_ids = ["<ipv4-pool-id-goes-here>"]
role = "leaf_loopback_ips"
}
```

Expand Down
21 changes: 15 additions & 6 deletions examples/resources/apstra_datacenter_routing_zone/example.tf
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
# This example creates a routing zone within an
# existing datacenter blueprint.
resource "apstra_datacenter_routing_zone" "blue" {
name = "vrf blue"
blueprint_id = "<blueprint-id-goes-here>"
vlan_id = 5 # optional
vni = 5000 # optional
dhcp_servers = ["192.168.100.10", "192.168.200.10"] # optional
# routing_policy_id = "<routing-policy-node-id-goes-here>" # optional
name = "vrf blue"
blueprint_id = "<blueprint-id-goes-here>"
vlan_id = 5 # optional
vni = 5000 # optional
dhcp_servers = ["192.168.100.10", "192.168.200.10"] # optional
# routing_policy_id = "<routing-policy-node-id-goes-here>" # optional
}

# Next, assign an IPv4 pool to be used by loopback interfaces of leaf
# switches participating in the Routing Zone.
resource "apstra_datacenter_resource_pool_allocation" "blue_loopbacks" {
blueprint_id = "<blueprint-id-goes-here>"
routing_zone_id = apstra_datacenter_routing_zone.blue.id
pool_ids = ["<ipv4-pool-id-goes-here>"]
role = "leaf_loopback_ips"
}

0 comments on commit 69f652d

Please sign in to comment.