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

feat!: Added support for date-based partitioning. Bump AWS provider version to 5.x and Terraform to 1.0 #268

Merged
merged 6 commits into from
Jan 13, 2024

Conversation

EreminAnton
Copy link
Contributor

@EreminAnton EreminAnton commented Dec 21, 2023

Description

Add optional target_object_key_format configuration block to support automatic date-based partitioning. This functionality was released in 5.27.0 version of AWS provider.

Motivation and Context

To leverage the new functionality of access logging.

Breaking Changes

As I understand it, this pins the provider's version to 5.27.0 but offers a significant update in access logs partitioning.

How Has This Been Tested?

  • I have updated at least one of the examples/* to demonstrate and validate my change(s)
  • I have tested and validated these changes using one or more of the provided examples/* projects
    I deployed every possible combination of the target_object_key_format configuration, placed objects, and waited until access logs arrived in the required format.
  • I have executed pre-commit run -a on my pull request

@EreminAnton EreminAnton changed the title Add target_object_key_format configuration block to support automatic date-based partitioning feat(logging): Add target_object_key_format configuration block to support automatic date-based partitioning Dec 21, 2023
@dickc-sg
Copy link

dickc-sg commented Jan 4, 2024

I was just about to submit a PR for this myself and then realized I had overlooked yours, @EreminAnton . I approached this a little differently:

partition_date_source is required if partitioned_prefix is declared and so I removed the try():

partition_date_source = target_object_key_format.value.partitioned_prefix["partition_date_source"]

I also chose different logic for the for_each in the simple_prefix dynamic that was more similar to the logic used other places in this module:

for_each = try([target_object_key_format.value.simple_prefix], [])

Those are the only differences that I'm aware of.

Testing my fork by generating plans seemed to work well. Errors, as expected, were thrown:

  • if both partitioned_prefix and simple_prefix were declared in logging input
  • if target_object_key_format was declared and empty

Otherwise, the plans came back successful. I am not sure which approach is best but thought I'd comment here for review.

@undeadops
Copy link

I was about to submit a patch for this as well, but thought I should look at open PRs first. Good thing I did, saved me the effort.

@antonbabenko antonbabenko changed the title feat(logging): Add target_object_key_format configuration block to support automatic date-based partitioning feat!: Add target_object_key_format configuration block to support automatic date-based partitioning Jan 12, 2024
Copy link
Member

@antonbabenko antonbabenko left a comment

Choose a reason for hiding this comment

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

Please update versions.tf everywhere to require the minimum version of AWS provider 5.27 and Terraform 1.0 (this will fix the failing CI runs).

@EreminAnton
Copy link
Contributor Author

Hello! I have updated versions.tf. However, the pre-commit Terraform wrapper with for_each in the module has resulted in numerous changes in the /wrappers directory. I'm unsure if this is the expected outcome.

@antonbabenko antonbabenko changed the title feat!: Add target_object_key_format configuration block to support automatic date-based partitioning feat!: Added support for date-based partitioning. Bump AWS provider version to 5x Jan 13, 2024
@antonbabenko antonbabenko changed the title feat!: Added support for date-based partitioning. Bump AWS provider version to 5x feat!: Added support for date-based partitioning. Bump AWS provider version to 5.x and Terraform to 1.0 Jan 13, 2024
@antonbabenko antonbabenko merged commit f8531e4 into terraform-aws-modules:master Jan 13, 2024
13 of 17 checks passed
@antonbabenko
Copy link
Member

This PR is included in version 4.0.0 🎉

Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants