-
-
Notifications
You must be signed in to change notification settings - Fork 323
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
Random suffix to s3 bucket #252
Random suffix to s3 bucket #252
Conversation
Shouldn't happen too often but makes life easier. +1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, will run a check in the next days
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few comments
@fliphess did you already had time to have a look on my comments? |
@npalm Hey Niek, Sorry, for the late response, I'm on vacation for a few weeks so not working much on terraform at the moment, which is why I didn't do anything with your suggestions so far yet. It is on my todo list at work. (This is my last week, coming Friday it's back to work again) I'll fixup the code with your suggestions in the beginning of next week if that's okay. |
@fliphess enjoy you holidays |
@fliphess just a kindly reminder. If you have some time would be great if you can fix minor comment |
@npalm Oh thanks for the reminder! It completely slipped my mind! 🤦 |
@fliphess thx will check asap |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fliphess variable name in main.tf of root module is not mahcing, created suggestions in the PR.
Co-authored-by: Niek Palm <[email protected]>
Co-authored-by: Niek Palm <[email protected]>
Co-authored-by: Niek Palm <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fliphess thanks!
* Set a random suffix on the bucket name for easy recreation * Add new module option to main module * Update readme * Fix oopsy while copy pasting * Replace a tab with 2 spaces * Use format() for both string formattings * Make the linter happy * Rename variable * Set a count on random_string so it's only used when applicable * update readme for cache module * Update modules/cache/variables.tf Co-authored-by: Niek Palm <[email protected]> * Update modules/cache/main.tf Co-authored-by: Niek Palm <[email protected]> * Update modules/cache/main.tf Co-authored-by: Niek Palm <[email protected]> Co-authored-by: Niek Palm <[email protected]>
Hey Niek!
Feel free to reject this if you don't think it's useful :) I needed it to quickly recreate the module multiple times without having to change the bucket name in every run
(as a result of testing some cloud-init userdata changes in our setup).
Description
This change adds the option to append a random string suffix to the S3 bucket name.
As bucket names can only exist once, it's not possible to destroy the module and reinstall after without config changes as the previously used bucket name is not free for use anymore after teardown. By adding a random string to the bucket name this problem is solved.
This can also be useful if you want to use the same configuration for multiple regions.
Migrations required
NO - Not if
cache_bucket_set_suffix
is not set to true.Verification
Not yet! Will test later this week.
Documentation
^ Is this stil actual? I could find the directory anymore. Otherwise I updated the README.md.