Open ajax-koval-i opened 2 weeks ago
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
Description
In your module, the resources
aws_msk_configuration
andrandom_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, theaws_msk_configuration
will always be recreated since you use therandom_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-3
Import successful
terragrunt plan
comand output:Force replacement here (recreate of the resource).
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 permalinkExpected behavior
Adding the ability to omit the
random_id
resource from the end of the configuration nameActual behavior
Cannot correctly import resources to public module.