Hi !
A few days i tried to deploy azure lighthouse using terraform template, The first Error was that i have to add a scope to my definition, so i did it like that:
# Configure the Azure Provider
provider azurerm {
# whilst the `version` attribute is optional, we recommend pinning to a given version of the Provider
version = "2.0.0"
features {}
}
data "azurerm_subscription" "primary" {
}
data "azurerm_role_definition" "contributor" {
role_definition_id = "b24988ac-6180-42a0-ab88-20f7382dd24c"
}
resource "azurerm_lighthouse_definition" "example" {
name = "test"
scope = data.azurerm_subscription.primary.id
description = "This is a lighthouse definition created via Terraform"
managing_tenant_id = "yyyyyyyyy-yyyyyyyyyyy-yyyyyyyy-yyyyyyy"
authorization {
principal_id = "yyyyy-yyyyyy-yyyyyyyy-yyyyyyyy"
role_definition_id = data.azurerm_role_definition.contributor.role_definition_id
}
}
After adding the scope
no error appears following the execution of my terraform, but the deployment of lighthouse obviously did not work.
I would also like to specify that I had already done the test with exactly the same information using ARM (successful test) as on the microsoft documentation:
link to terraform tempalte :