-
-
Notifications
You must be signed in to change notification settings - Fork 710
fix: Strip leading ./
in S3 key
#191
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
fix: Strip leading ./
in S3 key
#191
Conversation
Looks good. Could you also add a note in README about the benefits of using |
IMO, the only real benefit of using Anyway, maybe there should be a way to specify the desired S3 prefix to use in the bucket in place of |
I like the idea of having an additional Could you add it to this PR and then I will merge this one? |
2acb641
to
20508f4
Compare
…like `${path.root}/.terraform/lambda-builds/`
20508f4
to
15ee7b7
Compare
I named the parameter |
The name is perfect. Does this PR work and ready for the final review? :) |
Well, I tested it with the As a side note, a few weeks ago, I started exploring the conversion of the examples to actual terraform tests: https://www.terraform.io/docs/language/modules/testing-experiment.html This could be used to assert some expected behavior and run all those checks in CI. |
I will do a review now. Regarding testing. It is one of the rather hot topics for me, too. I did a couple of episodes reviewing Here are two of my episodes with timestamps:
Let me know what is your opinion or experience with |
./
in S3 key if artifacts_dir
is set to something like ${path.root}/mypath/
(take 2)./
in S3 key
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. |
Description
This change strips the leading
./
in S3 key ifartifacts_dir
is set to something like${path.root}/mypath/
.Motivation and Context
Without this change, this configuration:
gives the following plan excerpt:
Which fails at apply:
With this change, this part of the plan:
applies successfully.
Breaking Changes
This should not be a breaking change as keys with a leading
./
are not accepted by S3.How Has This Been Tested?
examples/*
projectsTested with
examples/complete
adding the following:Without the change from this PR:
With the change from this PR:
I have also tested this change with my own terraform configurations.
Note: unlike #168, this second PR does not use
dirname()
andbasename()
functions that would not work on Windows.