File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -87,6 +87,10 @@ module "cbr_account_level" {
8787 " enforcement_mode" = " enabled"
8888 " global_deny" = false # mandatory to set 'global_deny = false' when no scope is defined
8989 }
90+ " databases-for-postgresql" = {
91+ " enforcement_mode" = " enabled"
92+ " target_rg" = module.resource_group.resource_group_id
93+ }
9094 " messagehub" = {
9195 # As the service is scoped, a new global rule will also get created
9296 " enforcement_mode" = " enabled"
Original file line number Diff line number Diff line change @@ -448,7 +448,17 @@ module "global_deny_cbr_rule" {
448448 rule_description = try (each. value . description , null ) != null ? each. value . description : " ${ var . prefix } -${ each . key } -global-deny-rule"
449449 enforcement_mode = each. value . enforcement_mode
450450 rule_contexts = []
451-
451+ operations = (length (lookup (local. operations_apitype_val , each. key , [])) > 0 ) ? [{
452+ api_types = [
453+ # lookup the map for the target service name, if empty then pass default value
454+ for apitype in lookup (local. operations_apitype_val , each. key , []) : {
455+ api_type_id = apitype
456+ }]
457+ }] : [{
458+ api_types = [{
459+ api_type_id = " crn:v1:bluemix:public:context-based-restrictions::::api-type:"
460+ }]
461+ }]
452462 resources = [{
453463 tags = try (each. value . tags , null ) != null ? [for tag in each . value . tags : {
454464 name = split (" :" , tag)[0 ]
You can’t perform that action at this time.
0 commit comments