@@ -214,6 +214,18 @@ In order to create an image, you must provide the full or partial URL of one of
214214* The rawDisk.source URL
215215* The sourceDisk URL` ,
216216 },
217+ "storage_locations" : {
218+ Type : schema .TypeList ,
219+ Computed : true ,
220+ Optional : true ,
221+ ForceNew : true ,
222+ Description : `Cloud Storage bucket storage location of the image
223+ (regional or multi-regional).
224+ Reference link: https://cloud.google.com/compute/docs/reference/rest/v1/images` ,
225+ Elem : & schema.Schema {
226+ Type : schema .TypeString ,
227+ },
228+ },
217229 "archive_size_bytes" : {
218230 Type : schema .TypeInt ,
219231 Computed : true ,
@@ -274,6 +286,12 @@ func resourceComputeImageCreate(d *schema.ResourceData, meta interface{}) error
274286 } else if v , ok := d .GetOkExists ("description" ); ! tpgresource .IsEmptyValue (reflect .ValueOf (descriptionProp )) && (ok || ! reflect .DeepEqual (v , descriptionProp )) {
275287 obj ["description" ] = descriptionProp
276288 }
289+ storageLocationsProp , err := expandComputeImageStorageLocations (d .Get ("storage_locations" ), d , config )
290+ if err != nil {
291+ return err
292+ } else if v , ok := d .GetOkExists ("storage_locations" ); ! tpgresource .IsEmptyValue (reflect .ValueOf (storageLocationsProp )) && (ok || ! reflect .DeepEqual (v , storageLocationsProp )) {
293+ obj ["storageLocations" ] = storageLocationsProp
294+ }
277295 diskSizeGbProp , err := expandComputeImageDiskSizeGb (d .Get ("disk_size_gb" ), d , config )
278296 if err != nil {
279297 return err
@@ -436,6 +454,9 @@ func resourceComputeImageRead(d *schema.ResourceData, meta interface{}) error {
436454 if err := d .Set ("description" , flattenComputeImageDescription (res ["description" ], d , config )); err != nil {
437455 return fmt .Errorf ("Error reading Image: %s" , err )
438456 }
457+ if err := d .Set ("storage_locations" , flattenComputeImageStorageLocations (res ["storageLocations" ], d , config )); err != nil {
458+ return fmt .Errorf ("Error reading Image: %s" , err )
459+ }
439460 if err := d .Set ("disk_size_gb" , flattenComputeImageDiskSizeGb (res ["diskSizeGb" ], d , config )); err != nil {
440461 return fmt .Errorf ("Error reading Image: %s" , err )
441462 }
@@ -629,6 +650,10 @@ func flattenComputeImageDescription(v interface{}, d *schema.ResourceData, confi
629650 return v
630651}
631652
653+ func flattenComputeImageStorageLocations (v interface {}, d * schema.ResourceData , config * transport_tpg.Config ) interface {} {
654+ return v
655+ }
656+
632657func flattenComputeImageDiskSizeGb (v interface {}, d * schema.ResourceData , config * transport_tpg.Config ) interface {} {
633658 // Handles the string fixed64 format
634659 if strVal , ok := v .(string ); ok {
@@ -743,6 +768,10 @@ func expandComputeImageDescription(v interface{}, d tpgresource.TerraformResourc
743768 return v , nil
744769}
745770
771+ func expandComputeImageStorageLocations (v interface {}, d tpgresource.TerraformResourceData , config * transport_tpg.Config ) (interface {}, error ) {
772+ return v , nil
773+ }
774+
746775func expandComputeImageDiskSizeGb (v interface {}, d tpgresource.TerraformResourceData , config * transport_tpg.Config ) (interface {}, error ) {
747776 return v , nil
748777}
0 commit comments