Skip to content

Commit

Permalink
Merge pull request #366 from Juniper/task/365-update-apstra_datacente…
Browse files Browse the repository at this point in the history
…r_systems-example

Replace deprecated attribute in example.tf
  • Loading branch information
chrismarget-j authored Sep 28, 2023
2 parents f2a5e2c + f6757ad commit 98b7ca6
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 20 deletions.
27 changes: 17 additions & 10 deletions docs/data-sources/datacenter_systems.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,26 @@ Optional `filter` attribute filters the result list so that it only contains IDs
## Example Usage

```terraform
# This example outputs a set of graph db node IDs representing all spine
# switches with tag 'junos' and tag 'qfx'
data "apstra_datacenter_systems" "juniper_spines" {
# This example outputs a set of graph db node IDs representing
# non-prod leaf switches in pod 2.
data "apstra_datacenter_systems" "pod2_nonprod_leafs" {
blueprint_id = apstra_datacenter_blueprint.example.id
filter = {
role = "spine"
system_type = "switch"
tag_ids = ["junos", "qfx"]
}
filters = [
{
role = "leaf"
system_type = "switch"
tag_ids = ["pod2", "dev"]
},
{
role = "leaf"
system_type = "switch"
tag_ids = ["pod2", "test"]
},
]
}
output "qfx_spines" {
value = data.apstra_datacenter_systems.juniper_spines.ids
output "pod2_nonprod_leafs" {
value = data.apstra_datacenter_systems.pod2_nonprod_leafs.ids
}
```

Expand Down
27 changes: 17 additions & 10 deletions examples/data-sources/apstra_datacenter_systems/example.tf
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
# This example outputs a set of graph db node IDs representing all spine
# switches with tag 'junos' and tag 'qfx'
data "apstra_datacenter_systems" "juniper_spines" {
# This example outputs a set of graph db node IDs representing
# non-prod leaf switches in pod 2.
data "apstra_datacenter_systems" "pod2_nonprod_leafs" {
blueprint_id = apstra_datacenter_blueprint.example.id
filter = {
role = "spine"
system_type = "switch"
tag_ids = ["junos", "qfx"]
}
filters = [
{
role = "leaf"
system_type = "switch"
tag_ids = ["pod2", "dev"]
},
{
role = "leaf"
system_type = "switch"
tag_ids = ["pod2", "test"]
},
]
}

output "qfx_spines" {
value = data.apstra_datacenter_systems.juniper_spines.ids
output "pod2_nonprod_leafs" {
value = data.apstra_datacenter_systems.pod2_nonprod_leafs.ids
}

0 comments on commit 98b7ca6

Please sign in to comment.