Open marcellpatonay opened 6 months ago
Voting for Prioritization
Volunteering to Work on This Issue
Hi @marcellpatonay!
Can you share a cleaned up version of your aws_cloudsearch_domain
config? It seems that the crash has to do with that resource only.
Hi @aristosvo here's the config:
resource "aws_cloudsearch_domain" "domain" {
name = var.domain_name
scaling_parameters {
desired_instance_type = var.instance_type
}
endpoint_options {
enforce_https = var.enforce_https
}
dynamic "index_field" {
for_each = var.indexes
content {
name = index_field.value["name"]
type = index_field.value["type"]
search = index_field.value["search"]
return = index_field.value["return"]
sort = index_field.value["sort"]
highlight = index_field.value["highlight"]
analysis_scheme = index_field.value["analysis_scheme"]
}
}
}
variable "enforce_https" {
description = "Whether to enforce HTTPS on the domain"
type = bool
default = false
}
variable "domain_name" {
description = "The CloudSearch domain name"
type = string
}
variable "instance_type" {
description = "Size of the instance to use for the CloudSearch domain"
type = string
default = "search.large"
}
module "cloudsearch" {
source = "gitlab.com/cardmarket/terraform-modules/aws//cloudsearch"
version = "1.0.1-1-beta"
domain_name = "product-dev"
instance_type = "search.small"
enforce_https = "false"
multi_az = "false"
indexes = [
{
name = "title"
type = "text"
search = true
return = true
sort = false
highlight = false
analysis_scheme = "_en_default_"
},
]
}
@marcellpatonay I cannot really locate the issue without extra information, I'm afraid. I cannot replicate the issue in a test.
Has there been external interaction with the indexes on de cloudsearch
domain resource or any service which might have interacted with it? Is the resource imported by any chance?
@aristosvo We did some futher testing.
Copied over the state to my local machine and performed operations against that.
terraform state rm
The issue also resolved itself somehow. Today, an hour ago, we noticed that our pipelines in gitlab were passing.
And to answer your questions:
+1 Really appreciate the help! Thank you!
Terraform Core Version
1.5.7
AWS Provider Version
5.42.0
Affected Resource(s)
aws_subnets aws_iam_policy aws_iam_role aws_security_group aws_kms_key aws_vpc aws_cloudsearch_domain
Expected Behavior
Expected plan to complete
Actual Behavior
Terraform failed with the following error:
attached is a partial debug log
Relevant Error/Panic Output Snippet
Terraform Configuration Files
example:
Please note that if run against an empty state the configuration successfully applies
Steps to Reproduce
Would be hard to reproduce, If configuration is run against an empty state the issue described above doesn't appear.
Debug Output
debug.log
Panic Output
No response
Important Factoids
State is managed by Gitlab, besides that it's pure terraform. The issue happens both locally and in gitlab pipelines. Local env: arm macs Gitlab pipelines: saas-linux-small-amd64
References
similar issues: https://github.com/hashicorp/terraform-provider-aws/issues/36588 https://github.com/hashicorp/terraform-provider-aws/issues/32212
Would you like to implement a fix?
None