0
0
Azurecloud~10 mins

Log Analytics workspace in Azure - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to create a Log Analytics workspace with a specified name.

Azure
resource "azurerm_log_analytics_workspace" "example" {
  name                = [1]
  location            = "eastus"
  resource_group_name = "example-resources"
  sku                 = "PerGB2018"
  retention_in_days   = 30
}
Drag options to blanks, or click blank then click option'
A"workspace1"
B"example-law"
C"log-workspace"
D"analytics-log"
Attempts:
3 left
💡 Hint
Common Mistakes
Forgetting to put the name in quotes.
Using an invalid resource name format.
2fill in blank
medium

Complete the code to set the retention period of the Log Analytics workspace to 90 days.

Azure
resource "azurerm_log_analytics_workspace" "example" {
  name                = "example-law"
  location            = "eastus"
  resource_group_name = "example-resources"
  sku                 = "PerGB2018"
  retention_in_days   = [1]
}
Drag options to blanks, or click blank then click option'
A365
B30
C60
D90
Attempts:
3 left
💡 Hint
Common Mistakes
Using a string instead of a number.
Choosing a retention period that is too short or too long for the requirement.
3fill in blank
hard

Fix the error in the code by selecting the correct SKU for the Log Analytics workspace.

Azure
resource "azurerm_log_analytics_workspace" "example" {
  name                = "example-law"
  location            = "eastus"
  resource_group_name = "example-resources"
  sku                 = [1]
  retention_in_days   = 30
}
Drag options to blanks, or click blank then click option'
A"PerGB2018"
B"Standard"
C"Free"
D"Basic"
Attempts:
3 left
💡 Hint
Common Mistakes
Using unsupported SKU names like "Free" or "Basic".
Forgetting to put the SKU value in quotes.
4fill in blank
hard

Fill both blanks to create a Log Analytics workspace with a name and location.

Azure
resource "azurerm_log_analytics_workspace" "example" {
  name                = [1]
  location            = [2]
  resource_group_name = "example-resources"
  sku                 = "PerGB2018"
  retention_in_days   = 30
}
Drag options to blanks, or click blank then click option'
A"my-law"
B"westus2"
C"eastus"
D"log-analytics"
Attempts:
3 left
💡 Hint
Common Mistakes
Swapping name and location values.
Using invalid region names.
5fill in blank
hard

Fill all three blanks to define a Log Analytics workspace with a name, retention period, and SKU.

Azure
resource "azurerm_log_analytics_workspace" "example" {
  name                = [1]
  location            = "eastus"
  resource_group_name = "example-resources"
  sku                 = [2]
  retention_in_days   = [3]
}
Drag options to blanks, or click blank then click option'
A"prod-law"
B"PerGB2018"
C90
D30
Attempts:
3 left
💡 Hint
Common Mistakes
Putting retention days in quotes.
Using an invalid SKU string.