Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ module "ec2_instance" {

### Create multiple instances of a resource

<Tabs>
<Tab heading="AWS">
The following example creates one instance for each subnet provided in the input variable:

```hcl
Expand All @@ -133,6 +135,26 @@ resource "aws_instance" "server" {
}
}
```
</Tab>
<Tab heading="AzureRM">
The following example creates one Azure resource group for each name provided in the input variable:
```hcl
variable "resource_group_names" {
type = list(string)
default = [
"app",
"api",
"batch"
]
}
resource "azurerm_resource_group" "example" {
count = length(var.resource_group_names)
name = "${var.resource_group_names[count.index]}-rg"
location = "eastus"
}
```
</Tab>
</Tabs>

### Invoke an action multiple times

Expand Down
Loading