Skip to content

[AVM Module Issue]: Terraform will always attempt to create a Logs definition on every apply with disabled logs configuration #187

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

Closed
1 task done
dave92082 opened this issue Apr 7, 2025 · 6 comments · May be fixed by #188
Labels
Language: Terraform 🌐 This is related to the Terraform IaC language Status: Fixed ✅ Auto label applied when issue fixed by merged PR Type: Bug 🐛 Something isn't working

Comments

@dave92082
Copy link
Contributor

Check for previous/existing GitHub issues

  • I have checked for previous/existing GitHub issues

Issue Type?

Bug

(Optional) Module Version

0.16.0

(Optional) Correlation Id

No response

Description

When defining a Web Application with logging configured to disabled, Terraform will report that it needs to change the logs configuration on every apply. While this has little to no technical impact, it incorrectly indicates that something is changing with the infrastructure on every apply which is undesirable.

The logging configuration provided:

logs = {  
  app_service_logs = {  
    detailed_error_messages = false  
    failed_request_tracing  = false  
    application_logs = {  
      file_system_level = {  
        default_level     = "Information"  
        file_system_level = "Off"  
      }  
    }  
    http_logs = {  
      file_system = {  
        retention_in_days = 7  
        retention_in_mb   = 35  
      }  
    }  
  }  
}

Results in the following plan during every apply even if nothing has changed:

# module.avm-res-web-site-example.azurerm_linux_web_app.this[0] will be updated in-place

~ resource "azurerm_linux_web_app" "this" {

	id = "/subscriptions/11111111-1111-1111-1111-111111111111/resourceGroups/rg-example-dev/providers/Microsoft.Web/sites/app-example-dev-example-nmyb"
	name = "app-example-dev-example-nmyb"
	tags = {
		"CreatedBy" = "example"
		"ManagedBy" = "Terraform"
	}
	# (26 unchanged attributes hidden)

	+ logs {
		+ detailed_error_messages = false
		+ failed_request_tracing = false
		+ application_logs {
			+ file_system_level = "Off"
		}
	}

	# (1 unchanged block hidden)
}

@dave92082 dave92082 added Language: Terraform 🌐 This is related to the Terraform IaC language Needs: Triage 🔍 Maintainers need to triage still labels Apr 7, 2025
@microsoft-github-policy-service microsoft-github-policy-service bot added the Type: Bug 🐛 Something isn't working label Apr 7, 2025
@donovm4
Copy link
Contributor

donovm4 commented Apr 7, 2025

Hey @dave92082 - I will look into this. Let me run some e2e tests locally to reproduce this and identify if there is a workaround we can provide 👍

@dsuarez-nextech
Copy link

Thank you @donovm4 , I have created a PR #188 to address the issue though it will be a breaking change.

@donovm4 donovm4 removed the Needs: Triage 🔍 Maintainers need to triage still label Apr 10, 2025
@donovm4
Copy link
Contributor

donovm4 commented Apr 10, 2025

Just an FYI, I will need to move the PR to target a release branch in case you receive any alerts.

cc: @dave92082 , @dsuarez-nextech

@donovm4 donovm4 added the Status: In PR 👉 This is when an issue is due to be fixed in an open PR label Apr 10, 2025
@donovm4
Copy link
Contributor

donovm4 commented Apr 15, 2025

Hello @dave92082 + @dsuarez-nextech :

We have found a way to implement a bug fix without causing a breaking change. I will create a new PR and mark you as a contributor on the next release.

@donovm4
Copy link
Contributor

donovm4 commented Apr 16, 2025

Please view release 0.16.3 as this functionality has been implemented without a breaking change with #191. logs is still a map(object) to prevent breaking changes. examples / logs shows configuration of logs in main a webapp as well as with deployment_slots

Marking a 'Fixed' but will leave open as waiting for feedback.

NOTE: adding @dave92082 as Contributor in release notes.

@donovm4 donovm4 added Status: Fixed ✅ Auto label applied when issue fixed by merged PR and removed Status: In PR 👉 This is when an issue is due to be fixed in an open PR labels Apr 16, 2025
@dsuarez-nextech
Copy link

Thank you! we will review next week

@donovm4 donovm4 closed this as completed May 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Language: Terraform 🌐 This is related to the Terraform IaC language Status: Fixed ✅ Auto label applied when issue fixed by merged PR Type: Bug 🐛 Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants