Skip to content
This repository has been archived by the owner on Jul 26, 2024. It is now read-only.

[Fork Deleted] Replaced by https://github.com/Azure/caf-terraform-landingzones/pull/448 #402

Closed
wants to merge 2 commits into from

Conversation

nusrath432
Copy link

@nusrath432 nusrath432 commented Jul 25, 2022

... within the merge function

Issue-id: 403

PR Checklist


  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • My code follows the code style of this project.
  • I ran lint checks locally prior to submission.
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?

Description

When defining global_settings block for a given landingzone, the current landingzone should take precedence over global_settings defined in lower/other current landingzones. Also, the global_settings should only be imported when global_settings_key is defined. Since a merge function is used, the order of items in the map are important.

  • when reading global_settings the current landingzone global_settings block should be given preference. Since a merge function is used, the order of items in the map are important.
  • global_settings from reference tfstate files should only be included if global_settings_key = is defined.
  • hence, reading global_settings from first tfstate is removed.
    try(data.terraform_remote_state.remote[keys(var.landingzone.tfstates)[0]].outputs.global_settings, null),

Does this introduce a breaking change

  • [X ] YES [Potentially]
  • NO

Testing

Create a landingzone with global_settings [passthrough = true;]
Create another landingzone with global_settings [passthrough = false; prefix=xyz]
Now withing the landingzone.tfvars, reference the 1st landingzone within the tfstate block.

@nusrath432
Copy link
Author

@arnaudlh @LaurentLesle - please review and test. Thanks

@nusrath432 nusrath432 closed this Jul 25, 2022
@nusrath432 nusrath432 reopened this Jul 25, 2022
…_settings within the merge function

- when reading global_settings the current landingzone global_settings
block should be given preference. Since a merge function is used, the
order of items in the map are important.
- global_settings from reference tfstate files should only be included
  if global_settings_key = <landingzone-key> is defined.
- hence, reading global_settings from first tfstate is removed.
try(data.terraform_remote_state.remote[keys(var.landingzone.tfstates)[0]].outputs.global_settings, null),
- updated tags - tags defined in global_settings {} or custom_variables {} must have highest precedence.
@arnaudlh arnaudlh added this to the 2209 milestone Sep 15, 2022
@arnaudlh arnaudlh added the bug Something isn't working label Sep 15, 2022
@nusrath432 nusrath432 closed this by deleting the head repository Feb 17, 2023
@nusrath432 nusrath432 removed their assignment Feb 17, 2023
@nusrath432 nusrath432 changed the title fix(caf_solution/locals.remote_tfstates.tf): changing order of global_settings… [Fork Deleted] Replaced by https://github.com/Azure/caf-terraform-landingzones/pull/448 Feb 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants