Terraform Test Feature & Clean Up Failures

When I am using the new test feature I am increasingly seeing this message “Error: Failed to clean up after tests” . However every time I have gone to the console to look for the resources that are reported as not having been cleaned up they do not exist. The knock on effect of this is that tests always report as passed even if they should not (I suspect they are not even being expected in this case).

I don’t really have enough context from the test feature to really tell me what is going wrong. If I run the tests with TF_LOG=WARN I often see output like this:

2021-06-21T10:29:54.837+0100 [WARN]  Provider "registry.terraform.io/hashicorp/aws" produced an invalid plan for module.main.aws_sns_topic.topic, but we are tolerating it because it is using the legacy plugin SDK.
    The following problems may be the cause of any confusing errors from downstream operations:
      - .application_failure_feedback_role_arn: planned value cty.StringVal("") for a non-computed attribute
      - .fifo_topic: planned value cty.False for a non-computed attribute
      - .delivery_policy: planned value cty.StringVal("") for a non-computed attribute
      - .http_failure_feedback_role_arn: planned value cty.StringVal("") for a non-computed attribute
      - .content_based_deduplication: planned value cty.False for a non-computed attribute
      - .firehose_failure_feedback_role_arn: planned value cty.StringVal("") for a non-computed attribute
      - .http_success_feedback_role_arn: planned value cty.StringVal("") for a non-computed attribute
      - .sqs_success_feedback_role_arn: planned value cty.StringVal("") for a non-computed attribute
      - .application_success_feedback_role_arn: planned value cty.StringVal("") for a non-computed attribute
      - .lambda_success_feedback_role_arn: planned value cty.StringVal("") for a non-computed attribute
      - .display_name: planned value cty.StringVal("") for a non-computed attribute
      - .firehose_success_feedback_role_arn: planned value cty.StringVal("") for a non-computed attribute
2 Likes