exec.azurerm.log_analytics.workspace

Azure Resource Manager (ARM) Log Analytics Workspace Execution Module

New in version 2.0.0.

Changed in version 4.0.0.

maintainer:

<devops@eitr.tech>

configuration:

This module requires Azure Resource Manager credentials to be passed as keyword arguments to every function or via acct in order to work properly.

Required provider parameters:

if using username and password:
  • subscription_id
  • username
  • password
if using a service principal:
  • subscription_id
  • tenant
  • client_id
  • secret

Optional provider parameters:

cloud_environment: Used to point the cloud driver to different API endpoints, such as Azure GovCloud. Possible values:

  • AZURE_PUBLIC_CLOUD (default)
  • AZURE_CHINA_CLOUD
  • AZURE_US_GOV_CLOUD
  • AZURE_GERMAN_CLOUD
idem_azurerm.exec.azurerm.log_analytics.workspace.create_or_update(hub, ctx, name, resource_group, location, sku=None, retention=None, workspace_capping=None, ingestion_public_network_access=None, query_public_network_access=None, capacity_reservation_level=None, **kwargs)

New in version 2.0.0.

Changed in version 4.0.0.

Create or update a workspace.

Parameters:
  • name – The name of the workspace. The name is case insensitive.
  • resource_group – The resource group name of the workspace.
  • location – The resource location.
  • sku – The name of the SKU. Possible values include: “Free”, “Standard”, “Premium”, “PerNode”, “PerGB2018”, “Standalone”, and “CapacityReservation”.
  • retention – The workspace data retention period in days. -1 means Unlimited retention for the Unlimited Sku. 730 days is the maximum allowed for all other Skus.
  • workspace_capping – A float representing the daily volume cap in GB for ingestion. -1 means unlimited.
  • ingestion_public_network_access – The network access type for accessing Log Analytics ingestion. Possible values include: “Enabled” and “Disabled”. Defaults to “Enabled”.
  • query_public_network_access – The network access type for accessing Log Analytics query. Possible values include: “Enabled” and “Disabled”. Defaults to “Enabled”.
  • capacity_reservation_level – An integer representing the capacity reservation level for this workspace. This parameter is only necessary when “CapacityReservation” is passed as the value of the sku parameter.

CLI Example:

azurerm.log_analytics.workspace.create_or_update test_name test_group test_location
idem_azurerm.exec.azurerm.log_analytics.workspace.delete(hub, ctx, name, resource_group, force=None, **kwargs)

New in version 2.0.0.

Changed in version 4.0.0.

Deletes a workspace. To recover the workspace, create it again with the same name, in the same subscription, resource group and location. The name is kept for 14 days and cannot be used for another workspace. To remove the workspace completely and release the name, use the force flag.

Parameters:
  • name – The name of the workspace.
  • resource_group – The resource group name of the workspace.
  • force – An optional boolean flag that specifies whether the workspace should be deleted without the option of recovery. A workspace that was deleted with this flag set as True cannot be recovered.

CLI Example:

azurerm.log_analytics.workspace.delete test_name test_group
idem_azurerm.exec.azurerm.log_analytics.workspace.get(hub, ctx, name, resource_group, **kwargs)

New in version 2.0.0.

Gets a workspace instance.

Parameters:
  • name – The name of the workspace.
  • resource_group – The resource group name of the workspace.

CLI Example:

azurerm.log_analytics.workspace.get test_name test_group
idem_azurerm.exec.azurerm.log_analytics.workspace.list_(hub, ctx, resource_group=None, **kwargs)

New in version 2.0.0.

Changed in version 4.0.0.

Gets the workspaces in a subscription.

Parameters:resource_group – The name of the resource group to limit the results.

CLI Example:

azurerm.log_analytics.workspace.list