In terraform, say you create an Elastic IP resource (to get a static/non-changing public IP you can assign to an EC2 instance), as follows:
resource "aws_eip" "ip" {
instance = "${aws_instance.example.id}"
}
After elastic ip resource is created, it will have an exported variable called "public_ip". Create a output variable called "ip" that will expose this value (as output to "terraform apply" or to a module that uses your module)
[...]
output "ip" {
value = "${aws_eip.ip.public_ip}"
}
^^ note the keyword "output" for the block type
In terraform, say you create an Elastic IP resource (to get a static/non-changing public IP you can assign to an EC2 instance), as follows:
resource "aws_eip" "ip" {
instance = "${aws_instance.example.id}"
}
After elastic ip resource is created, it will have an exported variable called "public_ip". Create a output variable called "ip" that will expose this value (as output to "terraform apply" or to a module that uses your module)
[...]
In terraform, say you create an Elastic IP resource (to get a static/non-changing public IP you can assign to an EC2 instance), as follows:
resource "aws_eip" "ip" {
instance = "${aws_instance.example.id}"
}
After elastic ip resource is created, it will have an exported variable called "public_ip". Create a output variable called "ip" that will expose this value (as output to "terraform apply" or to a module that uses your module)
[...]
output "ip" {
value = "${aws_eip.ip.public_ip}"
}
^^ note the keyword "output" for the block type
status | not learned | measured difficulty | 37% [default] | last interval [days] | |||
---|---|---|---|---|---|---|---|
repetition number in this series | 0 | memorised on | scheduled repetition | ||||
scheduled repetition interval | last repetition or drill |