Azure Lighthouse Definition

This page shows how to write Terraform for Lighthouse Definition and write them securely.

azurerm_lighthouse_definition (Terraform)

The Definition in Lighthouse can be configured in Terraform with the resource name azurerm_lighthouse_definition. The following sections describe 6 examples of how to use the resource and its parameters.

Example Usage from GitHub

main.tf#L83
resource "azurerm_lighthouse_definition" "developmentgroup" {
  name               = "delegated access Azurenative MSP"
  description        = "delegated access resource"
  managing_tenant_id = var.azadtenant_id
  scope              = var.tenant_subscription_scope
  dynamic "authorization" {
resources.tf#L7
resource "azurerm_lighthouse_definition" "lighthouse_def" {
  name               = var.name
  description        = var.description
  managing_tenant_id = var.managing_tenant_id
  scope              = var.managed_subscription_id

lighthouse.tf#L50
resource "azurerm_lighthouse_definition" "scope" {
  name               = var.definition_name
  description        = var.definition_description
  managing_tenant_id = data.azuread_client_config.managing.tenant_id

  # This seems to be needed, but this attribute isn't documentated (as of 2.51)
definition.tf#L6
resource "azurerm_lighthouse_definition" "definition" {
  name               = var.settings.name
  description        = var.settings.description
  managing_tenant_id = var.settings.managing_tenant_id
  scope = coalesce(
    try(format("/subscriptions/%s", var.resources["subscriptions"][try(var.settings.managed_subscription_id.lz_key, var.client_config.landingzone_key)][var.settings.managed_subscription_id.key].id), ""),
definition.tf#L6
resource "azurerm_lighthouse_definition" "definition" {
  name               = var.settings.name
  description        = var.settings.description
  managing_tenant_id = var.settings.managing_tenant_id
  scope = coalesce(
    try(format("/subscriptions/%s", var.resources["subscriptions"][try(var.settings.managed_subscription_id.lz_key, var.client_config.landingzone_key)][var.settings.managed_subscription_id.key].id), ""),
definition.tf#L6
resource "azurerm_lighthouse_definition" "definition" {
  name               = var.settings.name
  description        = var.settings.description
  managing_tenant_id = var.settings.managing_tenant_id
  scope = coalesce(
    try(format("/subscriptions/%s", var.resources["subscriptions"][try(var.settings.managed_subscription_id.lz_key, var.client_config.landingzone_key)][var.settings.managed_subscription_id.key].id), ""),

Review your Terraform file for Azure best practices

Shisho Cloud, our free checker to make sure your Terraform configuration follows best practices, is available (beta).

Parameters

Explanation in Terraform Registry

Manages a Lighthouse Definition.

Azure Resource Manager Example

Azure Resource Manager code does not have the related resource.

Frequently asked questions

What is Azure Lighthouse Definition?

Azure Lighthouse Definition is a resource for Lighthouse of Microsoft Azure. Settings can be wrote in Terraform.

Where can I find the example code for the Azure Lighthouse Definition?

For Terraform, the azurenative/Azure, claranet/terraform-azurerm-lighthouse and dvdvorle/terraform-templates source code examples are useful. See the Terraform Example section for further details.

security-icon

Automate config file reviews on your commits

Fix issues in your infrastructure as code with auto-generated patches.