Skip to content

Commit aa81676

Browse files
authored
fix(instance): use expandStringPtr for Organization (#712)
Signed-off-by: Patrik Cyvoct <[email protected]>
1 parent d45e88c commit aa81676

File tree

4 files changed

+4
-5
lines changed

4 files changed

+4
-5
lines changed

scaleway/resource_instance_placement_group.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import (
44
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
55
"github.com/hashicorp/terraform-plugin-sdk/helper/validation"
66
"github.com/scaleway/scaleway-sdk-go/api/instance/v1"
7-
"github.com/scaleway/scaleway-sdk-go/scw"
87
)
98

109
func resourceScalewayInstancePlacementGroup() *schema.Resource {
@@ -64,7 +63,7 @@ func resourceScalewayInstancePlacementGroupCreate(d *schema.ResourceData, m inte
6463
res, err := instanceApi.CreatePlacementGroup(&instance.CreatePlacementGroupRequest{
6564
Zone: zone,
6665
Name: expandOrGenerateString(d.Get("name"), "pg"),
67-
Organization: scw.StringPtr(d.Get("organization_id").(string)),
66+
Organization: expandStringPtr(d.Get("organization_id").(string)),
6867
PolicyMode: instance.PlacementGroupPolicyMode(d.Get("policy_mode").(string)),
6968
PolicyType: instance.PlacementGroupPolicyType(d.Get("policy_type").(string)),
7069
})

scaleway/resource_instance_security_group.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ func resourceScalewayInstanceSecurityGroupCreate(d *schema.ResourceData, m inter
9999
res, err := instanceApi.CreateSecurityGroup(&instance.CreateSecurityGroupRequest{
100100
Name: expandOrGenerateString(d.Get("name"), "sg"),
101101
Zone: zone,
102-
Organization: scw.StringPtr(organizationID),
102+
Organization: expandStringPtr(organizationID),
103103
Description: d.Get("description").(string),
104104
Stateful: d.Get("stateful").(bool),
105105
InboundDefaultPolicy: instance.SecurityGroupPolicy(d.Get("inbound_default_policy").(string)),

scaleway/resource_instance_server.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ func resourceScalewayInstanceServerCreate(d *schema.ResourceData, m interface{})
248248
req := &instance.CreateServerRequest{
249249
Zone: zone,
250250
Name: expandOrGenerateString(d.Get("name"), "srv"),
251-
Organization: scw.StringPtr(d.Get("organization_id").(string)),
251+
Organization: expandStringPtr(d.Get("organization_id").(string)),
252252
Image: image.ID,
253253
CommercialType: commercialType,
254254
EnableIPv6: d.Get("enable_ipv6").(bool),

scaleway/resource_instance_volume.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ func resourceScalewayInstanceVolumeCreate(d *schema.ResourceData, m interface{})
8181
Zone: zone,
8282
Name: expandOrGenerateString(d.Get("name"), "vol"),
8383
VolumeType: instance.VolumeVolumeType(d.Get("type").(string)),
84-
Organization: scw.StringPtr(d.Get("organization_id").(string)),
84+
Organization: expandStringPtr(d.Get("organization_id").(string)),
8585
}
8686

8787
if size, ok := d.GetOk("size_in_gb"); ok {

0 commit comments

Comments
 (0)