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

Implement Data Collection Rule for Container Insights #623

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

zioproto
Copy link
Collaborator

Describe your changes

Implement Data Collection Rule for Container Insights. This completes the work started in PR #446

Issue number

#607

Checklist before requesting a review

  • The pr title can be used to describe what this pr did in CHANGELOG.md file
  • I have executed pre-commit on my machine
  • I have passed pr-check on my machine

@zioproto
Copy link
Collaborator Author

@lonegunmanb this PR was implemented looking at the documentation example available here:

https://github.com/microsoft/Docker-Provider/tree/ci_prod/scripts/onboarding/aks/onboarding-msi-terraform-syslog

Cc: @ganga1980 and @wanlonghenry in case they have review comments. Thanks

Copy link
Member

@lonegunmanb lonegunmanb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zioproto We've got the following error:

TestExamplesForV4/application_gateway_ingress_v4 2024-12-20T16:01:45Z retry.go:99: Returning due to fatal error: FatalError{Underlying: error while running command: exit status 1; ╷
│ Error: Attempt to get attribute from null value
│ 
│   on ../../v4/log_analytics.tf line 86, in locals:
│   86:   dcr_location = coalesce(local.log_analytics_workspace.location, try(data.azurerm_log_analytics_workspace.main[0].location, null))
│     ├────────────────
│     │ local.log_analytics_workspace is null
│ 
│ This value is null, so it does not have any attributes.
╵}
    apply.go:34: 
        	Error Trace:	/src/test/vendor/github.com/gruntwork-io/terratest/modules/terraform/apply.go:34
        	            				/src/test/vendor/github.com/Azure/terraform-module-test-helper/e2etest.go:107
        	            				/src/test/vendor/github.com/Azure/terraform-module-test-helper/e2etest.go:87
        	            				/src/test/vendor/github.com/Azure/terraform-module-test-helper/e2etest.go:55
        	            				/src/test/e2e/terraform_aks_test.go:211
        	Error:      	Received unexpected error:
        	            	FatalError{Underlying: error while running command: exit status 1; ╷
        	            	│ Error: Attempt to get attribute from null value
        	            	│ 
        	            	│   on ../../v4/log_analytics.tf line 86, in locals:
        	            	│   86:   dcr_location = coalesce(local.log_analytics_workspace.location, try(data.azurerm_log_analytics_workspace.main[0].location, null))
        	            	│     ├────────────────
        	            	│     │ local.log_analytics_workspace is null
        	            	│ 
        	            	│ This value is null, so it does not have any attributes.
        	            	╵}
        	Test:       	TestExamplesForV4/application_gateway_ingress_v4

Need further investigation.

@@ -81,3 +81,65 @@ resource "azurerm_log_analytics_solution" "main" {
publisher = "Microsoft"
}
}

locals {
dcr_location = coalesce(local.log_analytics_workspace.location, try(data.azurerm_log_analytics_workspace.main[0].location, null))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we try coalesce(try(local.log_analytics_workspace.location, null), try(data.azurerm_log_analytics_workspace.main[0].location, null)) here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

2 participants