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

r\shared_image: Fix update issue related to unchanged eula #16868

Merged
merged 1 commit into from
May 20, 2022
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
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