Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions docs/resources/instance_server.md
Original file line number Diff line number Diff line change
Expand Up @@ -295,8 +295,13 @@ In addition to all arguments above, the following attributes are exported:
- `private_ip` - The Scaleway internal IP address of the server (Deprecated use [ipam_ip datasource](../data-sources/ipam_ip.md#instance-private-network-ip) instead).
- `public_ip` - The public IP address of the server (Deprecated use `public_ips` instead).
- `public_ips` - The list of public IPs of the server.
- `id` - The ID of the IP
- `address` - The address of the IP
- `id` - The ID of the IP.
- `address` - The address of the IP.
- `gateway` - The IP of the Gateway associated with the IP.
- `netmask` - The CIDR netmask of the IP.
- `family` - The IP address' family.
- `dynamic` - Whether the IP is dynamic.
- `provisioning_mode` - The provisioning mode of the IP
- `ipv6_address` - The default ipv6 address routed to the server. ( Only set when enable_ipv6 is set to true )
Deprecated: Please use a scaleway_instance_ip with a `routed_ipv6` type.
- `ipv6_gateway` - The ipv6 gateway address. ( Only set when enable_ipv6 is set to true )
Expand Down
25 changes: 25 additions & 0 deletions internal/services/instance/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,31 @@ func ResourceServer() *schema.Resource {
Computed: true,
Description: "IP Address",
},
"gateway": {
Type: schema.TypeString,
Computed: true,
Description: "Gateway's IP address",
},
"netmask": {
Type: schema.TypeString,
Computed: true,
Description: "CIDR netmask",
},
"family": {
Type: schema.TypeString,
Computed: true,
Description: "IP address family (inet or inet6)",
},
"dynamic": {
Type: schema.TypeBool,
Computed: true,
Description: "Whether the IP is dynamic",
},
"provisioning_mode": {
Type: schema.TypeString,
Computed: true,
Description: "Provisioning mode of the IP address",
},
},
},
},
Expand Down
6 changes: 6 additions & 0 deletions internal/services/instance/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1512,6 +1512,12 @@ func TestAccServer_IPs(t *testing.T) {
arePrivateNICsPresent(tt, "scaleway_instance_server.main"),
resource.TestCheckResourceAttr("scaleway_instance_server.main", "public_ips.#", "1"),
resource.TestCheckResourceAttrPair("scaleway_instance_server.main", "public_ips.0.id", "scaleway_instance_ip.ip1", "id"),
resource.TestCheckResourceAttrSet("scaleway_instance_server.main", "public_ips.0.address"),
resource.TestCheckResourceAttr("scaleway_instance_server.main", "public_ips.0.gateway", "62.210.0.1"),
resource.TestCheckResourceAttr("scaleway_instance_server.main", "public_ips.0.netmask", "32"),
resource.TestCheckResourceAttr("scaleway_instance_server.main", "public_ips.0.family", "inet"),
resource.TestCheckResourceAttr("scaleway_instance_server.main", "public_ips.0.dynamic", "false"),
resource.TestCheckResourceAttr("scaleway_instance_server.main", "public_ips.0.provisioning_mode", "dhcp"),
),
},
{
Expand Down
Loading
Loading