[Bug]: Provider Crashes While Importing Cloudsearch Resource #35884
Labels
bug
Addresses a defect in current functionality.
crash
Results from or addresses a Terraform crash or kernel panic.
service/cloudsearch
Issues and PRs that pertain to the cloudsearch service.
service/iam
Issues and PRs that pertain to the iam service.
Milestone
Terraform Core Version
1.5.5
AWS Provider Version
5.37.0
Affected Resource(s)
aws_cloudsearch_domain
Expected Behavior
The Cloudsearch resource I created through a module with a dynamic block for the
index_field
should be capable of importing an existing Cloudsearch domain.Actual Behavior
The AWS provider crashes before the import can complete successfully.
Relevant Error/Panic Output Snippet
Terraform Configuration Files
Module main.tf file:
Module variables.tf file:
File calling the module:
Steps to Reproduce
Run
terraform import module.prod.aws_cloudsearch_domain.domain prod
in the folder where the calling file is defined.Debug Output
No response
Panic Output
No response
Important Factoids
The existing CloudSearch domain has over 30 indexes. I was planning to import the resource first so that I could make sure the existing index was lining up correctly with the values that I fed into the module. Other AWS resources can import successfully like this, so I thought this would work.
I also removed the dynamic block and tried hardcoding an
index_field
value into the module instead with real values used on the live resource, and experienced the same error. I suspect the error originates from a mismatched number of defined indexes in the code compared to how many indexes are on the live cloudsearch domain, but would have expected the provider to still import the resource and attempt to delete any undefined indexes on the live resource.UPDATE: Even when I added all the expected indexes and confirmed that the number of indexes defined in Terraform match up with the indexes on the live resource, the provider still crashes.
References
No response
Would you like to implement a fix?
None
The text was updated successfully, but these errors were encountered: