azurerm_log_analytics_workspace
Manages a Log Analytics (formally Operational Insights) Workspace.
Example Usage
resource "azurerm_resource_group" "test" { name = "acctestRG-01" location = "East US" } resource "azurerm_log_analytics_workspace" "test" { name = "acctest-01" location = "${azurerm_resource_group.test.location}" resource_group_name = "${azurerm_resource_group.test.name}" sku = "Standard" retention_in_days = 30 }
Argument Reference
The following arguments are supported:
-
name
- (Required) Specifies the name of the Log Analytics Workspace. Workspace name should include 4-63 letters, digits or '-'. The '-' shouldn't be the first or the last symbol. Changing this forces a new resource to be created. -
resource_group_name
- (Required) The name of the resource group in which the Log Analytics workspace is created. Changing this forces a new resource to be created. -
location
- (Required) Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created. -
sku
- (Required) Specifies the Sku of the Log Analytics Workspace. Possible values areFree
,PerNode
,Premium
,Standard
,Standalone
,Unlimited
, andPerGB2018
(new Sku as of2018-04-03
).
NOTE: A new pricing model took effect on
2018-04-03
, which requires the SKUPerGB2018
. If you're provisioned resources before this date you have the option of remaining with the previous Pricing SKU and using the other SKU's defined above. More information about the Pricing SKU's is available at the following URI.
-
retention_in_days
- (Optional) The workspace data retention in days. Possible values range between 30 and 730. -
tags
- (Optional) A mapping of tags to assign to the resource.
Attributes Reference
The following attributes are exported:
-
id
- The Log Analytics Workspace ID. -
primary_shared_key
- The Primary shared key for the Log Analytics Workspace. -
secondary_shared_key
- The Secondary shared key for the Log Analytics Workspace. -
workspace_id
- The Workspace (or Customer) ID for the Log Analytics Workspace. -
portal_url
- The Portal URL for the Log Analytics Workspace.
Import
Log Analytics Workspaces can be imported using the resource id
, e.g.
terraform import azurerm_log_analytics_workspace.workspace1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.OperationalInsights/workspaces/workspace1
© 2018 HashiCorpLicensed under the MPL 2.0 License.
https://www.terraform.io/docs/providers/azurerm/r/log_analytics_workspace.html