Skip to content

Instantly share code, notes, and snippets.

@wwalker
Last active October 22, 2021 15:46
Show Gist options
  • Save wwalker/599ec9b7661f5267d552558c3508117e to your computer and use it in GitHub Desktop.
Save wwalker/599ec9b7661f5267d552558c3508117e to your computer and use it in GitHub Desktop.
dynamic for example terraform
variable "ephemeral_block_device" {
type = map(string)
default = {
"sdb" = "ephemeral0"
"sdc" = "ephemeral1"
"sdd" = "ephemeral2"
"sde" = "ephemeral3"
"sdf" = "ephemeral4"
"sdg" = "ephemeral5"
}
}
resource "aws_instance" "warm" {
dynamic "ephemeral_block_device" {
for_each = var.ephemeral_block_device
content {
device_name = ephemeral_block_device.key
virtual_name = ephemeral_block_device.value
}
}
<snip>
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment