Last active
October 22, 2021 15:46
-
-
Save wwalker/599ec9b7661f5267d552558c3508117e to your computer and use it in GitHub Desktop.
dynamic for example terraform
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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