You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
bugcliconfirmeda Terraform Core team member has reproduced this issuecoreexplaineda Terraform Core team member has described the root cause of this issue in code
Terraform v1.5.3
on darwin_arm64
+ provider registry.terraform.io/hashicorp/aws v5.9.0
Terraform Configuration Files
# the specific provider does not make a difference, this is just an AWS exampleprovider"aws" {
endpoints {
s3="http://minio.service.home.consul"
}
region="ap-southeast-2"skip_credentials_validation=trueskip_requesting_account_id=trues3_use_path_style=true
}
resource"aws_s3_bucket""bucket" {
bucket="distribution"
}
check"consul_health" {
data"aws_s3_bucket""distribution" {
bucket="distribution"
}
assert {
condition=data.aws_s3_bucket.distribution.arn=="arn:aws:s3:::distribution"error_message="bucket arn does not equal \"arn:aws:s3:::distribution\""
}
}
terraform import aws_s3_bucket.bucket "distribution"
results in a crash
Additional Context
The issue seems to occur when any check block with a data source is defined while importing a resource. in this example I used a data source matching the imported resource but it could be any data source.
I initially caused the crash using the nomad provider and it does not seem to be provider specific.
References
No response
The text was updated successfully, but these errors were encountered:
Hi @tristanmorgan, thanks for filing this issue! I can confirm I am able to replicate. Just a slight clarification for clarity: It's the nested data block that is causing the crash rather than the check block itself. Still a good find, and something I will looking into fixing.
A quick explanation. The nested data blocks are missing the logic telling them to skip evaluation during an import operation. This logic has been applied to the other elements of the check block. This is then crashing when the scoped data block attempts to report it's checkable status and the system isn't expecting any checkable statuses.
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.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
bugcliconfirmeda Terraform Core team member has reproduced this issuecoreexplaineda Terraform Core team member has described the root cause of this issue in code
Terraform Version
Terraform Configuration Files
Debug Output
Crash log from running
TF_LOG=debug terraform import aws_s3_bucket.bucket "distribution"
Expected Behavior
Successful import of resource
Actual Behavior
Terraform crashed.
Steps to Reproduce
Using the sample code
results in a crash
Additional Context
The issue seems to occur when any check block with a data source is defined while importing a resource. in this example I used a data source matching the imported resource but it could be any data source.
I initially caused the crash using the nomad provider and it does not seem to be provider specific.
References
No response
The text was updated successfully, but these errors were encountered: