From b7642d6ca71868c42e02a271ad81ba3ba880caf3 Mon Sep 17 00:00:00 2001 From: Jenna Goldstrich Date: Thu, 22 Aug 2024 15:24:23 -0700 Subject: [PATCH] Fix deprecated replicated_regions not using global replica count for base region (#438) --- builder/azure/arm/builder.go | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/builder/azure/arm/builder.go b/builder/azure/arm/builder.go index 93d06f98..836a0ab7 100644 --- a/builder/azure/arm/builder.go +++ b/builder/azure/arm/builder.go @@ -261,9 +261,16 @@ func (b *Builder) Run(ctx context.Context, ui packersdk.Ui, hook packersdk.Hook) for _, region := range b.config.SharedGalleryDestination.SigDestinationReplicationRegions { region := normalizeAzureRegion(region) if strings.EqualFold(region, buildLocation) { - // backwards compatibility DiskEncryptionSetId was set on the global config not on the target region. - // Users using target_region blocks are responsible for setting the DES within the block - normalizedRegions = append(normalizedRegions, TargetRegion{Name: region, DiskEncryptionSetId: b.config.DiskEncryptionSetId}) + normalizedRegions = append( + normalizedRegions, TargetRegion{ + Name: region, + // backwards compatibility DiskEncryptionSetId was set on the global config not on the target region. + // Users using target_region blocks are responsible for setting the DES within the block + DiskEncryptionSetId: b.config.DiskEncryptionSetId, + + ReplicaCount: b.config.SharedGalleryImageVersionReplicaCount, + }, + ) foundMandatoryReplicationRegion = true continue }