Quantcast
Channel: Terraform - HashiCorp Discuss
Viewing all articles
Browse latest Browse all 11358

Accessing the aws_instances private ip addresses from other instances

$
0
0

I have a aws_instance resourse defined like this:

  • foo.tf
resource "aws_instance" "foo" {
  count                  = var.instance_count
  ...
}

Then I have a my outputs like this:

  • output.tf
output "seeds" {
  ...
  value = [ aws_instance.foo.1.private_ip, aws_instance.foo.2.private_ip ]
}

And that works perfectly. Now assuming that my count variable has 10 nodes, how can I access the private ip addresses of my seeds from all 10 instances? I would like to be able to access the seeds list from the user_data on each of the 10 instances.

6 posts - 3 participants

Read full topic


Viewing all articles
Browse latest Browse all 11358

Trending Articles