Cloudwatch query based, dependent variables

I have metrics (custom-metrics-namespace) with EnvironmentName dimension.
I have defined variable:
$enviromentName dimension_values(eu-west-1, custom-metrics-namespace, mem, EnvironmentName)

I want to define another variable like:
$autoScalingGroupName ec2_instance_attribute(eu-west-1,, { “tag:elasticbeanstalk:environment-name”: [ $environmentName ] })

I got error : Template variables could not be initialized: Unexpected token $ in JSON at position 45

How I can handle it ?

Inside the brackets must be valid JSON, wrap $environmentVariable in double quotes:

{"tag: elasticbeanstalk: environment - name": ["$environmentName"]}

I’ve tried that earlier without success but it works for me now. Thank You!