@@ -132,32 +132,22 @@ If this behaviour is wanted, please set 'reinstall_on_ssh_key_changes' argument
132
132
"organization_id" : organizationIDSchema (),
133
133
"project_id" : projectIDSchema (),
134
134
"ips" : {
135
- Type : schema .TypeList ,
136
- Computed : true ,
137
- Elem : & schema.Resource {
138
- Schema : map [string ]* schema.Schema {
139
- "id" : {
140
- Type : schema .TypeString ,
141
- Computed : true ,
142
- Description : "The ID of the IP" ,
143
- },
144
- "version" : {
145
- Type : schema .TypeString ,
146
- Computed : true ,
147
- Description : "The version of the IP" ,
148
- },
149
- "address" : {
150
- Type : schema .TypeString ,
151
- Computed : true ,
152
- Description : "The IP address of the IP" ,
153
- },
154
- "reverse" : {
155
- Type : schema .TypeString ,
156
- Computed : true ,
157
- Description : "The Reverse of the IP" ,
158
- },
159
- },
160
- },
135
+ Type : schema .TypeList ,
136
+ Computed : true ,
137
+ Description : "IP addresses attached to the server." ,
138
+ Elem : resourceScalewayBaremetalServerIP (),
139
+ },
140
+ "ipv4" : {
141
+ Type : schema .TypeList ,
142
+ Computed : true ,
143
+ Description : "IPv4 addresses attached to the server" ,
144
+ Elem : resourceScalewayBaremetalServerIP (),
145
+ },
146
+ "ipv6" : {
147
+ Type : schema .TypeList ,
148
+ Computed : true ,
149
+ Description : "IPv6 addresses attached to the server" ,
150
+ Elem : resourceScalewayBaremetalServerIP (),
161
151
},
162
152
"domain" : {
163
153
Type : schema .TypeString ,
@@ -235,6 +225,33 @@ If this behaviour is wanted, please set 'reinstall_on_ssh_key_changes' argument
235
225
}
236
226
}
237
227
228
+ func resourceScalewayBaremetalServerIP () * schema.Resource {
229
+ return & schema.Resource {
230
+ Schema : map [string ]* schema.Schema {
231
+ "id" : {
232
+ Type : schema .TypeString ,
233
+ Computed : true ,
234
+ Description : "The ID of the IPv6" ,
235
+ },
236
+ "version" : {
237
+ Type : schema .TypeString ,
238
+ Computed : true ,
239
+ Description : "The version of the IPv6" ,
240
+ },
241
+ "address" : {
242
+ Type : schema .TypeString ,
243
+ Computed : true ,
244
+ Description : "The IPv6 address" ,
245
+ },
246
+ "reverse" : {
247
+ Type : schema .TypeString ,
248
+ Computed : true ,
249
+ Description : "The Reverse of the IPv6" ,
250
+ },
251
+ },
252
+ }
253
+ }
254
+
238
255
func resourceScalewayBaremetalServerCreate (ctx context.Context , d * schema.ResourceData , meta interface {}) diag.Diagnostics {
239
256
baremetalAPI , zone , err := baremetalAPIWithZone (d , meta )
240
257
if err != nil {
@@ -396,6 +413,8 @@ func resourceScalewayBaremetalServerRead(ctx context.Context, d *schema.Resource
396
413
_ = d .Set ("tags" , server .Tags )
397
414
_ = d .Set ("domain" , server .Domain )
398
415
_ = d .Set ("ips" , flattenBaremetalIPs (server .IPs ))
416
+ _ = d .Set ("ipv4" , flattenBaremetalIPv4s (server .IPs ))
417
+ _ = d .Set ("ipv6" , flattenBaremetalIPv6s (server .IPs ))
399
418
if server .Install != nil {
400
419
_ = d .Set ("os" , newZonedIDString (server .Zone , os .ID ))
401
420
_ = d .Set ("os_name" , os .Name )
0 commit comments