Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce proper backend config merge #61

Merged
merged 4 commits into from
Sep 20, 2024
Merged

Conversation

lakkeger
Copy link
Contributor

@lakkeger lakkeger commented Sep 9, 2024

Motivation

Backend configs are currently merged selectively, due to this some options are not usable as the override file's takes precedent over the user defined backend options.

Note: users have to use the right use_path_style/force_path_style option for the given provider, this is not handled by tflocal.

Changes

  • introduces backend configuration merging, on top of the default backend options new ones only added to the dict if the user defines them
  • tests backend merging by adding test_s3_backend_configs_merge, checks generated override file for the following extra options added by the "user":
    • acl
    • encryption
    • use_path_style

@lakkeger lakkeger added the enhancement New feature or request label Sep 9, 2024
@lakkeger lakkeger self-assigned this Sep 9, 2024
@lakkeger lakkeger linked an issue Sep 9, 2024 that may be closed by this pull request
@lakkeger lakkeger requested a review from cloutierMat September 9, 2024 07:59
Copy link

@cloutierMat cloutierMat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome!

Thanks for adding this. It will help greatly with allowing a more configurable backend for our Terraform configuration.

I just left a nit, feel free to ignore if you think it helps with code readability.

bin/tflocal Outdated Show resolved Hide resolved
@lakkeger lakkeger merged commit e623ff6 into main Sep 20, 2024
3 checks passed
@lakkeger lakkeger deleted the backend_merge_feature branch September 20, 2024 11:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

tflocal overwrites or removes some S3 backend configurations
2 participants