Skip to content

Commit

Permalink
r\shared_image: Fix update issue related to unchanged eula (#16868)
Browse files Browse the repository at this point in the history
  • Loading branch information
myc2h6o authored May 20, 2022
1 parent 56b9df6 commit a5dbd25
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion internal/services/compute/shared_image_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ func resourceSharedImage() *pluginsdk.Resource {
"eula": {
Type: pluginsdk.TypeString,
Optional: true,
ForceNew: true,
},

"purchase_plan": {
Expand Down Expand Up @@ -212,7 +213,6 @@ func resourceSharedImageCreateUpdate(d *pluginsdk.ResourceData, meta interface{}
Location: utils.String(azure.NormalizeLocation(d.Get("location").(string))),
GalleryImageProperties: &compute.GalleryImageProperties{
Description: utils.String(d.Get("description").(string)),
Eula: utils.String(d.Get("eula").(string)),
Identifier: expandGalleryImageIdentifier(d),
PrivacyStatementURI: utils.String(d.Get("privacy_statement_uri").(string)),
ReleaseNoteURI: utils.String(d.Get("release_note_uri").(string)),
Expand All @@ -224,6 +224,10 @@ func resourceSharedImageCreateUpdate(d *pluginsdk.ResourceData, meta interface{}
Tags: tags.Expand(d.Get("tags").(map[string]interface{})),
}

if v, ok := d.GetOk("eula"); ok {
image.GalleryImageProperties.Eula = utils.String(v.(string))
}

if d.Get("specialized").(bool) {
image.GalleryImageProperties.OsState = compute.OperatingSystemStateTypesSpecialized
} else {
Expand Down
2 changes: 1 addition & 1 deletion website/docs/r/shared_image.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ The following arguments are supported:

* `description` - (Optional) A description of this Shared Image.

* `eula` - (Optional) The End User Licence Agreement for the Shared Image.
* `eula` - (Optional) The End User Licence Agreement for the Shared Image. Changing this forces a new resource to be created.

* `specialized` - (Optional) Specifies that the Operating System used inside this Image has not been Generalized (for example, `sysprep` on Windows has not been run). Defaults to `false`. Changing this forces a new resource to be created.

Expand Down

0 comments on commit a5dbd25

Please sign in to comment.