Pass packer variable to groovy script

I am trying to pass the variable value from packer ami.json file to groovy script when unable to do so, Please guide me through the syntax. ami.json

    "variables": {
      "Reactjs": "16.13.0"

 "provisioners": [
            "type": "file",
            "source": "./plugin.groovy",
            "destination": "/plugin.groovy"

Grovy script:

final node_versions = [
    'Reactjs': '16.13.0'

I want to pass the version from ami.json to groovy file how can I achieve that