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 +}