Skip to content

Commit

Permalink
Fix mistakes and add additional example
Browse files Browse the repository at this point in the history
  • Loading branch information
BHoggs authored and Jack Batzner committed Dec 31, 2019
1 parent 7ab6787 commit cedaf85
Showing 1 changed file with 22 additions and 3 deletions.
25 changes: 22 additions & 3 deletions website/docs/d/resources.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,30 @@ data "azurerm_resources" "example" {
data "azurerm_resources" "example" {
resource_group_name = "example-resources"
required_tags {
required_tags = {
environment = "production"
role = "webserver"
}
}
# Get resources by type, create spoke vNet peerings
data "azurerm_resources" "spokes" {
type = "Microsoft.Network/virtualNetworks"
required_tags = {
environment = "production"
role = "spokeNetwork"
}
}
resource "azurerm_virtual_network_peering" "spoke_peers" {
count = length(data.azurerm_resources.spokes.resources)
name = "hub2${data.azurerm_resources.spokes.resources[count.index].name}"
resource_group_name = azurerm_resource_group.hub.name
virtual_network_name = azurerm_virtual_network.hub.name
remote_virtual_network_id = data.azurerm_resources.spokes.resources[count.index].id
}
```

## Argument Reference
Expand All @@ -54,8 +73,8 @@ The `resource` block contains:

* `id` - The Resource ID of this resource.

* `type` - The type of this resoource.
* `type` - The type of this resource. (e.g. `Microsoft.Network/virtualNetworks`)

* `location` - The location of this resource.

* `tags` - The type of resource that this is, such as `Microsoft.Network/virtualNetworks`.
* `tags` - Map of tags that are applied to this resource

0 comments on commit cedaf85

Please sign in to comment.