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

force_path_style in S3 backend is now deprecated #3472

Open
lazzurs opened this issue Oct 12, 2024 · 4 comments · May be fixed by #3473
Open

force_path_style in S3 backend is now deprecated #3472

lazzurs opened this issue Oct 12, 2024 · 4 comments · May be fixed by #3473
Labels
bug Something isn't working

Comments

@lazzurs
Copy link
Contributor

lazzurs commented Oct 12, 2024

Describe the bug

force_path_style is now deprecated and should be replaced with use_path_style

Steps To Reproduce

Steps to reproduce the behavior, code snippets and examples which can be used to reproduce the issue.

Be sure that the maintainers can actually reproduce the issue. Bug reports that are too vague or hard to reproduce are hard to troubleshoot and fix.

force_path_style = true

Will produce the error

tofu: │ Warning: Deprecated Parameter
tofu: │
tofu: │   on provider.tf line 6, in terraform:
tofu: │    6:   backend "s3" {}
tofu: │
tofu: │ Parameter "force_path_style" is deprecated. Use "use_path_style" instead.

This should be changed to

```hcl
use_path_style = true

Versions

  • Terragrunt version: latest
  • OpenTofu/Terraform version: latest

Additional context

https://developer.hashicorp.com/terraform/language/backend/s3#force_path_style

I have a branch with the code changes to change the existing configuration option to the new one. It is a straight replacement. If the community thinks it is better I can add both but I think a straight replacement with a breaking change warning would be better as it will stop any new deployments of the deprecated configuration option.

@lazzurs lazzurs added the bug Something isn't working label Oct 12, 2024
@lazzurs lazzurs linked a pull request Oct 12, 2024 that will close this issue
4 tasks
@denis256
Copy link
Member

It looks like use_path_style was introduced since version 1.6.0, we may need to track the version of Terraform/Tofu to know which field to pass

hashicorp/terraform#33765

@yhakbar
Copy link
Collaborator

yhakbar commented Oct 15, 2024

So, to give concrete next steps:

  1. Support both, as this is a scenario where it's better to avoid a breaking change.
  2. Leverage OpenTofu/Terraform version information to decide whether to emit a warning that they are using a deprecated field.
  3. (Optional) When feat: Adding Strict Package #3424 is merged, consider adding a strict control that users can use to opt-in to a requirement that they use the latest configuration here.

As long as OpenTofu/Terraform versions that use force_path_style are supported by Terragrunt, we won't remove the ability to set it.

lazzurs added a commit to lazzurs/terragrunt that referenced this issue Oct 27, 2024
As per the documentation linked below the force_path_style option is now
deprecated and should be changed to use_path_style.

https://developer.hashicorp.com/terraform/language/backend/s3#force_path_style

As per the comments in gruntwork-io#3472 I have made this PR to support both options
but commented the code and the documentation to indicate that the old
option is now deprecated
lazzurs added a commit to lazzurs/terragrunt that referenced this issue Oct 27, 2024
As per the documentation linked below the force_path_style option is now
deprecated and should be changed to use_path_style.

https://developer.hashicorp.com/terraform/language/backend/s3#force_path_style

As per the comments in gruntwork-io#3472 I have made this PR to support both options
but commented the code and the documentation to indicate that the old
option is now deprecated
@lazzurs
Copy link
Contributor Author

lazzurs commented Oct 27, 2024

I have updated the PR to support both options.

If needed I can add version checks to see which to use but I don't think this is done for other commands and is generally left for the user to manage. Happy to be corrected on this of course.

@yhakbar
Copy link
Collaborator

yhakbar commented Dec 20, 2024

The associated PR has gone stale, re-requesting a revisit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants