Closed philipstreet closed 2 months ago
I have resolved my issue, as per the technique described by @matt-FFFFFF in his video (https://youtu.be/6OkdaPDphz4?si=Mgq9-Ml5WupKb4xc).
The actual code experiencing the issue differs from the original example, as I was passing the LAW ID into a local module that then created a collection of resources, including the diagnostic setting.
So, instead of;
module "common-001" {
source = "./modules/common"
environment = var.environment
application = var.application
location = var.primary_location
address_space_prefix = "10.1"
tags = local.tags
key_vault_role_assignments = local.common_role_assignments
log_analytics_workspace_id = resource_id = module.law.resource.id
}
I now do this;
module "common-001" {
source = "./modules/common"
environment = var.environment
application = var.application
location = var.primary_location
address_space_prefix = "10.1"
tags = local.tags
key_vault_role_assignments = local.common_role_assignments
log_analytics_workspace_id = {
resource_id = module.law.resource.id
}
}
Glad you found the video useful!!
Check for previous/existing GitHub issues
Issue Type?
I'm not sure
(Optional) Module Version
v0.1.4
(Optional) Correlation Id
No response
Description
I am trying to create a Virtual Network and Log Analytics workspace using their respective AVMs. I am trying to pass the ID of the LAW as part of the diagnostic settings configuration for the vnet but the Terraform Plan fails with the following error;
Example code:
Expected behaviour: The AVM module should respect the "(known after apply)" availability of values passed as inputs.
Or am I doing something wrong? Thanks