-
Notifications
You must be signed in to change notification settings - Fork 9.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Variable interpolation of a multiple instance resource #633
Comments
@Nalum I assume you want to use the count.index here to get only a single IP for a specific resource right? I think (not tested) you could try something like this: The UUID in the second string you get, is actually an internally used UUID that should not be exposed/shown. I think that could be considered a bug, but it's not really related to your issue. |
@svanharmelen I've just tried to use that as follows:
And
The first one added the following to the file:
And the second one gave the following error:
I also tried this:
But got the following error:
|
@Nalum after digging some deeper I noticed this isn't supported yet... Sorry for the confusion! So this has to be added as a feature to TF and currently cannot be done... |
The way to do this would be with "${element(aws_instance.api.*.public_ip, count.index}". |
@armon @svanharmelen Thanks guys. Do you know when this release is due? |
@svanharmelen brilliant, thank you very much. |
I have the following
aws_instance
resource:When run this resource is creating the
public_ips
file with the following content:As you can see the
IP
of the first instance is duplicated and there is, what I assume to be, a Terraform ID followed by theIP
of the second instance.This is causing issues for me provisioning the machines using
chef
. Am I doing this correctly or should I be doing it another way?The text was updated successfully, but these errors were encountered: