Skip to content

Fixing assignment_effect not honored if no assignment_parameters set#124

Merged
gettek merged 3 commits intogettek:mainfrom
Oechiih:fix/assignment-effect-no-parameters
Nov 15, 2025
Merged

Fixing assignment_effect not honored if no assignment_parameters set#124
gettek merged 3 commits intogettek:mainfrom
Oechiih:fix/assignment-effect-no-parameters

Conversation

@Oechiih
Copy link
Copy Markdown
Contributor

@Oechiih Oechiih commented Sep 5, 2025

Pull Request Template

Description

The "assignment_effect" parameter has no effect if no "assignment_parameters are set". The condition in /def_assignment/variables.tf returns null if "local.parameter_values" is null which it is if "var.assignment_parameters" is null.

This was sort of talked about in #59. At least the condition was introduced in the fix for that issue.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

  • Assigned policies with no parameters but with effect
  • Assigned policies with parameters and with effect
  • Assigned policies without parameters and without effect

Test Configuration:

  • Module Version: 2.8.3
  • Terraform Version: 1.12.2
  • AzureRM Provider Version: 4.12

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have checked my code and corrected any misspellings

@gettek
Copy link
Copy Markdown
Owner

gettek commented Nov 12, 2025

Hi @Oechiih, thanks for raising this!

Should we also update the logic in the set_assignment module?

parameters = local.parameter_values != null ? var.assignment_effect != null ? jsonencode(merge(local.parameter_values, { effect = { value = var.assignment_effect } })) : jsonencode(local.parameter_values) : null

@gettek gettek merged commit 16b2df7 into gettek:main Nov 15, 2025
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants