Skip to content

Commit

Permalink
Merge pull request #8904 from harshavmb/master
Browse files Browse the repository at this point in the history
Adding support for os_disk_image_size_gb to get the disk size of the image
  • Loading branch information
tombuildsstuff authored Oct 20, 2020
2 parents 8ca3994 + 74c80aa commit 9634e9a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ func dataSourceArmSharedImageVersion() *schema.Resource {
Computed: true,
},

"os_disk_image_size_gb": {
Type: schema.TypeInt,
Computed: true,
},

"target_region": {
Type: schema.TypeList,
Computed: true,
Expand Down Expand Up @@ -133,6 +138,12 @@ func dataSourceArmSharedImageVersionRead(d *schema.ResourceData, meta interface{
osDiskSnapShotID = *profile.OsDiskImage.Source.ID
}
d.Set("os_disk_snapshot_id", osDiskSnapShotID)

osDiskImageSize := 0
if profile.OsDiskImage != nil && profile.OsDiskImage.SizeInGB != nil {
osDiskImageSize = int(*profile.OsDiskImage.SizeInGB)
}
d.Set("os_disk_image_size_gb", osDiskImageSize)
}
}

Expand Down
2 changes: 2 additions & 0 deletions website/docs/d/shared_image_version.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ The following attributes are exported:

* `os_disk_snapshot_id` - The ID of the OS disk snapshot which was the source of this Shared Image Version.

* `os_disk_image_size_gb` - The size of the OS disk snapshot (in Gigabytes) which was the source of this Shared Image Version.

* `tags` - A mapping of tags assigned to the Shared Image.

---
Expand Down

0 comments on commit 9634e9a

Please sign in to comment.