Terraform grafana workspace key expiration issue

Hello, I have an issue trying to provision a grafana dashboard through terraform. Since the grafana provider takes a url and auth argument, where the value of auth is the aws_grafana_workspace_api_key, the key has an expiration date. I am trying to avoid dealing with a key that expires by generating a new random string for the aws_grafana_workspace_api_key resource everytime terraform plan/apply is run. The plan shows that what I have configured will randomly generate a key, but the terraform plan shows an error that states that " the Grafana client is required for grafana_data_source & grafana_dashboard. Set the auth and url provider attributes" I added a depends_on = [ aws_grafana_workspace_api_key.key ] statement to the data source and dashboard resource and even added [ lifecycle {create_before_destroy = true} ] to the aws_grafana_workspace_api_key resource but I get the same error. Do you have any thoughts on this OR could you direct me to where I could get pointers on solving this errror ?