Skip to content

Commit a17306a

Browse files
author
Mustafa Mujahid
committed
feat: Add instance private IP to the outputs
1 parent f939e1f commit a17306a

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,7 @@ No modules.
246246
| <a name="output_password_data"></a> [password\_data](#output\_password\_data) | Base-64 encoded encrypted password data for the instance. Useful for getting the administrator password for instances running Microsoft Windows. This attribute is only exported if `get_password_data` is true |
247247
| <a name="output_primary_network_interface_id"></a> [primary\_network\_interface\_id](#output\_primary\_network\_interface\_id) | The ID of the instance's primary network interface |
248248
| <a name="output_private_dns"></a> [private\_dns](#output\_private\_dns) | The private DNS name assigned to the instance. Can only be used inside the Amazon EC2, and only available if you've enabled DNS hostnames for your VPC |
249+
| <a name="output_private_ip"></a> [private\_ip](#output\_private\_ip) | The private IP address assigned to the instance. |
249250
| <a name="output_public_dns"></a> [public\_dns](#output\_public\_dns) | The public DNS name assigned to the instance. For EC2-VPC, this is only available if you've enabled DNS hostnames for your VPC |
250251
| <a name="output_public_ip"></a> [public\_ip](#output\_public\_ip) | The public IP address assigned to the instance, if applicable. NOTE: If you are using an aws\_eip with your instance, you should refer to the EIP's address directly and not use `public_ip` as this field will change after the EIP is attached |
251252
| <a name="output_spot_bid_status"></a> [spot\_bid\_status](#output\_spot\_bid\_status) | The current bid status of the Spot Instance Request |

outputs.tf

+5
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@ output "public_ip" {
4848
value = element(concat(aws_instance.this.*.public_ip, aws_spot_instance_request.this.*.public_ip, [""]), 0)
4949
}
5050

51+
output "private_ip" {
52+
description = "The private IP address assigned to the instance."
53+
value = element(concat(aws_instance.this.*.private_ip, aws_spot_instance_request.this.*.private_ip, [""]), 0)
54+
}
55+
5156
output "tags_all" {
5257
description = "A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block"
5358
value = element(concat(aws_instance.this.*.tags_all, aws_spot_instance_request.this.*.tags_all, [""]), 0)

0 commit comments

Comments
 (0)