0
0
Azurecloud~10 mins

Key Vault creation 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 an Azure Key Vault resource by setting the name property.

Azure
resource "azurerm_key_vault" "example" {
  location            = "eastus"
  resource_group_name = "example-rg"
  [1] = "example-vault"
}
Drag options to blanks, or click blank then click option'
Asku_name
Bresource_type
Cname
Dtenant_id
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'resource_type' instead of 'name' to set the vault name.
Confusing 'sku_name' with the vault name.
2fill in blank
medium

Complete the code to specify the SKU name for the Key Vault.

Azure
resource "azurerm_key_vault" "example" {
  name                = "example-vault"
  location            = "eastus"
  resource_group_name = "example-rg"
  sku_name            = [1]
}
Drag options to blanks, or click blank then click option'
A"premium"
B"standard"
C"basic"
D"enterprise"
Attempts:
3 left
💡 Hint
Common Mistakes
Using unsupported SKU names like 'basic' or 'enterprise'.
Forgetting to put the SKU name in quotes.
3fill in blank
hard

Fix the error in the access policy block to correctly assign tenant ID.

Azure
resource "azurerm_key_vault" "example" {
  name                = "example-vault"
  location            = "eastus"
  resource_group_name = "example-rg"
  sku_name            = "standard"

  access_policy {
    tenant_id = [1]
    object_id = "00000000-0000-0000-0000-000000000000"
    key_permissions = ["get", "list"]
  }
}
Drag options to blanks, or click blank then click option'
Avar.tenantId
BtenantId
C"tenantId"
Dtenant_id
Attempts:
3 left
💡 Hint
Common Mistakes
Using the tenant ID as a plain string instead of a variable.
Using an undefined variable name.
4fill in blank
hard

Fill both blanks to define the network ACLs to allow access only from a specific subnet.

Azure
resource "azurerm_key_vault" "example" {
  name                = "example-vault"
  location            = "eastus"
  resource_group_name = "example-rg"
  sku_name            = "standard"

  network_acls {
    default_action = [1]
    virtual_network_subnet_ids = [[2]]
  }
}
Drag options to blanks, or click blank then click option'
A"Deny"
B"Allow"
C"subnet-12345"
D"/subscriptions/0000/resourceGroups/rg/providers/Microsoft.Network/virtualNetworks/vnet/subnets/subnet1"
Attempts:
3 left
💡 Hint
Common Mistakes
Setting default_action to 'Allow' which opens access to all.
Using subnet names instead of full resource IDs.
5fill in blank
hard

Fill all three blanks to configure Key Vault with soft delete enabled, purge protection enabled, and a proper tenant ID.

Azure
resource "azurerm_key_vault" "example" {
  name                = "example-vault"
  location            = "eastus"
  resource_group_name = "example-rg"
  sku_name            = "standard"

  tenant_id           = [1]
  soft_delete_enabled = [2]
  purge_protection_enabled = [3]
}
Drag options to blanks, or click blank then click option'
Avar.tenantId
Btrue
Cfalse
D"tenantId"
Attempts:
3 left
💡 Hint
Common Mistakes
Using string literals instead of variable for tenant ID.
Setting soft delete or purge protection to false.