terraform-aws-cloudfront-s3-cdn
terraform-aws-cloudfront-s3-cdn copied to clipboard
feat: Backport cloudposse/cloudfront-cdn/aws improvements
what
TBD
why
references
[!IMPORTANT]
Review skipped
Auto incremental reviews are disabled on this repository.
Please check the settings in the CodeRabbit UI or the
.coderabbit.yamlfile in this repository. To trigger a single review, invoke the@coderabbitai reviewcommand.You can disable this status message by setting the
reviews.review_statustofalsein the CodeRabbit configuration file.
๐ Walkthrough
Walkthrough
This update introduces a new minimal example configuration and its associated variable file, revises the main Terraform logic to consolidate and simplify CORS and CloudFront origin configuration, and overhauls the input variable schema to favor optional fields with defaults, adds new timeout and origin shield options, and removes a deprecated variable.
Changes
| Cohort / File(s) | Change Summary |
|---|---|
New Minimal Exampleexamples/complete/minimal.tf, examples/complete/minimal.us-east-2.tfvars |
Adds a minimal Terraform example and a corresponding variable file for the us-east-2 region, demonstrating basic module usage with access logging disabled and specifying core deployment parameters. |
Main Logic & Resource Configurationmain.tf |
Refactors resource logic to use a consolidated CORS origins local, replaces lookup() with direct attribute access, adds origin timeout and dynamic origin shield support, and simplifies conditional expressions for origins and error responses. |
Input Variable Schema Overhaulvariables.tf |
Makes many input variables optional with sensible defaults, introduces new variables for origin timeouts and origin shield, and removes the versioning_enabled variable, altering the module's input schema and flexibility. |
Estimated code review effort
๐ฏ 3 (Moderate) | โฑ๏ธ ~15โ20 minutes
Possibly related PRs
- cloudposse/terraform-aws-cloudfront-s3-cdn#326: Adds
origin_access_control_idtocustom_originsand updates its usage, which is directly extended and refined in this PR through further logic and schema changes for origin access control.
โจ Finishing Touches
๐งช Generate unit tests
- [ ] Create PR with unit tests
- [ ] Post copyable unit tests in a comment
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
๐ชง Tips
Chat
There are 3 ways to chat with CodeRabbit:
- Review comments: Directly reply to a review comment made by CodeRabbit. Example:
I pushed a fix in commit <commit_id>, please review it.Explain this complex logic.Open a follow-up GitHub issue for this discussion.
- Files and specific lines of code (under the "Files changed" tab): Tag
@coderabbitaiin a new review comment at the desired location with your query. Examples:@coderabbitai explain this code block.
- PR comments: Tag
@coderabbitaiin a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:@coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.@coderabbitai read src/utils.ts and explain its main purpose.@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
Support
Need help? Create a ticket on our support page for assistance with any issues or questions.
CodeRabbit Commands (Invoked using PR comments)
@coderabbitai pauseto pause the reviews on a PR.@coderabbitai resumeto resume the paused reviews.@coderabbitai reviewto trigger an incremental review. This is useful when automatic reviews are disabled for the repository.@coderabbitai full reviewto do a full review from scratch and review all the files again.@coderabbitai summaryto regenerate the summary of the PR.@coderabbitai generate docstringsto generate docstrings for this PR.@coderabbitai generate sequence diagramto generate a sequence diagram of the changes in this PR.@coderabbitai generate unit teststo generate unit tests for this PR.@coderabbitai resolveresolve all the CodeRabbit review comments.@coderabbitai configurationto show the current CodeRabbit configuration for the repository.@coderabbitai helpto get help.
Other keywords and placeholders
- Add
@coderabbitai ignoreanywhere in the PR description to prevent this PR from being reviewed. - Add
@coderabbitai summaryto generate the high-level summary at a specific location in the PR description. - Add
@coderabbitaianywhere in the PR title to generate the title automatically.
CodeRabbit Configuration File (.coderabbit.yaml)
- You can programmatically configure CodeRabbit by adding a
.coderabbit.yamlfile to the root of your repository. - Please see the configuration documentation for more information.
- If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation:
# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
Documentation and Community
- Visit our Documentation for detailed information on how to use CodeRabbit.
- Join our Discord Community to get help, request features, and share feedback.
- Follow us on X/Twitter for updates and announcements.
๐ฅ This pull request now has conflicts. Could you fix it @jwadolowski? ๐
๐ฅ This pull request now has conflicts. Could you fix it @jwadolowski? ๐
@johncblandii @Gowiem can we start the tests on this please?
/terratest
All tests failed due to BucketAlreadyExists errors. Since S3 bucket names must be globally unique, we should use dynamically generated names during testing.
[!IMPORTANT]
Cloud Posse Engineering Team Review Required
This pull request modifies files that require Cloud Posse's review. Please be patient, and a core maintainer will review your changes.
To expedite this process, reach out to us on Slack in the
#pr-reviewschannel.
It turned out that the 2nd module instance I added to minimal.tf resulted in an S3 bucket name collision. These changes should resolve the problem.
By the way, I modified both Makefiles to streamline local testing:
test/Makefile- justmake(without any concrete targets) runsinitautomatically now (previously it had to be executed by hand to populate thetest/.test-harnessdirectory)test/src/Makefile- the-get-plugins=trueflag was removed in Terraform v0.15.0 (seeCHANGELOG.md), so it doesn't make sense to reference it any longer
@goruha @johncblandii @Gowiem can you start the tests again, please?
/terratest
/terratest
These changes were released in v1.0.0.
These changes were released in v1.0.1.