Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding support for os_disk_image_size_gb to get the disk size of the image #8904

Merged
merged 4 commits into from
Oct 20, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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