From bdf07cfca9782923c2b9ff55ea553eb7bba693c1 Mon Sep 17 00:00:00 2001 From: Benoit Garcia Date: Tue, 7 Feb 2023 23:48:23 +0100 Subject: [PATCH] feat: Add outputs to module. --- README.md | 8 ++++++++ outputs.tf | 14 ++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 outputs.tf diff --git a/README.md b/README.md index 71e9772..8dfac00 100644 --- a/README.md +++ b/README.md @@ -64,6 +64,14 @@ module "my_instance" { | [state](#input_state) | State of the server. Default to 'started'. Possible values are: 'started', 'stopped' or 'standby'. | `string` | `"started"` | no | | [tags](#input_tags) | Tags associated with the server and dedicated ip address. | `list(string)` | `[]` | no | | [zone](#input_zone) | The zone in which the instance should be created. Ressource will be created in the zone set at the provider level if null. | `string` | `null` | no | + +## Outputs + +| Name | Description | +|------|-------------| +| [ip4](#output_ip4) | IPv4 address of the intance. | +| [ip6](#output_ip6) | IPv6 address of the instance. | +| [name](#output_name) | Name of the instance. | ## Authors diff --git a/outputs.tf b/outputs.tf new file mode 100644 index 0000000..a152302 --- /dev/null +++ b/outputs.tf @@ -0,0 +1,14 @@ +output "ip4" { + description = "IPv4 address of the intance." + value = var.enable_public_ipv4 ? scaleway_instance_server.this.public_ip : scaleway_instance_server.this.private_ip +} + +output "ip6" { + description = "IPv6 address of the instance." + value = scaleway_instance_server.this.ipv6_address +} + +output "name" { + description = "Name of the instance." + value = scaleway_instance_server.this.name +}