DEV Community

Will Velida
Will Velida

Posted on

1

Sending Cosmos DB Diagnostic Logs to Log Analytics with Terraform

In this video, we cover Data sources in Terraform and how we can use them to reference resources defined either outside of Terraform or in other Terraform configuration files in our Terraform files.

We also talk about Diagnostic Logs in Azure are and how we can configure Diagnostic logs in our Azure Cosmos DB account to be sent to a Log Analytics workspace.

If you have any questions, comment below or reach out to me via Twitter: Twitter: https://twitter.com/willvelida

Resources:
Data Sources in Terraform: https://www.terraform.io/docs/language/data-sources/index.html
Log Analytics (Terraform Docs): https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/log_analytics_workspace#attributes-reference
Diagnostic Logs (Terraform Docs): https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/monitor_diagnostic_setting
Monitor Azure Cosmos DB data by using diagnostic settings in Azure: https://docs.microsoft.com/en-us/azure/cosmos-db/cosmosdb-monitor-resource-logs
GitHub code: https://github.com/willvelida/azurecosmosdb-terraform

Billboard image

Imagine monitoring that's actually built for developers

Join Vercel, CrowdStrike, and thousands of other teams that trust Checkly to streamline monitor creation and configuration with Monitoring as Code.

Start Monitoring

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Discover a treasure trove of wisdom within this insightful piece, highly respected in the nurturing DEV Community enviroment. Developers, whether novice or expert, are encouraged to participate and add to our shared knowledge basin.

A simple "thank you" can illuminate someone's day. Express your appreciation in the comments section!

On DEV, sharing ideas smoothens our journey and strengthens our community ties. Learn something useful? Offering a quick thanks to the author is deeply appreciated.

Okay