-
-
Notifications
You must be signed in to change notification settings - Fork 65
feat: Create a new configuration when the Kafka version is changed to avoid ConflictException: A resource with this name already exists
errors
#40
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
Conversation
On the 1 and 2 screenshot you can see what terraform apply is doing. Because I'm changing MSK engine version it needs to recreate configuration with new engine version. From documentation we know that random_id generate new values only when created. Now there is no way for this resource to be recreated in order to generate new value. So I added |
why do we need to have |
I had issues with revisions not updating the actual cluster properties. Recreate works all the time and causes no downtime. If you have different experiences, please share |
I don't, which is why I was asking. looking around I see other issues related to this hashicorp/terraform-provider-aws#15795 but not sure what the appropriate course of action is here |
I think, I can change this PR to be cluster version upgrade only and create separate PR for recreating configuration if |
@bryantbiggs So, do I need to change this PR to be only related to changing kafka_version and create separate for the configuration changing? |
yes - lets only do the |
Error occurs when trying to upgrade kafka_version.
ConflictException: A resource with this name already exists
errors
ConflictException: A resource with this name already exists
errorsConflictException: A resource with this name already exists
errors
## [2.9.0](v2.8.1...v2.9.0) (2024-09-10) ### Features * Create a new configuration when the Kafka version is changed to avoid `ConflictException: A resource with this name already exists` errors ([#40](#40)) ([d5b4e6c](d5b4e6c))
This PR is included in version 2.9.0 🎉 |
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
I've tried to upgrade MSK cluster that was created by this module and got an error resource with this name already exists. After checking source files, I found that random_id is not recreated on every update of the configuration or changing version of the MSK cluster.
You can read about this here: https://registry.terraform.io/providers/hashicorp/random/latest/docs
Motivation and Context
Seamless experience using this module while upgrading MSK cluster version or changing configuration parameters.
Breaking Changes
No breaking changes.
How Has This Been Tested?
examples/*
to demonstrate and validate my change(s)examples/*
projectspre-commit run -a
on my pull requestpre-commit run -a
[INFO] Initializing environment for https://github.com/antonbabenko/pre-commit-terraform.
[INFO] Initializing environment for https://github.com/pre-commit/pre-commit-hooks.
[INFO] Installing environment for https://github.com/pre-commit/pre-commit-hooks.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
Terraform fmt............................................................Passed
Terraform docs...........................................................Passed
Terraform validate with tflint...........................................Passed
Terraform validate.......................................................Passed
check for merge conflicts................................................Passed
fix end of files.........................................................Passed
trim trailing whitespace.................................................Passed