Resource aws_instance does not have attr private_ip_address (#15890)
This commit is contained in:
parent
fca841a379
commit
7b3f32f3de
|
@ -46,7 +46,7 @@ return list elements by index: `${var.subnets[idx]}`.
|
||||||
|
|
||||||
#### Attributes of your own resource
|
#### Attributes of your own resource
|
||||||
|
|
||||||
The syntax is `self.ATTRIBUTE`. For example `${self.private_ip_address}`
|
The syntax is `self.ATTRIBUTE`. For example `${self.private_ip}`
|
||||||
will interpolate that resource's private IP address.
|
will interpolate that resource's private IP address.
|
||||||
|
|
||||||
-> **Note**: The `self.ATTRIBUTE` syntax is only allowed and valid within
|
-> **Note**: The `self.ATTRIBUTE` syntax is only allowed and valid within
|
||||||
|
|
|
@ -19,7 +19,7 @@ resource "aws_instance" "web" {
|
||||||
# ...
|
# ...
|
||||||
|
|
||||||
provisioner "local-exec" {
|
provisioner "local-exec" {
|
||||||
command = "echo ${self.private_ip_address} > file.txt"
|
command = "echo ${self.private_ip} > file.txt"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
@ -114,7 +114,7 @@ resource "aws_instance" "web" {
|
||||||
# ...
|
# ...
|
||||||
|
|
||||||
provisioner "local-exec" {
|
provisioner "local-exec" {
|
||||||
command = "echo ${self.private_ip_address} > file.txt"
|
command = "echo ${self.private_ip} > file.txt"
|
||||||
on_failure = "continue"
|
on_failure = "continue"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue