You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Computed fields in terraform come in two types. One is never settable by the user configuration and should be handled similarly to the id field hack we have right now. That is, an extra field with forced value should be set.
Others are settable by the user and should be handled similarly, but with a default value.
The text was updated successfully, but these errors were encountered:
Determining the interpolation type is possible by carefully parsing the provider schema.
A tricky issue is dealing with operations on interpolated fields. E.g. if a field foo has type a list of strings, we would like to access it as a list in Nickel. But setting foo to a default value "${foo}", so that recursive access in Nickel is possible, doesn't allow one to observe that foo should actually be a list.
Sometimes terraform configuration blocks need to reference themselves. HCL uses a self keyword for that. The documentation indicates that in the example below using ${aws_instance.web.public_ip} instead of ${self.public_ip} would not be accepted.
resource"aws_instance""web" {
# ...# Establishes connection to be used by all# generic remote provisioners (i.e. file/remote-exec)connection {
type="ssh"user="root"password=var.root_passwordhost=self.public_ip
}
provisioner"remote-exec" {
inline=[
"puppet apply",
"consul join ${aws_instance.web.private_ip}",
]
}
}
Computed fields in terraform come in two types. One is never settable by the user configuration and should be handled similarly to the
id
field hack we have right now. That is, an extra field withforce
d value should be set.Others are settable by the user and should be handled similarly, but with a
default
value.The text was updated successfully, but these errors were encountered: