I am launching an aws_launch_configuration
instance using terraform.
I'm using a shell script for the user_data
variable, like so:
resource "aws_launch_configuration" "launch_config" {
...
user_data = "${file("router-init.sh")}"
...
}
Within this router-init.sh
, one of the things I would like to do is to have access to the IP addresses for other instances I am launching via terraform.
I know that I can use a splat to access all the IP addresses of that instance, for instance:
output ip_address {
value = ${aws_instance.myAWSInstance.*.private_ip}"
}
Is there a way to pass/access these IP addresses within the router-init.sh
script?