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

azurerm_storage_account - Ensure infrastructure_encryption_enabled property is included during update #26971

Merged
merged 1 commit into from
Aug 21, 2024
Merged
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
8 changes: 8 additions & 0 deletions internal/services/storage/storage_account_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -1730,6 +1730,14 @@ func resourceStorageAccountUpdate(d *pluginsdk.ResourceData, meta interface{}) e
if err != nil {
return fmt.Errorf("expanding `customer_managed_key`: %+v", err)
}

// When updating CMK the existing value for `RequireInfrastructureEncryption` gets overwritten which results in
// an error from the API so we set this back into encryption after it's been overwritten by this update
existingEnc := existing.Model.Properties.Encryption
if existingEnc != nil && existingEnc.RequireInfrastructureEncryption != nil {
encryption.RequireInfrastructureEncryption = existingEnc.RequireInfrastructureEncryption
}

props.Encryption = encryption
}
if d.HasChange("shared_access_key_enabled") {
Expand Down
Loading