github.com/hugorut/terraform@v1.1.3/src/terraform/testdata/apply-resource-scale-in/main.tf (about) 1 variable "instance_count" {} 2 3 resource "aws_instance" "one" { 4 count = var.instance_count 5 } 6 7 locals { 8 one_id = element(concat(aws_instance.one.*.id, [""]), 0) 9 } 10 11 resource "aws_instance" "two" { 12 value = local.one_id 13 }