Cannot correctly import MSK configuration
Description
In your module, the resources aws_msk_configuration and random_id are used.
If the aws_msk_configuration resource was created manually or by another module and was given a simple name, for example, example-configuration, when importing this resource into your module, the aws_msk_configuration will always be recreated since you use the random_id resource in the configuration name.
It would be great to have the option to correctly import resources into your public module.
For example, by adding the ability to disable the random-id suffix at the end of the name.
Versions
-
Module version: 2.6.0
-
Terraform version: Terraform v1.9.3
-
Provider version(s): provider registry.terraform.io/hashicorp/aws v5.53.0 provider registry.terraform.io/hashicorp/random v3.6.0
Reproduction Code [Required]
-
State list
-
Importing resource aws_msk_configuration.this[0] command:
terragrunt import 'aws_msk_configuration.this[0]' arn:aws:kafka:eu-west-3:xxxxxxxxxxxx:configuration/xxxxx-xxxxxx/xxxxxxxx-xxxx-4ddb-9f0f-5785e60adbd6-3Import successful
-
terragrunt plancomand output:
Force replacement here (recreate of the resource).
- Block of code for
aws_msk_configuration:
NAMES ARE IDENTICAL (in code, and in aws)
Forces replacement here only for one reason - you added random_id resource at the end of the configuration name
Here is permalink
Expected behavior
Adding the ability to omit the random_id resource from the end of the configuration name
Actual behavior
Cannot correctly import resources to public module.
this was intended based on user feedback - without it, if you make a change to the configuration and try to apply it, it fails with a "this resource already exists" message. so the random part was added to allow folks to modify the configs and apply it.
If you are importing, I would suggest letting Terraform replace the configs and you're now adopted into the module. If you want to modify this config in the future, you'll inevitably face this issue
see #17
This issue has been automatically marked as stale because it has been open 30 days with no activity. Remove stale label or comment or this issue will be closed in 10 days
This issue was automatically closed because of stale in 10 days
I'm going to lock this issue 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 similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.