Skip to content

Commit 8e60c5e

Browse files
committed
fix(baremetal): compute mapping id in private network
1 parent ac2139c commit 8e60c5e

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

internal/services/baremetal/server.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,13 +217,18 @@ If this behaviour is wanted, please set 'reinstall_on_ssh_key_changes' argument
217217
Schema: map[string]*schema.Schema{
218218
"id": {
219219
Type: schema.TypeString,
220-
Description: "The private network ID",
220+
Description: "The ID of the private network to associate with the server",
221221
Required: true,
222222
ValidateDiagFunc: verify.IsUUIDorUUIDWithLocality(),
223223
StateFunc: func(i interface{}) string {
224224
return locality.ExpandID(i.(string))
225225
},
226226
},
227+
"mapping_id": {
228+
Type: schema.TypeString,
229+
Description: "The ID of the Server-to-Private Network mapping",
230+
Computed: true,
231+
},
227232
"ipam_ip_ids": {
228233
Type: schema.TypeList,
229234
Optional: true,

internal/services/baremetal/types.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ func flattenPrivateNetworks(region scw.Region, privateNetworks []*baremetalV3.Se
195195
for _, privateNetwork := range privateNetworks {
196196
flattenedPrivateNetworks = append(flattenedPrivateNetworks, map[string]interface{}{
197197
"id": regional.NewIDString(region, privateNetwork.PrivateNetworkID),
198+
"mapping_id": regional.NewIDString(region, privateNetwork.ID),
198199
"ipam_ip_ids": regional.NewRegionalIDs(region, privateNetwork.IpamIPIDs),
199200
"vlan": types.FlattenUint32Ptr(privateNetwork.Vlan),
200201
"status": privateNetwork.Status,

0 commit comments

Comments
 (0)