File tree Expand file tree Collapse file tree 2 files changed +23
-1
lines changed
Expand file tree Collapse file tree 2 files changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -93,3 +93,24 @@ module "inherit_resource_group_tags_modify" {
9393 policy_mode = " Indexed"
9494 management_group_id = data. azurerm_management_group . org . id
9595}
96+
97+ # #################
98+ # object properties at runtime:
99+ # #################
100+ locals {
101+ policy_file = jsondecode (file (" ${ path . module } /../policies/Automation/onboard_to_automation_dsc_linux.json" ))
102+ }
103+
104+ module "parameterised_test" {
105+ source = " ..//modules/definition"
106+ policy_name = " Custom Name"
107+ display_name = " Custom Display Name"
108+ policy_description = " Custom Description"
109+ policy_category = " Custom Category"
110+ policy_version = " Custom Version"
111+ management_group_id = data. azurerm_management_group . org . id
112+
113+ policy_rule = (local. policy_file ). properties . policyRule
114+ policy_parameters = (local. policy_file ). properties . parameters
115+ policy_metadata = (local. policy_file ). properties . metadata
116+ }
Original file line number Diff line number Diff line change @@ -91,7 +91,8 @@ locals {
9191 file (" ${ path . cwd } /policies/${ title (var. policy_category )} /${ var . policy_name } .json" ),
9292 file (" ${ path . root } /policies/${ title (var. policy_category )} /${ var . policy_name } .json" ),
9393 file (" ${ path . root } /../policies/${ title (var. policy_category )} /${ var . policy_name } .json" ),
94- file (" ${ path . module } /../../policies/${ title (var. policy_category )} /${ var . policy_name } .json" )
94+ file (" ${ path . module } /../../policies/${ title (var. policy_category )} /${ var . policy_name } .json" ),
95+ " {}" # return empty object if no policy is found
9596 )))
9697
9798 # fallbacks
You can’t perform that action at this time.
0 commit comments