Skip to content

azurermApplicationInsightsWorkbookTemplate

Manages an Application Insights Workbook Template.

Example Usage

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as azurerm from "./.gen/providers/azurerm";
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: azurerm.
For a more precise conversion please use the --provider flag in convert.*/
const azurermResourceGroupExample = new azurerm.resourceGroup.ResourceGroup(
  this,
  "example",
  {
    location: "West Europe",
    name: "example-resources",
  }
);
const azurermApplicationInsightsWorkbookTemplateExample =
  new azurerm.applicationInsightsWorkbookTemplate.ApplicationInsightsWorkbookTemplate(
    this,
    "example_1",
    {
      author: "test author",
      galleries: [
        {
          category: "workbook",
          name: "test",
          order: 100,
          resource_type: "microsoft.insights/components",
          type: "tsg",
        },
      ],
      localized:
        '${jsonencode({\n    "ar" : [\n      {\n        "galleries" : [\n          {\n            "name" : "test",\n            "category" : "Failures",\n            "type" : "tsg",\n            "resourceType" : "microsoft.insights/components",\n            "order" : 100\n          }\n        ],\n        "templateData" : {\n          "version" : "Notebook/1.0",\n          "items" : [\n            {\n              "type" : 1,\n              "content" : {\n                "json" : "## New workbook\\n---\\n\\nWelcome to your new workbook."\n              },\n              "name" : "text - 2"\n            }\n          ],\n          "styleSettings" : {},\n          "$schema" : "https://github.com/Microsoft/Application-Insights-Workbooks/blob/master/schema/workbook.json"\n        },\n      }\n    ]\n  })}',
      location: "West Europe",
      name: "example-aiwt",
      priority: 1,
      resource_group_name: azurermResourceGroupExample.name,
      tags: {
        key: "value",
      },
      template_data:
        '${jsonencode({\n    "version" : "Notebook/1.0",\n    "items" : [\n      {\n        "type" : 1,\n        "content" : {\n          "json" : "## New workbook\\n---\\n\\nWelcome to your new workbook."\n        },\n        "name" : "text - 2"\n      }\n    ],\n    "styleSettings" : {},\n    "$schema" : "https://github.com/Microsoft/Application-Insights-Workbooks/blob/master/schema/workbook.json"\n  })}',
    }
  );
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermApplicationInsightsWorkbookTemplateExample.overrideLogicalId("example");

Arguments Reference

The following arguments are supported:

  • name - (Required) Specifies the name which should be used for this Application Insights Workbook Template. Changing this forces a new Application Insights Workbook Template to be created.

  • resourceGroupName - (Required) Specifies the name of the Resource Group where the Application Insights Workbook Template should exist. Changing this forces a new Application Insights Workbook Template to be created.

  • galleries - (Required) A galleries block as defined below.

  • location - (Required) Specifies the Azure Region where the Application Insights Workbook Template should exist. Changing this forces a new Application Insights Workbook Template to be created.

  • templateData - (Required) Valid JSON object containing workbook template payload.

  • author - (Optional) Information about the author of the workbook template.

  • localized - (Optional) Key value pairs of localized gallery. Each key is the locale code of languages supported by the Azure portal.

  • priority - (Optional) Priority of the template. Determines which template to open when a workbook gallery is opened in viewer mode. Defaults to 0.

  • tags - (Optional) A mapping of tags which should be assigned to the Application Insights Workbook Template.


A galleries block supports the following:

  • name - (Required) Name of the workbook template in the gallery.

  • category - (Required) Category for the gallery.

  • order - (Optional) Order of the template within the gallery. Defaults to 0.

  • resourceType - (Optional) Azure resource type supported by the gallery. Defaults to azureMonitor.

  • type - (Optional) Type of workbook supported by the workbook template. Defaults to workbook.

\~> Note: See documentation for more information of resourceType and type.

Attributes Reference

In addition to the Arguments listed above - the following Attributes are exported:

  • id - The ID of the Application Insights Workbook Template.

Timeouts

The timeouts block allows you to specify timeouts for certain actions:

  • create - (Defaults to 30 minutes) Used when creating the Application Insights Workbook Template.
  • read - (Defaults to 5 minutes) Used when retrieving the Application Insights Workbook Template.
  • update - (Defaults to 30 minutes) Used when updating the Application Insights Workbook Template.
  • delete - (Defaults to 30 minutes) Used when deleting the Application Insights Workbook Template.

Import

Application Insights Workbook Template can be imported using the resourceId, e.g.

terraform import azurerm_application_insights_workbook_template.example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup1/providers/Microsoft.Insights/workbookTemplates/resource1