Skip to content

Commit

Permalink
fix(azure VM galleries) do not specify tags to avoid hashicorp/terraf…
Browse files Browse the repository at this point in the history
…orm-provider-azurerm#16792

Signed-off-by: Damien Duportal <[email protected]>
  • Loading branch information
dduportal committed May 14, 2022
1 parent 7311f8f commit 088d2b0
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions packer-resources.tf
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,21 @@ resource "azurerm_shared_image" "jenkins_agent_images" {
specialized = false
trusted_launch_enabled = false

lifecycle {
ignore_changes = [
eula, accelerated_network_support_enabled
]
}

identifier {
publisher = format("jenkins-agent-%s", split("_", each.value)[1])
offer = format("jenkins-agent-%s", split("_", each.value)[1])
sku = format("jenkins-agent-%s", split("_", each.value)[1])
}

timeouts {}

tags = {
scope = "terraform-managed"
}
## No tags otherwise there is the following error when applying:
# creating/updating Shared Image: (Image Name "jenkins-agent-ubuntu-20.04" / Gallery Name "prod_packer_images" / Resource Group "prod-packer-images"): compute.GalleryImagesClient#CreateOrUpdate: Failure sending request: StatusCode=0 -- Original Error: autorest/azure: Service returned an error. Status=<nil> Code="PropertyChangeNotAllowed" Message="Changing property 'galleryImage.properties.eula' is not allowed." Target="galleryImage.properties.eula"
# tags = {
# scope = "terraform-managed"
# }
}

0 comments on commit 088d2b0

Please sign in to comment.