Skip to content

A Terraform module to create multiple application insights within a resource group

License

Notifications You must be signed in to change notification settings

avinor/terraform-azurerm-application-insights

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Azure Application Insights

Module to create multiple Application Insights within one resource group. API keys are supported and is available from the output

Basic Usage

module "simple" {
  source = "github.com/avinor/terraform-azurerm-application-insight?ref=v2.0.0"

  name                = "simple"
  location            = "westeurope"
  resource_group_name = "simple-rg"
  workspace_id        = "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue"

  application_insights = [
    {
      name             = "app1"
      application_type = "web"
      api_keys         = [
        {
          name             = "my-api-key"
          read_permissions = ["api", "draft"]
        },
      ]
    },
  ]
}

See the example directory for more examples

Output from the module is as follows:

api_keys:
  app1-my-key:
    api_key: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    application_insights_id: /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/my-rg-rg/providers/microsoft.insights/components/app1
    id: /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourcegroups/my-rg/providers/microsoft.insights/components/app1/apikeys/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
ids:
  app1:
    app_id: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
    connection_string: InstrumentationKey=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx;IngestionEndpoint=https://westeurope-3.in.applicationinsights.azure.com/
    id: /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/my-rg/providers/microsoft.insights/components/app1
    instrumentation_key: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

Limitations

Changes on API keys are ignored as of av bug in the azurerm provider. To change permissions of the api keys new keys has to be created for now.

About

A Terraform module to create multiple application insights within a resource group

Resources

License

Stars

Watchers

Forks

Packages

No packages published