Closed mikeilunga closed 2 years ago
Hey @mikeilunga,
Have you seen and followed: https://github.com/Azure/terraform-azurerm-caf-enterprise-scale/wiki/%5BExamples%5D-Deploy-Custom-Landing-Zone-Archetypes
The archetypes are not pulled into the repo, you must define custom lib artefacts and reference them, if you wish, in the module variables.
e.g. creating a policy assignment https://github.com/Azure/terraform-azurerm-caf-enterprise-scale/wiki/%5BExamples%5D-Assign-a-Built-in-Policy
Let us know
@mikeilunga I don't believe anything in the module has changed to directly effect this behaviour but we do iterate the minimum supported Terraform version. It might be that this impacts how relative paths are handled.
Please can you try prefixing your path with ${path.root}
as per the following example from our test module and let us know if that helps?
${path.root}
@krowlandson - I've just tested with the above prefix and this has not worked I'm afraid.
@mikeilunga are you able to share your code from management_groups.tf
and enterprisescale-mg.tfvars
please?
Given the above suggestion didn't work, I've re-read your issue and am unclear on what exactly isn't working.
What do you have in your lib
folder, and what behaviour are you expecting? Also exactly how has this changed since upgrading version?
Hey @mikeilunga,
Have you seen and followed: https://github.com/Azure/terraform-azurerm-caf-enterprise-scale/wiki/%5BExamples%5D-Deploy-Custom-Landing-Zone-Archetypes
The archetypes are not pulled into the repo, you must define custom lib artefacts and reference them, if you wish, in the module variables.
e.g. creating a policy assignment https://github.com/Azure/terraform-azurerm-caf-enterprise-scale/wiki/%5BExamples%5D-Assign-a-Built-in-Policy
Let us know
Hey @mikeilunga,
Have you seen and followed: https://github.com/Azure/terraform-azurerm-caf-enterprise-scale/wiki/%5BExamples%5D-Deploy-Custom-Landing-Zone-Archetypes
The archetypes are not pulled into the repo, you must define custom lib artefacts and reference them, if you wish, in the module variables.
e.g. creating a policy assignment https://github.com/Azure/terraform-azurerm-caf-enterprise-scale/wiki/%5BExamples%5D-Assign-a-Built-in-Policy
Let us know
@jtracey93 - thanks for this. This did point me in the right direction with the path route variable suggested by @krowlandson.
All good now :-)
@mikeilunga are you able to share your code from
management_groups.tf
andenterprisescale-mg.tfvars
please?Given the above suggestion didn't work, I've re-read your issue and am unclear on what exactly isn't working.
What do you have in your
lib
folder, and what behaviour are you expecting? Also exactly how has this changed since upgrading version?
I was following the custom landing zone approach, but the custom library variable. But this has now worked after copying the entire archetypes directory and using the suggested variable.
I was following the custom landing zone approach, but the custom library variable. But this has now worked after copying the entire archetypes directory and using the suggested variable.
Thank you for the updates @mikeilunga.
It would still be great to better understand your implementation here as the custom library is complementary to the one within the module so you shouldn't have to copy one into the other.
Trigger ADO Sync
Community Note
Versions
terraform: v1.1.3
azure provider: v3.24.0
module: 2.4.0
Description
When deploying policies and management groups to our custom landing zones, we specify a "custom library path" folder location and the respective policies are configured as expected. However, the archetype artefacts are not placed in the specified path and can only be managed and maintained in the .terraform directory.
Describe the bug
The following variable "library_path" should allow me to choose a custom library folder, this will help with the management of code as we are using Azure DevOps repo to store this code so ideally, we do not want to store the file in a temp directory. Moreover, we were able to complete these steps in a previous iteration of the code version "1.1.2"
Steps to Reproduce
add variable variable "library_path" { type = string description = "Achetype library path" default = ""}
add value in tfvars library_path = "/modules/archetypes/lib"
Create/ensure the respective folder directories are in place
Run terraform apply and once resources are deployed.
Check if the archetypes are in the custom directory.
Screenshots
Additional context
Screenshot 1 - example of custom library path not working Screenshot 2 - example of custom library path working in the previous version 1.1.2