@@ -13,6 +13,7 @@ import (
1313 "github.com/scaleway/terraform-provider-scaleway/v2/internal/locality/regional"
1414 "github.com/scaleway/terraform-provider-scaleway/v2/internal/meta"
1515 "github.com/scaleway/terraform-provider-scaleway/v2/internal/services/account"
16+ "github.com/scaleway/terraform-provider-scaleway/v2/internal/types"
1617)
1718
1819func ResourceKeyManagerKey () * schema.Resource {
@@ -92,7 +93,7 @@ func resourceKeyManagerKeyCreate(ctx context.Context, d *schema.ResourceData, m
9293 description := d .Get ("description" ).(string )
9394 unprotected := d .Get ("unprotected" ).(bool )
9495 origin := d .Get ("origin" ).(string )
95- tags := ExpandStringList (d .Get ("tags" ))
96+ tags := types . ExpandStrings (d .Get ("tags" ))
9697
9798 var usageBlock * key_manager.KeyUsage
9899
@@ -171,11 +172,11 @@ func resourceKeyManagerKeyRead(ctx context.Context, d *schema.ResourceData, m an
171172 _ = d .Set ("description" , key .Description )
172173 _ = d .Set ("tags" , key .Tags )
173174 _ = d .Set ("rotation_count" , int (key .RotationCount ))
174- _ = d .Set ("created_at" , TimeToRFC3339 (key .CreatedAt ))
175- _ = d .Set ("updated_at" , TimeToRFC3339 (key .UpdatedAt ))
175+ _ = d .Set ("created_at" , types . FlattenTime (key .CreatedAt ))
176+ _ = d .Set ("updated_at" , types . FlattenTime (key .UpdatedAt ))
176177 _ = d .Set ("protected" , key .Protected )
177178 _ = d .Set ("locked" , key .Locked )
178- _ = d .Set ("rotated_at" , TimeToRFC3339 (key .RotatedAt ))
179+ _ = d .Set ("rotated_at" , types . FlattenTime (key .RotatedAt ))
179180 _ = d .Set ("origin_read" , key .Origin .String ())
180181 _ = d .Set ("region_read" , key .Region .String ())
181182
@@ -189,7 +190,7 @@ func resourceKeyManagerKeyRead(ctx context.Context, d *schema.ResourceData, m an
189190 _ = d .Set ("rotation_policy" , []map [string ]any {
190191 {
191192 "rotation_period" : periodStr ,
192- "next_rotation_at" : TimeToRFC3339 (key .RotationPolicy .NextRotationAt ),
193+ "next_rotation_at" : types . FlattenTime (key .RotationPolicy .NextRotationAt ),
193194 },
194195 })
195196 }
@@ -219,7 +220,7 @@ func resourceKeyManagerKeyUpdate(ctx context.Context, d *schema.ResourceData, m
219220 }
220221
221222 if d .HasChange ("tags" ) {
222- tags := ExpandStringList (d .Get ("tags" ))
223+ tags := types . ExpandStrings (d .Get ("tags" ))
223224 updateReq .Tags = & tags
224225 }
225226
0 commit comments