resource "aws_instance" "foo" {
count = "2"
lifecycle {
create_before_destroy = true
}
resource "aws_instance" "bar" {
output "out" {
value = "${aws_instance.foo.0.id}"