Variable for RDS DBClusterIdentifier

I have an AWS Cloudwatch RDS dashboard whose datasource is a variable passed in the query string. Like: https://(URL and other query params)&var-datasource=atlas

The issue is that for each panel, I also need to set the DBClusterIdentifier when changing data sources:

grafana-Screen Shot

Using a template variable here seems the obvious solution. Something like: [[datasource]]-nonprod-um-aurora. But I have been unable to get this to work. What type of variable should I be using? Have tried several, but “Custom” seems like the one to use. When I put something like [[datasource]]-nonprod-um-aurora in the value or query field, I get that literally in the preview of values area. No interpolation of the datasource variable is taking place.

Do I have this completely wrong? Is it even possible (seems like it should be).

Thanks!

On my side; I’m trying to query these dbidentifiers to use the resulting variable, but the problem i’m having is to query for rds instances and being able to filter the result using tags…

I’m relying on the piece of doc https://grafana.com/docs/grafana/latest/features/datasources/cloudwatch/#examples-templated-queries

But all i can do now is extract the dbname using the following query :
dimension_values(default, AWS/RDS, CPUUtilization, DBInstanceIdentifier)

That would answer your query…

Does anyone know how to query for databases applying a tag filter ? I cant find a piece of doc for that. Tried to play with the resource_arns method, but i cant find the correct 2nd parameter for this (For EC2, it’s ec2:instances, for RDS i tried many possibilities like rds:dbinstance / rds:dbi / rds:instance …).

Regards

Ok to answer myself, i found that the variable should be set to query rds:db type object. Simple as that.
Found it when tried the query with “*” as the second parameter of resource_arns method.

Sorry I couldn’t help with your issue, but your post helped me solve mine. Thanks!

Screen Shot 2020-02-04 at 12.22.14 PM